Repository navigation
fix(agc): accept aliased views of the guest buffers in graphics shaders - #4381
Conversation
|
Rebase handoff — rebased onto current One test-file conflict: main landed the stencil-reference export tests where this PR adds its aliased-buffer-view tests — kept both test families and both calls. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up: Head is |
The SPIR-V emitter declares extra views of the guest buffers binding: buffers_coherent for GLC or DLC accesses (boykopovar#2369) and buffers_u64 for 64-bit atomics. Each is another StorageBuffer variable on the same set and binding, decorated Aliased, which Vulkan allows. ShaderValidation, which checks the stages of every draw, accepted one StorageBuffer variable per binding with u32 elements only, so such a graphics shader was refused with "duplicate SPIR-V resource binding". A second variable is now accepted when the binding is the guest buffers array and every variable on it is Aliased; an aliased view may hold u64 elements. Other duplicates are still refused. agc_driver_graphics validates pixel shaders with a GLC store and a 64-bit atomic, and checks that the same modules without Aliased are refused.
|
Conflicts with main in |
3f3e3bf to
d644c31
Compare
|
@oneandonlydean done. On my side the Windows NVIDIA run is 1019/1020 and the Linux job on WSL lavapipe, merged with |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
What
The SPIR-V emitter declares extra views of the guest buffers binding when a shader needs them:
buffers_coherentfor GLC or DLC accesses (#2369) andbuffers_u64for 64-bit atomics. Each is another StorageBuffer variable on the same set and binding, decoratedAliased, which Vulkan allows when the types fit the descriptor.ShaderValidation, which checks the stages of every draw (compute dispatches are not validated), accepted one StorageBuffer variable per binding with u32 elements only. A vertex, tessellation or pixel shader with a GLC store next to a plain access, or with a 64-bit buffer atomic, was refused at draw time with "duplicate SPIR-V resource binding".Aliased; an aliased view may hold u64 elements.PPSA26344 stopped on this at a pixel program (0x80003a6b00). Its shader cache holds 32 graphics programs that declare
buffersandbuffers_coherenton one binding (26 vertex, 1 hull, 1 domain, 4 pixel), so any draw using one of them was refused.#4250 and #4085 add 8- and 16-bit views of the same binding; they need the same acceptance for u8 views, which can follow once one of them lands.
Tested
Based on
main1c5e628. Windows 11 (MinGW-w64 GCC 15.2.0) and Linux: configure -DBUILD_TESTING=ON, full build, --target libs, ctest.log_macrosalso fails onmainhere.main: 1002/1003;agc_driver_depth_compare_copyalso fails onmainthere.agc_driver_graphicsrecompiles pixel shaders with a GLC store and with a 64-bit atomic, validates them, and checks that the same modules withoutAliasedare refused. It fails on main with "duplicate SPIR-V resource binding".Not tested: console behaviour.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)