[pr-fix][shaders][linux-proton] Texture detile shader: compile it through the hlsl.rs fallback #133
Loading…
Reference in a new issue
No description provided.
Delete branch "jensmonne/Darner:pr/detile-dxc-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
gpudetile::makecallsD3DCompileitself, so the texture detile shader is the one compute helper that skips the fallback inhlsl.rs. Under Wine/Proton without Microsoft'sd3dcompiler_47.dll, Wine's own compiler takes the shader but leaves out its[RootSignature],CreateRootSignaturethen fails withE_FAIL, anddetiler()logs "the detile shader could not be made; textures are detiled on the PC". SoDARNER_GPU_DETILE=1has no effect there.This compiles it with
hlsl::compile_compute, likeflicker.rsandindirect.rs. That function already notices a missing root signature and then compiles with DXC. The error text the old code logged is still logged, bycompile_compute. On Windows nothing changes: the system's compiler takes the shader, as before.One side effect:
record_preludes(host.rs) records preludes one after another wheneverdetiler()isSomeand a job has uploads, even withDARNER_GPU_DETILEunset. With this change, Wine without Microsoft's compiler behaves there as Windows already does. Before, the missing detiler let those preludes record in parallel. I did not measure the effect on frame rate.How it was tested
e83730e(this branch, on main57dea7f), against57dea7f.cargo xwin, targetx86_64-pc-windows-msvc, rustc 1.98.1; tests run under Proton Experimental 11.0-20261123b's Wine, vkd3d-proton and DXVK DLLs, DXC from Microsoft's DirectXShaderCompiler release):cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: clean on this branch and on57dea7f.cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings: clean on this branch and on57dea7f.gpudetile::tests::the_card_detiles_as_the_cpu_doesdoes not run under Wine ("no software adapter: not run", there is no WARP), so it passes on both revisions without checking anything.gpudetile::makeon the default adapter (RTX 5080 through vkd3d-proton) under Wine with Wine's ownd3dcompiler_47:Err(HRESULT(0x80004005) "Call failed.")on57dea7f(3 of 3 runs),Okon this branch (3 of 3). With Microsoft'sd3dcompiler_47.dllnext to the test binary:Okon both revisions (2 of 2 each).darner-gpulib test binary under Wine: 1716 passed, 24 failed on57dea7f; 1715 passed, 25 failed on this branch. The failures are the same tests on both, apart fromwatch::tests::ask_once_by_res_splits_reservations_without_refusals, which passed 5 of 5 alone on both revisions.cargo xtask policyon this branch: "asset policy: 553 files ok".cargo test --workspace, was not.bd0de0c) with this change applied, plus my local Linux patches that are not part of this PR. RTX 5080, NVIDIA 620.73, Proton Experimental 11.0-20261123b, Series X profile, 2560x1440, DLSS Super Resolution at the quality scale, frame generation off, uncapped. A scripted run from the same save: menus, a 150-second walk, then standing; one run each, about 6 minutes in the world:DARNER_GPU_DETILE=1: the log shows "texture detile: the system's HLSL compiler refused it (its code holds no root signature: the compiler left out [RootSignature]); trying DXC", then "texture detile: compiled by DXC" and "title textures are detiled on the card". The card detiled 16.1 textures a frame in 53.9 dispatches on average. Median 3.4 fps, 10th percentile 2.4.DARNER_GPU_DETILEunset: median 23.8 fps, 10th percentile 22.0.d3dcompiler_47,DARNER_GPU_DETILE=1(this change plays no part): median 3.3 fps, 10th percentile 2.5.cargo test --workspace: only thedarner-gpulib tests, under Wine. The game runs are one each, on a release with other local patches, not on this revision alone. The frame-rate effect of the serial preludes above was not measured separately.Checklist
main.docs/asset-policy.md.Checked for overlap
gpudetile.rs, one line in a test helper (a different change); the two merge without conflict. No other open pull request changesgpudetile.rsorhlsl.rs; searched open and closed issues and pull requests for gpudetile, D3DCompile, dxcompiler and d3dcompiler.Tested #133 on Windows at commit
e83730e:cargo build --release --locked -p darnersucceeds (5m32s). darner-gpu:hlsl::tests 4 passed;gpudetile::tests::the_card_detiles_as_the_cpu_doespassed on WARP.On Windows the system compiler takes the detile shader first, so a normal run does not exercise the changed fallback. With a local, uncommitted patch forcing the DXC path (system compiler skipped,
DARNER_DXCpointing at the Windows SDK's dxcompiler.dll), the same detile test passes: the card detile is byte-identical to the CPU detile compiled through DXC.darner translate <dump>: exit 0 on the PR and on main (57dea7f); summary lines identical (26,599 containers, 26,180/26,180 programs, 2,762/2,763 compute DXIL, same pre-existing CS_TraceShadowRays warning).Not tested: game launch, Linux/Proton.
Drafted with AI assistance (OpenCode).