Repository navigation
fix(shader): deduplicate sampler table elements in ResolveImageTables - #7882
Conversation
|
This pull request is labeled |
|
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.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Deduplicate sampler descriptor records across image tables during table resolution so identical sampler descriptors share element table indices rather than exceeding the hardware sampler element budget.
17dc42c to
021175c
Compare
|
First GPU run of this PR that I can see: AMD on Linux (RADV). Merged onto AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite (
GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes |
|
First AMD-on-Linux (RADV) run of this PR. Merged onto AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite ( Comparing the JUnit output with This checks correctness only; I did not measure performance. GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes |
|
Checked the sampler dedup in |
What
During
ResolveImageTables, unique image descriptors are already deduplicated intoout.elementsviaelementIndex. However, sampler table entries previously allocated 4 sampler elements for every entry encountered without checking if an identical sampler descriptor had already been allocated inout.samplers. When tables contain duplicate sampler descriptors across slots or tables, this unnecessarily exhausts theAbi::SamplerElementBudget(1024 elements / 256 unique samplers) and poisons valid entries withPoisonReason::Budget.Index and deduplicate sampler table elements in
samplerRecord()usingsamplerIndex. If an identical sampler descriptor was already recorded inout.samplers, reuse its element index instead of allocating new elements. Add tests inShaderMemory.cppverifying deduplication across tables, reuse when the budget is full, and poisoning when unique samplers exceed the budget, along with verifying existing behaviour thatTableOutsideCodestill poisons withPoisonReason::Budgetwhen the budget is full.Tested
ctest -R ^agc_shader_memory$(agc_shader_memory_teststarget): passed locally on Windows (x86_64 mingw-w64). CI build jobs (Windows, Linux, relinker) were skipped; only the conventions, labels and eligibility jobs ran in CI.mainwithout the fix, the new test fails with assertion:"sampler table deduplication: duplicate sampler entries across tables were not deduplicated".PoisonReason::Budget) and covering existing behaviour thatTableOutsideCodepoisons withPoisonReason::Budgetwhen the budget is full.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)