Repository navigation
Conversation
Masks indexed by sampler (an image table element's direct samplers) become a 128-bit SamplerMask; masks indexed by sampler heap element stay 64-bit. The binding allocator no longer holds the sampler count to the 64-element sampler heap; direct samplers stay limited by its two-elements-per-sampler check. The per-sampler specialization constant ranges are 128 IDs wide.
|
Real-AMD coverage — the 128-sampler plan works on GCN5, RDNA2 and RDNA3, but it fails deterministically on lavapipe.
On Vega the test reports the full plan correctly (128 samplers = 124 through the record table + 4 direct as 8 elements; table sampler 64 wraps, direct sampler 127 reads its opaque-black border, clamping S#s read the edge texel). On lavapipe it fails deterministically: It is not a descriptor-limit issue: lavapipe reports AI-assisted: yes |
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the review supports merging, and the author’s reported test results are noted separately from checks run here.
What I ran
Reviewed head 78215920672a678990398ee13c2d660b23ceb90a. No build or tests were run. I inspected the prepared diff and changed code through repo_read.py.
Files read: description.md, commits.md, manifest.json, diff.patch, ShaderDeviceProfile.cpp, the changed section of ShaderMemory.cpp, ManyTableSamplers.cpp, ShaderInfo.hpp, BindingAllocator.cpp, DescriptorBindingBuilder.cpp, ResourceMaterializer.cpp, PipelineSpecialization.hpp, and shader.md. files.json was not available as a review document; list_files confirmed the changed-file inventory. All 11 files marked reviewed in the manifest were inspected; ShaderMemory.cpp was read through the reader because its full text was excluded from the review folder.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed-code review | passed | No concrete defect found |
| Build and tests | not run | Reported results are author-supplied |
| Remaining file contents | not applicable | All reviewed files were inspected |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports successful tests on Windows with an RTX 4090 and on macOS with MoltenVK, including validation-layer runs. Those results were not independently reproduced. Hardware behavior and the changed test execution were not run in this review.
To get this to a good state
Nothing is required.
|
Ran the regression set from the Tested section with the Khronos validation layer on Linux and an NVIDIA GPU (the Tested section has the RTX 4090 on Windows only), plus the negative check with main's recompiler sources and the PR's tests. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
Negative check: with the seven changed files under No new AI-assisted: yes (Claude Code) |
|
This pull request merges cleanly with main b40a0d6 (no text conflict,
A rebase needs the Gather bases moved above the new ranges. One layout that satisfies every With the six Gather bases moved as proposed (a local change, not part of this pull request), a local tree of main b40a0d6 plus #8939 no longer stops at "sampler resource limit exceeded" for PPSA03685 in 2 of 2 runs; it then stops at a later, different point. AI-assisted (Claude Code). |
…ndex-masks Move the 64-wide per-sampler specialization ranges (FoldOffsetBase, MirrorUnnormalizedBase, SamplerLodBiasBase, GatherLodBiasBase) above GatherImageShapeBase so every per-sampler range is 128 wide next to main's Gather ranges, and bump ShaderDiskCache::FormatVersion to 96.
|
Thanks to both of you. The branch now has main merged with the overlap fixed, and the many-table-samplers test skips on lavapipe. Specialization IDs: the static_asserts at DescriptorBindingBuilder.cpp:30-32 were right to fail. I kept main's IDs where I could instead of moving all six Gather bases up. Once MaxSamplers is 128, every per-sampler range has to be 128 wide. On main, FoldOffsetBase (57344), MirrorUnnormalizedBase (57536), SamplerLodBiasBase (57728) and GatherLodBiasBase (57856) are 64 wide and blocked by their neighbours, so those four move to the free block after GatherImageShapeBase: 58560, 58688, 58816 and 58944, ending at 59072, below ImageComponentBase 65536. GatherLodBase stays at 57792 and fills the 128 IDs up to GatherImageMinLodBase 57920. UnnormalizedBaseLevelBase (57408, already 128 wide), MinLodBase, GatherImageMinLodBase, FmaskFormatBase, VolumeGatherBase and GatherImageShapeBase keep main's values. GatherLodBiasBase is the one #12790 base that moves, because no 128-wide range fits at 57856 under GatherImageMinLodBase. The static_assert chain now follows the new ID order, and ShaderDiskCache::FormatVersion goes from main's 95 to 96. The layout you proposed also satisfies every assert; this one moves fewer of the IDs main already uses. lavapipe: thanks for the GCN5/RDNA2/RDNA3 runs. agc_driver_many_table_samplers now calls main's SkipOnLlvmpipe helper with the failure you measured: lane 8 sums 0 through the point-clamp samplers, expected 1039.5. That follows the GlobalAtomicCsub, HostWriteShadowedUnit and CoherentAtomicLoads skips. I have not reproduced it myself or found the cause on lavapipe's side, so the skip records only what fails and does not claim a reason. Pushed as 1ccf597, which merges main c8f72e9. I tested it only on the Mac, an x86_64 Release build using MoltenVK and the validation layer. agc_shader_sampler_limits and agc_shader_device_profile pass. agc_driver_many_table_samplers skips because MoltenVK binds 16 samplers per stage. 88/88 entries pass for lod_clamp, image_limits, gather, unnormalized, lod_bias, mirror, fold and agc_shader_*. The image table entries log the same MoltenVK VUID-vkCreateDescriptorSetLayout-support-09582 counts as a main build. The PR body now has the new IDs and the cache format. AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head 1ccf597e7c47732af75daf661731b9fc1d45e967 against base main; no merged-preview check or test command was run. Read the prepared diff and targeted source context through repo_read.py.
Results
| Check | Result | Note |
|---|---|---|
| Diff and source review | passed | Sampler mask and specialization ranges inspected |
| Tests | not run | Author-reported results are not independently verified |
| Changed-file coverage | not run | One oversized changed test source was excluded |
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded from the review bundle because it was too large; only its changed hunk was read through repo_read.py. No tests or builds were run. Reported platform results and runtime behavior were not independently verified.
Files read: core/libs/prx/libSceAgcDriver/tests/ShaderDeviceProfile.cpp, core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp (changed range only), core/libs/prx/libSceAgcDriver/tests/execution/ManyTableSamplers.cpp, core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ShaderInfo.hpp, core/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hpp, core/shader/recompiler/Optimization/src/BindingAllocator.cpp, core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp, core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp, core/shader/recompiler/PipelineSpecialization.hpp, core/shader/recompiler/ShaderDiskCache.hpp, and relevant CMake test-registration lines. docs/dev/debt/shader.md was not read from the repository. No files listed as excluded by rule in files.json were available to inspect; that list was not present in the review bundle.
To get this to a good state
Nothing is required. Optional: run the focused sampler-limit and many-table-sampler tests on the pinned head.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The sampler limit, mask, and specialization ID changes appear consistent with the inspected code; no blocking defect was verified. The change and targeted source context were reviewed at head 5943745842a649e4a88950141ed8ef6062cb4fba.
What I ran
Read the prepared diff and source through repo_read.py; no tests or builds were run. The author reports platform test results in the PR description; these were not run by this review.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | No concrete defect found |
| Tests and build | not run | Author-reported results only |
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded from the review folder due to size, and its full text was not read. No tests, builds, runtime behavior, or author-reported results were independently verified.
Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, core/libs/prx/libSceAgcDriver/tests/ShaderDeviceProfile.cpp, core/libs/prx/libSceAgcDriver/tests/execution/ManyTableSamplers.cpp, core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ShaderInfo.hpp, core/shader/recompiler/Optimization/src/BindingAllocator.cpp, core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp, core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp, core/shader/recompiler/PipelineSpecialization.hpp, and core/shader/recompiler/ShaderDiskCache.hpp. The remaining changed file docs/dev/debt/shader.md and the excluded ShaderMemory.cpp were not read in full.
To get this to a good state
Nothing is required.
GPU test run: passes on AMD RDNA4 with no
|
| Test | main | head run 1 | head run 2 | head run 3 |
|---|---|---|---|---|
agc_driver_image_gather_lod |
Passed 0.31 s | Passed 0.34 s | Passed 0.27 s | Passed 0.26 s |
agc_driver_image_gather_one_dimensional |
Passed 0.30 s | Passed 0.28 s | Passed 0.24 s | Passed 0.25 s |
agc_driver_image_gather_one_dimensional_array |
Passed 0.34 s | Passed 0.26 s | Passed 0.25 s | Passed 0.25 s |
agc_driver_image_gather_volume |
Passed 0.59 s | Passed 0.54 s | Passed 0.46 s | Passed 0.41 s |
agc_driver_image_packed_horizontal_gather |
Passed 1.28 s | Passed 0.29 s | Passed 0.25 s | Passed 0.24 s |
agc_driver_image_sample_lod_bias_sum |
Passed 0.34 s | Passed 0.28 s | Passed 0.26 s | Passed 0.25 s |
agc_driver_image_sample_lod_clamp |
Passed 0.45 s | Passed 0.34 s | Passed 0.31 s | Passed 0.34 s |
agc_driver_image_sample_lod_clamp_shader_lane |
Passed 0.45 s | Passed 0.35 s | Passed 0.40 s | Passed 0.34 s |
agc_driver_image_sample_shared_sampler |
Passed 0.33 s | Passed 0.28 s | Passed 0.25 s | Passed 0.25 s |
agc_driver_image_sample_unnormalized |
Passed 1.26 s | Passed 0.90 s | Passed 0.84 s | Passed 0.86 s |
agc_driver_image_sample_vcc_sampler |
Passed 0.33 s | Passed 0.27 s | Passed 0.25 s | Passed 0.23 s |
agc_driver_image_sint8_gather_constant_all_bits |
Passed 0.36 s | Passed 0.23 s | Passed 0.29 s | Passed 0.25 s |
agc_driver_image_sint8_gather_constant_one |
Passed 1.37 s | Passed 0.26 s | Passed 0.26 s | Passed 0.26 s |
agc_driver_image_table |
Passed 1.35 s | Passed 0.93 s | Passed 0.82 s | Passed 0.83 s |
agc_driver_image_table_array_views |
Passed 1.60 s | Passed 0.30 s | Passed 0.26 s | Passed 0.26 s |
agc_driver_image_table_cache |
Passed 0.10 s | Passed 0.07 s | Passed 0.04 s | Passed 0.05 s |
agc_driver_image_table_cache_bounds |
Passed 2.51 s | Passed 1.06 s | Passed 0.94 s | Passed 0.96 s |
agc_driver_image_table_packed |
Passed 0.98 s | Passed 1.04 s | Passed 0.66 s | Passed 0.62 s |
agc_driver_image_table_packed_by |
Passed 2.31 s | Passed 0.66 s | Passed 0.72 s | Passed 0.71 s |
agc_driver_image_table_packed_empty |
Passed 0.40 s | Passed 0.32 s | Passed 0.43 s | Passed 0.32 s |
agc_driver_image_table_packed_guards |
Passed 0.51 s | Passed 0.34 s | Passed 0.55 s | Passed 0.33 s |
agc_driver_image_table_packed_isolated |
Passed 1.08 s | Passed 0.40 s | Passed 0.37 s | Passed 0.39 s |
agc_driver_image_table_packed_load_mip |
Passed 2.97 s | Passed 0.67 s | Passed 0.81 s | Passed 0.65 s |
agc_driver_image_table_packed_load_mip_sgn |
Passed 2.80 s | Passed 0.74 s | Passed 0.66 s | Passed 0.66 s |
agc_driver_image_table_packed_load_sgn |
Passed 2.81 s | Passed 0.68 s | Passed 0.72 s | Passed 0.69 s |
agc_driver_image_table_packed_mips |
Passed 1.29 s | Passed 1.16 s | Passed 1.03 s | Passed 0.93 s |
agc_driver_image_table_packed_mixed |
Passed 1.14 s | Passed 0.33 s | Passed 0.41 s | Passed 0.35 s |
agc_driver_image_table_packed_rejected |
Passed 0.53 s | Passed 0.45 s | Passed 0.37 s | Passed 0.41 s |
agc_driver_image_table_packed_stores |
Passed 2.35 s | Passed 0.83 s | Passed 1.01 s | Passed 0.91 s |
agc_driver_image_table_packed_unmeasured |
Passed 0.31 s | Passed 0.23 s | Passed 0.26 s | Passed 0.23 s |
agc_driver_image_table_reuse |
Passed 1.50 s | Passed 0.49 s | Passed 0.41 s | Passed 0.44 s |
agc_driver_image_table_reuse_draw_pipeline |
Passed 0.62 s | Passed 0.44 s | Passed 0.44 s | Passed 0.45 s |
agc_driver_image_table_reuse_plan_verify |
Passed 0.54 s | Passed 0.40 s | Passed 0.45 s | Passed 0.50 s |
agc_driver_image_table_reuse_records |
Passed 0.34 s | Passed 0.30 s | Passed 0.28 s | Passed 0.31 s |
agc_driver_image_table_reuse_records_narrow |
Passed 0.35 s | Passed 0.27 s | Passed 0.29 s | Passed 0.28 s |
agc_driver_image_table_reuse_retaken_cleared_depth_surface |
Passed 0.43 s | Passed 0.38 s | Passed 0.28 s | Passed 0.32 s |
agc_driver_image_table_reuse_retaken_depth_surface |
Passed 0.33 s | Passed 0.38 s | Passed 0.29 s | Passed 0.29 s |
agc_driver_image_table_reuse_retaken_mirrored_depth_surface |
Passed 0.38 s | Passed 0.34 s | Passed 0.31 s | Passed 0.29 s |
agc_driver_image_table_reuse_retired_depth_surface |
Passed 0.36 s | Passed 0.29 s | Passed 0.31 s | Passed 0.29 s |
agc_driver_image_table_variants |
Passed 0.51 s | Passed 0.46 s | Passed 0.41 s | Passed 0.41 s |
agc_driver_image_table_vouch_queued_draws |
Passed 0.34 s | Passed 0.33 s | Passed 0.32 s | Passed 0.33 s |
agc_driver_image_table_vouched_lookups |
Passed 0.70 s | Passed 0.61 s | Passed 0.60 s | Passed 0.60 s |
agc_driver_many_direct_samplers |
Passed 1.48 s | Passed 0.45 s | Passed 0.38 s | Passed 0.37 s |
agc_driver_many_table_samplers |
not on main |
Passed 13.12 s | Passed 0.71 s | Passed 0.66 s |
agc_driver_nested_image_table |
Passed 0.72 s | Passed 0.39 s | Passed 0.45 s | Passed 0.38 s |
agc_driver_nested_image_table_budget |
Passed 0.36 s | Passed 0.35 s | Passed 0.35 s | Passed 0.34 s |
agc_driver_nested_image_table_large |
Passed 0.44 s | Passed 0.27 s | Passed 0.28 s | Passed 0.27 s |
agc_driver_nested_sampler_table |
Passed 0.51 s | Passed 0.36 s | Passed 0.34 s | Passed 0.33 s |
agc_driver_pointer_phi_sampler_table |
Passed 0.61 s | Passed 0.36 s | Passed 0.43 s | Passed 0.33 s |
agc_driver_resident_heap_mirror |
Passed 1.93 s | Passed 0.61 s | Passed 0.66 s | Passed 0.59 s |
agc_driver_resident_heap_mirror_no_publish |
Passed 0.54 s | Passed 0.47 s | Passed 0.48 s | Passed 0.46 s |
agc_driver_sparse_heap_import_mirror |
Passed 1.12 s | Passed 0.29 s | Passed 0.28 s | Passed 0.26 s |
agc_shader_device_profile |
Passed 0.07 s | Passed 0.07 s | Passed 0.02 s | Passed 0.02 s |
agc_driver_many_table_samplersis new, somainhas no run of it. On every head run it printed128 samplers (124 through the record table, 4 direct as 8 sampler elements), with table sampler 64 wrapping and direct sampler 127 reading its opaque black border.- Every test opens a device, and each selected the R9700 (
subgroup=64). agc_shader_sampler_limitsis not included, and with it the PR's new 128-sampler cases inShaderMemory.cpp. It runs fromagc_shader_memory_tests.exe, which on this host is removed right after the link, so the post-linkobjcopyfails withInvalid argument.- The
mainrun and head run 1 were each the first after a rebuild, so their times include a cold start (13.12 s for the new test on run 1, then 0.71 s and 0.66 s). This is not a speed claim.
Validation:
Insert instance layer "VK_LAYER_KHRONOS_validation"appears 52 times in themainlog and 53 times in each head log, once per test.was not found but was requested by env var VK_INSTANCE_LAYERSappears in no log.VUID-lines: 0 onmain, and 0, 0 and 0 on the three head runs. The negative-control and mutation logs also have none.
Other open PRs:
- fix(shader): preserve vector destinations through TYPE 2 and 3 buffer descriptors #22628 conflicts with this one in
DescriptorBindingBuilder.cpp(thestatic_assertchain) andShaderDiskCache.hpp.PipelineSpecialization.hppmerges without a conflict, but it then holdsFoldOffsetBaseand fix(shader): preserve vector destinations through TYPE 2 and 3 buffer descriptors #22628'sBufferKeepsDestinationBaseboth at 58560. fix(shader): preserve vector destinations through TYPE 2 and 3 buffer descriptors #22628 uses 256 IDs from there, which overlapFoldOffsetBaseandMirrorUnnormalizedBase. Whoever resolves thestatic_assertconflict has to move one of them. - fix(shader): sample one-slice volumes through plain, level-zero and explicit-LOD 2D accesses #22583 merges cleanly with this one, but it also sets
FormatVersion = 97. That is the same silent clash oneandonlydean pointed out with fix(shader): address buffers with ADD_TID in graphics stages #24781; whichever lands second needs a new number.
Host:
- GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349
- Validation layer: Khronos 1.4.363 (LunarG SDK)
- CPU and OS: Ryzen 9 9950X3D, Windows 11 Pro 26300
- Build: WinLibs GCC 15.2, Release
- Commits: head
5943745842, merged ontomainefc6f9c3baas9e98bbccc5
AI-assisted: yes
What
A shader can now plan up to 128 samplers (
ShaderInfo::MaxSamplers, was 64). At most 32 of them can be direct (two elements each in the 64-element sampler heap), and the pair limit stays at 256.The cap was not set by a real resource.
BindingAllocatorcheckedinfo.samplers.size()againstRuntimeAbi::SamplerHeapCapacity, but that heap only holds direct samplers. Table samplers go through the sampler table, and the compactShaderDatathe driver uses (IrBindingLayout::ShaderDataDwords) carries image metadata only. The fixedRuntimeAbi::ShaderData.samplers[64]array is used only by layoutstatic_asserts. Two things did depend on 64:ImageTableElement::samplers, filled byResolveImageTables, read byDescriptorBindingBuilder::Populate), which were oneuint64_t;FoldOffsetBaseandMirrorUnnormalizedBasewere 64 IDs wide, so sampler 70's fold offset would have used the ID of sampler 6's base-level switch, and its mirror axes image 6's minimum LOD. (UnnormalizedBaseLevelBasewas already 128 wide andSamplerLodBiasBaseran up toFmaskFormatBase.)Changes:
SamplerMask(ShaderInfo.hpp):(MaxSamplers + 63) / 64words withSet,TestandForEach.ImageTableElement::samplersandResolveImageTables'directSamplersuse it.Populatewalks its set bits into the 64-bit heap-element mask.DescriptorBinding::imageSamplers,tableSamplerMasks, and theRequire*/ForcesDegammaOnchecks inSampler.cpp.Preparekeeps its own 64-element refusal.BindingAllocatorno longer compares the sampler count with the heap capacity. Direct samplers are still refused past 32 by the heap check (shader sampler pairs exceed runtime heap capacity).mainmove into the free block afterGatherImageShapeBase:FoldOffsetBase57344 -> 58560,MirrorUnnormalizedBase57536 -> 58688,SamplerLodBiasBase57728 -> 58816 andGatherLodBiasBase57856 -> 58944 (ends at 59072, belowImageComponentBase65536).GatherLodBasestays at 57792 and now runs up toGatherImageMinLodBase57920.UnnormalizedBaseLevelBase(57408, already 128 wide),MinLodBaseand the per-image Gather, FMASK and volume ranges keep theirmainIDs. Thestatic_assertchain inDescriptorBindingBuilder.cppfollows the new ID order.ShaderDiskCache::FormatVersion96 -> 97 (main's value is 96), because cached SPIR-V carries the old IDs.docs/dev/debt/shader.mdentry now gives the new limits and drops the claim thatShaderDatasets the cap.This follows #10000 (64 samplers, 64-bit masks) one step further. It is a separate topic from the descriptor Phi in #7459.
Why 65 is needed: Ghostrunner (PPSA03685) compute shader 0x200c520000 (104K dwords once #8070/#9068 link its table calls). With #8939 it gets past the #7459 refusal and then plans 65 samplers: 4 direct S# and 61 table sampler columns read from three record buffers. Each column reads its S# at a different offset in the block it selects, so none of them can be merged.
Tested
macOS 27.0 on an Apple M5 Max, x86_64 Release build under Rosetta, MoltenVK (local build) with
VK_LAYER_KHRONOS_validation1.4.363.0. Windows 11 on an RTX 4090 (NVIDIA 621.14), WinLibs GCC 15.2.0, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V.mainis d89f265 plus only the test commit (7821592, cherry-picked as 6c14e4adac on the box); the branch is dcde46c + 7821592 on d89f265.New tests (synthetic RDNA2 programs, no title data):
agc_shader_sampler_limits(ShaderMemory.cpp --sampler-limits) adds:ShaderDiskCache::EncodePlan/DecodePlanwith no change, compiled, and bound with every image table element paired with its direct sampler's heap elements.sampler resource limit exceeded.shader sampler pairs exceed runtime heap capacity.agc_shader_device_profile: 65 direct samplers are now refused by the heap check. 128 samplers with 32 direct fill the 64-element heap, with the same runtime layout as one image.agc_driver_many_table_samplers(new execution test): one compute program with 124 table samplers (S# columns of a record table keyed by a run-time value) and 4 direct samplers, all sampling one image table texel per lane. It checks:It skips on devices that bind fewer than 32 samplers per stage, and on lavapipe, where a reviewer measured lane 8 summing 0 through the point-clamp samplers (expected 1039.5) with no VUID while RADV on GCN5, RDNA2 and RDNA3 passes.
main+ testsagc_shader_sampler_limitssampler resource limit exceededagc_driver_many_table_samplersShaderRecompiler::Recompile: sampler resource limit exceeded^agc_.*(sampler, image_table, table_, descriptor, shader_memory, shader_selected, shader_image_limits, shader_bindless, device_profile, disk_cache, image_limits), once with the layer)was not found, 0VUID-was not found, 0VUID-agc_shader_sampler_limitsagc_driver_many_table_samplersagc_shader_*ctest entries; image table, variants, reuse, cache, packed, array views, compute table calls, image sample reduction, disk cache, device profile)The two new tests use a literal 128 samplers, not
ShaderInfo::MaxSamplers, so themainbuild runs the same programs.agc_shader_device_profilechanges its expectation in the feature commit (65 direct samplers are now refused by the heap check, not the metadata check), so it has nomaincontrol; it passes on both machines with this PR. On the Mac both trees log the sameVUID-vkCreateDescriptorSetLayout-support-09582lines in the image table tests (MoltenVKmaxPerSetDescriptors1212 against the image table layout); the change adds none.After merging
mainc8f72e9 (1ccf597, which includes the layout above andFormatVersion96), Mac x86_64 Release with the layer:agc_shader_sampler_limitsandagc_shader_device_profilepass,agc_driver_many_table_samplersskips (16 samplers per stage), and 88/88 ctest entries matchinglod_clamp,image_limits,gather,unnormalized,lod_bias,mirror,foldoragc_shader_pass. The 14agc_driver_image_tableandagc_driver_image_table_packed*entries exit 0 on both this tree and amainc8f72e9 build and log the sameVUID-vkCreateDescriptorSetLayout-support-09582counts (20 inagc_driver_image_table, 2 in each packed entry, none inunmeasured), so ctest marks 13 of them failed on both. The measurements above this paragraph are from the earlier head.After merging
mainef7dc44 (a023bcf) and movingFormatVersionto 97 becausemainreached 96 on its own (5943745), Mac x86_64 Release with the layer: 121 ctest entries matching the patterns above plussampler,image_table,disk_cacheanddevice_profile, with every test executable rebuilt, give 102 passed, 6 skipped (agc_driver_many_table_samplersandagc_driver_many_direct_samplersamong them) and the same 13 image table entries failed on the ctest VUID regex as before, with the same per-entryVUID-vkCreateDescriptorSetLayout-support-09582counts.agc_shader_disk_cache,agc_shader_sampler_limitsandagc_shader_device_profilepass. Without the layer 120 of 121 pass;agc_driver_image_table_reuse_recordscrashes under plain ctest (3 of 3 runs) after printing its pass line, invkDestroyBufferunderGraphics::DestroyDeferredObjectsduringVulkanDeviceteardown; it passes when run directly (8 of 8), underctest -Vand in the run with the layer. This PR does not touch that teardown, and nomainbuild at this hash was run for comparison. The Windows box was not rerun for this merge.Ghostrunner request replay (
agc_shader_replay --prepare,ANYPS5_NO_SHADER_CACHE=1, Mac x86_64 Release):main973026dGetImageResource dword 0refusal at pc 0x51884 (the #7459 chain)main+ this PRmain+ #8939sampler resource limit exceededmain+ #8939 + this PRprepared: 12420660 SPIR-V words, 50-57 sTitle run on the 4090 (
main973026d + #8939 5eb49d1 + this PR, PlayGo absent, no input). The shader is no longer refused. At its first use it is recompiled in 1.3 s to 10,335,484 SPIR-V words (1,297 captured regions), and the driver logscreating a pipeline for 10335484 SPIR-V words. Presentation stops (the title bar FPS counter stays at 590 frames from t+30 s on), and at 146 s Unreal aborts withGameThread timed out waiting for RenderThread after 120.00 secs. The thread dump shows NVIDIA driver (nvoglv64) compiler threads busy. There is noVK_ERROR_DEVICE_LOST/Vulkan result -4, so the #5951 device loss does not come back in this run. One queue 0x20WAIT_REG_MEM_64timed out after 1 s during the stall.Not claimed: this PR alone does not unblock Ghostrunner. It gets past this shader only together with #8939, and the title then stops on the size of the module: 10-12M SPIR-V words from a 104K-dword shader, about 100-120 words per guest dword. That is the next thing to look at (#13538 reports a 2.5M-word module in Ratchet & Clank: Rift Apart).
Seen while testing, not changed here: on MoltenVK (
maxPerStageDescriptorSamplers16) a shader whose direct sampler elements plus sampler-table elements pass 16 samples wrong without a refusal.maindoes the same: the test built there (60 table + 4 direct samplers, 63 point samples) lands 15 of the 63 samples on MoltenVK and all 63 on the 4090. With 128 samplers on the Mac (8 direct elements + 12 sampler-table elements) lanes 32-63 lose one sample. That is why the execution test skips below 32 samplers per stage.Checklist
main; no other open PR implements the same functions (tools/pr_overlap.py --branch: file overlaps only). fix(shader): gather a 2D image's image_gather4_l at its LOD #12790's Gather ranges are onmainnow; the merge keepsGatherLodBaseand movesGatherLodBiasBase, the only Gather base that cannot stay once it is 128 wide (see above). feat(agc): scale unnormalized samples to the selected mip on multi-level 2D views #16935 (UnnormalizedScaledBase57792) adds a 64-wide per-sampler range at an IDmainalready uses forGatherLodBase, so it has to move whichever way this goes; the free space from 59072 to 65535 holds it at 128 wide. fix(shader): preserve vector destinations through TYPE 2 and 3 buffer descriptors #22628 (58304, in the gap afterVolumeGatherBase's 128 images) and fix(shader): pack D16 image reads toward zero and saturate 32-bit integers as RDNA2 does #22750 (65792) add ranges clear of this layout..mdfiles or images added to the repositoryShaderDiskCache::FormatVersion)