shader: keep pixel kills in whole-quad mode (DARNER_KILL_QUADS) #510
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!510
Loading…
Reference in a new issue
No description provided.
Delete branch "hingeowl/Darner:pr/kill-quads"
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?
What it changes
s_cbranch_scc0jumps to null export drop helper lanes befores_wqm, corrupting quad derivatives along triangle edges (e.g. windshield/glass wireframe edge artifacts).Lesloo/longroad(84f08fb891219e697d2ffef9f75f4fb818e2a733, renamedLONGROAD_KILL_QUADS->DARNER_KILL_QUADS):ir::without_kill_outsto strip per-lane early-outs_cbranch_scc0to null export when the fallthrough beginss_wqmfrom the same live mask, keeping helper lanes alive for quad derivatives.emit::pixel_forminemit::translate_plainandapps/darner/src/translate.rs, allows guarded non-final pixel colour exports underkill_quads(), and keysdarner-gpu'sshader_cacheonDARNER_KILL_QUADS.DARNER_KILL_QUADS(on unless=0).How it was tested
c67b322(based onmainc8258f9)cargo xtask policy— passcargo clippy --workspace --all-targets --locked -- -D warnings— passcargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passcargo test -p darner-gpu --locked -- shader_cache— passcargo test -p darner-shader --locked -- a_kill_goes_on_in_whole_quad_mode— pass (unit test added inir.rs)DARNER_KILL_QUADS=0; note this addsDARNER_KILL_QUADStoshader_cache::KEYED).cam-city60(RTX 4090 + Ryzen 9 7950X3D, Series X, HW RT) as part of our integration branch.cargo xtask policy, both workspaceclippygates,shader_cache+a_kill_goes_on_in_whole_quad_modeunit tests.Checklist
main.docs/asset-policy.md.Checked for overlap
DARNER_KILL_CONTINUE, separate opt-in glass stipple fix)A full-archive translation (
darner.exe translate --list Game\shaders.rpf, 32-lane host) refuses 13 pixel programs with this PR applied that v2026.12.04.01 emits.Machine: RTX 5090, driver 621.47, i9-14900K, 64 GB RAM (2 × 32 GB DDR4-3200), Windows 11 26300.9974.
shaders.rpfv2026.12.04.01(stock)shadowmask:CS_TraceShadowRays_FullAdaptive#dbdbf36298727135, "a lane mask holding lanes elsewhere read as data" (pre-existing)mainc8258f9+ this PR (c67b322)The 13 are all pixel programs:
PS_FPWeaponRedDot_*—#78c36346b0aabc8dat0x31a4PS_Textured_Eight_*—#325aec3834d8f883at0x3314PS_MirrorReflectionTextured_Eight_*—#c37630c2eae24043at0x31cceach as
shader does not translate; its pipelines' draws are dropped, so those draws are missing —PS_FPWeaponRedDotis the weapon's red dot sight.DARNER_KILL_QUADS=0takes it back to 1 refusal (13 → 0);DARNER_WAVE_FOLDED=0andDARNER_EXACT64=0change nothing, so the form this PR applies is what refuses them.Mechanism, as far as I can read it: the per-lane
s_cbranch_scc0thatir::without_kill_outsremoves is also what leftst.widenon-empty, i.e. what put the lowering on its console-lane route (lower.rs~1596–1624). Without it the program takes the two-half-wave route, where a mask held as a number has no half wave to read it, andlower.rs:4937refuses it.In
translate_plainI tried the form without the early-outs first and the program as it is when that refuses (same shape as the existingFIRST_HALFretry): the 13 translate again withDARNER_KILL_QUADSstill on, and nothing else inshaders.rpfchanges. A run on that build showsshader translated stage="pixel" hash=78c36346b0aabc8d, 0constant lane masklines, and the red dot sight drawing again in the game. Happy to send it as a patch on top ofc67b322if that is the shape you want.Not tested: no other card or host wave size, no other archive. The containers cannot be attached (asset policy) — the counts are reproducible with the command above. Note that
darner translate's stage-by-stage report appliespixel_formand callsemit::emitdirectly, so it will still list these 13 even with the fallback; a run's log is the check.[pr-fix][shaders] shader: keep pixel kills in whole-quad mode (DARNER_KILL_QUADS)to shader: keep pixel kills in whole-quad mode (DARNER_KILL_QUADS)Test needed — commit
c67b3228; what to check:s_cbranch_scc0jumps to null export drop helper lanes befores_wqm, corrupting quad derivatives along triangle edges (e.g. windshield/glass wireframe edge artifacts).Lesloo/longroad(84f08fb891219e697d2ffef9f75f4fb818e2a733, renamedLONGROAD_KILL_QUADS->DARNER_KILL_QUADS):ir::without_kill_outsto strip per-lane early-outs_cbranch_scc0to null export when the fallthrough beginss_wqmfrom the same live mask, keeping helper lanes alive for quad derivatives.emit::pixel_forminemit::translate_plainandapps/darner/src/translate.rs, allows guarded non-final pixel colour exports underkill_quads(), and keysdarner-gpu'sshader_cacheonDARNER_KILL_QUADS.DARNER_KILL_QUADS(on unless=0).Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.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.