Shaders: ignore dead interpolation halves in mixed f16 writes #86
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/86"
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?
Imported from Zettrox/ztrx. Originally posted by starnotes-xj on 2026-11-25T09:28:52Z.
A mixed
v_fma_mixlo_f16/v_fma_mixhi_f16write can reuse a deadv_interp_p1ll_f16destination. The emitter currently callsi32_ofon that prior register value and fails the whole program with"the first half of an interpolation", although the placeholder is not a value the mixed write needs to preserve.This change treats only that exact placeholder as zero for the untouched half. Other missing values still fail as before, so unrelated lowering bugs are not hidden.
Reproduction
The game's shader pack contains two pixel programs stopped by this:
PS_DeferredTextured_c5fd36bb_Wrapped(38bf0814e721a1b3)PS_DeferredTextured_9e3a1555_Wrapped(78f3f2fc53a69531)Before, both reported
emit: the first half of an interpolation. With the patch,translate --validate --pipelinesreports both validated and their D3D12 pipelines created on an NVIDIA RTX 4060 Laptop (driver 621.14).Tests
v_fma_mixlo_f16andv_fma_mixhi_f16after a deadv_interp_p1ll_f16.cargo test -p victory-shader --lib -- --test-threads=1: 211 passed, 0 failed, 2 ignored.cargo clippy --workspace --all-targets --locked -- -D warnings: passed.I did not claim a full workspace run: in this environment an unrelated
victory-hletest (title_file_calls_land_in_the_host_folder) fails at its hostfopenassertion before and after this change.Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T12:31:19Z.
Independent Windows retest on an RTX 2060. I compared #80 at
2f46873with the same tree plus this PR's patch at8079d11. The system runtime reported Shader Model 6.5, so both test builds used an isolated Agility SDK setup and reported SM 6.6.0x1cwiththe first half of an interpolation.v_fma_mixlo_f16andv_fma_mixhi_f16in the isolated setup. An earlier candidate run outside that setup reported a Pipeline State Validation mismatch.This confirms the synthetic regression on a second NVIDIA configuration. The two title shader hashes still need an offline run on this machine.
Imported from Zettrox/ztrx. Originally posted by starnotes-xj on 2026-11-25T12:44:29Z.
Both title shaders the comment mentions now have an offline run on a second NVIDIA machine (RTX 4060 Laptop, 8 GB, Windows 11, driver 621.14, system Agility SDK).
Method: found the two containers by their hash in
shaders.rpf(26,503 containers), dumped each one (8,148 and 8,164 bytes), then ranvictory translate --validate --pipelineson each. Control is90b529f(main, without this PR); candidate is8079d11+ the same two files this PR touches.90b529f8079d11#38bf0814e721a1b3PS_DeferredTextured_c5fd36bb0x1464:the first half of an interpolation(0 emitted)#78f3f2fc53a69531PS_DeferredTextured_9e3a15550x1464: same reason (0 emitted)Both are deferred G-buffer material shaders (825 IR instructions each, 22 interpolations), so they are not a corner case: without the patch nothing of either program is emitted.
That agrees with the synthetic regression result: the control refuses at the dead interpolation half, the candidate emits code the D3D12 runtime accepts and a PSO for it is made on a real NVIDIA adapter.
Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T16:08:38Z.
Offline retest on RTX 2060 (driver 531.41), with app-local Agility SDK 1.608.2 and DXIL validator from DXC 1.8.2505.32. I ran
translate --jobs 1 --validate --pipelines --liston the same local 1.0.2.1 shader archive.The two reported containers,
38bf0814e721a1b3and78f3f2fc53a69531, both refused at0x1464onmain(90b529f). On the exact PR revision8079d11, both emitted DXIL, validated and created D3D12 PSOs. The same A/B held when applying #86 on top of #80. This adds independent RTX 2060 evidence to the RTX 4060 Laptop result.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.