Repository navigation
fix(shader): drop s_barrier in vertex programs that share nothing between waves - #2937
Conversation
…ween waves An NGG passthrough program on the vertex path whose s_barrier only orders wave 0's GS_ALLOC_REQ produced a workgroup OpControlBarrier, which the Vertex execution model does not allow; SPIR-V validation rejected the module at the program's first draw. In a Vertex-stage program the barrier now emits nothing when the program has no LDS or GDS access and no memory write or atomic, so no wave can observe another. With any of those it throws.
|
Tested on an RTX 5080 with Astro Bot PPSA21564 and SPIR-V validation on: Setup: Arch Linux 7.2.9, GCC 16.2.1, Release, The title (Astro Bot PPSA21564 v01.007.000, RTX 5080,
Both runs with the PR then stop on The test (
Both failures are the same Not established: whether the picture is right; I did not look at it. The rest of the test suite was not run with this PR. |
What
Fixes #2871.
EmitBarrieremitsOpControlBarrierwith Workgroup scope for every stage. The Vertex execution model has no workgroup, so an NGG passthrough program that runs on the vertex path and containss_barrierproduces an invalid module. WithANYPS5_ENABLE_SPIRV_TOOLS=ON(the Linux CI build) a title stops at its first draw:Builds without SPIRV-Tools hand the same module to the driver unvalidated.
In the program from #2871 the barrier only orders wave 0's
GS_ALLOC_REQbefore the other waves export, and the vertex path already dropsGS_ALLOC_REQ. A barrier changes a program's results only through memory one wave writes and another reads.s_barriernow emits nothing when the program has no LDS or GDS access and no memory write or atomic.s_barrierand any of those throwss_barrier in a vertex program that accesses LDS or GDS or writes memory is not implemented.Routing such programs to the mesh path (#1825, #2261) is a separate question; this only stops the vertex path from emitting an invalid module.
Tested
Linux (CachyOS, GCC 16.2, RTX 4090, NVIDIA 610.57), Release, on
main9c5d67f:agc_vertex_barrier: a vertex program withs_barrierand a position export compiles withoutOpControlBarrier. Onmainthe module contains one. A vertex program withs_barrierandds_write_b32throws the line above.ctest(701 tests) passes, exceptagc_driver_dcc_keys_first_write, which fails onmaintoo.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code