Repository navigation
fix(agc): stop pixel invocations on BDA faults when supported - #5804
Conversation
|
Tested on the AMD RDNA 2 iGPU where Setup: Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics, Ryzen iGPU gfx1036, driver 32.0.21036.18 (a driver branch not in #2009's list yet). NVIDIA GeForce RTX 5070, driver 617.42.
The PR's own tests also don't build or pass on current
All four fixes are on simonbronk:fix/5804-device-enable (485c18d), on top of this PR's head 5d9c037. abnergtz's commit keeps its authorship there. The technical debt commit With all four on
AI-assisted (Claude Code). |
5d9c037 to
5b5cdc6
Compare
|
Rerun after the rebase, as asked (
Written with Claude Code assistance (validation by a subagent, reviewed in this session). |
Pixel invocations stopped by a BDA fault now end with OpTerminateInvocation when the target offers SPV_KHR_terminate_invocation, and keep OpKill otherwise. OpKill is not enough on AMD driver branch 21045, where a guest atomic after the kill still lands once per faulting pixel. Based on the approach in poonasor/AnyPS5@73969879. Refs boykopovar#2009
…tion Shader validation accepts the extension only in fragment shaders and only when the device enabled shaderTerminateInvocation. The flag is part of the validation memo key. Refs boykopovar#2009
The validator only checked SPV_KHR_terminate_invocation when it saw the OpExtension, so a module using OpTerminateInvocation without declaring the extension, or in a non-fragment stage, was accepted. Require the fragment stage, the enabled shaderTerminateInvocation feature and the declared extension at the instruction itself. Refs boykopovar#2009
…s and disabled feature
The device queries and enables shaderTerminateInvocation when available, advertises SPV_KHR_terminate_invocation to the recompiler and validation, and the shader device profile rejects a target that advertises the extension without the enabled feature. Based on the approach in poonasor/AnyPS5@73969879. Refs boykopovar#2009 (cherry picked from commit 1866a3f)
Restore the shaderDrawParameters feature guard while adding shaderTerminateInvocation support. Cover enabled and disabled DrawParameters profiles, and pass the termination feature to the correct shader validation argument.
d6cff40 to
b85146d
Compare
adriadam10
left a comment
There was a problem hiding this comment.
Re-checked on current main (rebased, build + agc_driver*/agc_shader* ctest). The recompiler change and the device enablement look right, and tezzgod74's and Lerrylore's Windows runs cover the AMD behaviour.
agc_driver_graphics still fails on this head (tezzgod74's and screamm's runs: "needs shaderClipDistance"), caused by the PR's own new test code. I pushed two commits to your branch:
test(agc): give the vertex terminate test the ClipDistance capability: the vertex recompile inGraphics.cpp(vertexWords) was missingCapabilityClipDistance.test(agc): keep the recompiled words alive in the terminate tests:terminatedandvertexWordsheld a span into the temporaryRecompileResult; they now usespirv.Copy().
agc_driver_graphics, agc_driver_pixel_interlock and agc_shader_device_profile pass after that. Merging once CI is green.
What
Carry the pixel-shader BDA fault fix for #2009: stop shader invocations with
OpTerminateInvocationwhen the Vulkan feature is enabled, and retain the existing fallback when it is unavailable. Validate both the extension and opcode against the enabled feature and fragment stage. The carried feature-enable commit preserves abnergtz’s original authorship; subsequent rebase fixes are authored by MarcZX100.Tested
The carried branch reports
agc_driver_pixel_interlockpassing on AMD RDNA 2 devices using driver 32.0.21045, wheremainreproduces an atomic write after the fallback. Added regression coverage for both stop paths, interlock exit ordering, non-pixel stages, SPIR-V specialization, enabled/disabled feature validation, andshaderDrawParametersprofile validation.On this Linux host, no configured build tree for this branch was available. The prior review reported
agc_driver_graphicsfailures on Windows: on the PR head, an earlier unchangedDepthStencilTestsexpectation fails; on main plus the PR, the test shader requiresshaderClipDistance. Those failures remain unresolved and need follow-up.git diff --checkandtools/check_conventions.py --base upstream/mainpass after rebasing on currentmain.Checklist
main; no other open PR implements the same functions