bindless: size every sampled dimension alike and name a full array as its own refusal (RT-BINDLESS-DIMENSION-LIMITS) #2406
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2406
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2406/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@aslan2142 on GitHub · 2026-11-26 21:34 UTC · original
aslan2142:bindless-dimension-limits→main· +629 −44 · 8 files · 1 commits · merged 2026-11-26 21:41 UTCThe bindless set gave 1D and 3D images 4,096 indices whatever the device holds. World runs fill the 1D array a few minutes in, and from then on every new 1D T# reads zeros. This sizes every sampled dimension alike and reports a full array under its own reason.
Claimed in the coordination issue as: RT-BINDLESS-DIMENSION-LIMITS
What was wrong
size_bindingsgrew 2D images to 65,536 but 2D arrays only to 16,384 and 3D and 1D to 4,096 (max_*_imagesinruntime/src/vulkan_bindless.h).forget_image, then the deferredbindless_slotrelease, thenremove_image).What changes
max_images, 65,536).hash_bindless_layouthashes the counts).gta6rt --precompile-pipelines/ the pipelines stage) has to be rebuilt once.BindlessSet::image_refusalsays whyadd_imagereturned 0: no array, array full, or storage range full.bind_title_imagenow counts:1D, not just3) and how many of the textures holding indices are still registered at their address.docs/d3d12_vulkan.mdsection 5 has the new sizes and reasons.Tests
bindless_sizing_test(CPU): RADV's and llvmpipe's limits give every sampled dimension 65,536; onmain1D and 3D stop at 4,096. A short budget is shared alike by the three dimensions.vk_bindless_dimensions_test(new, GPU, GLSL shader):mainit fails at "1D: 4096 indices in the set".cteston llvmpipe: 114 of 114 passed (3 skipped).main2d43417d4.vk_bindless_dimensions(passes).vk_bindless_ps_texandvk_bindless_ps_imgatomic: their index-space case assumed the first 1D index is 1, true only while the 1D array was as short as its storage arrays. The case now checks every index once, and that indices above the storage arrays go first. All fourvk_bindless*tests pass.main(presentation under xvfb, host DXGI and similar).tests/test_ci_registration.py,tests/test_ctest_registration.py,tests/test_docs_*.py,tests/test_text_write_line_endings.pyandscripts/check_no_game_data.pyon the changed files pass.World run
RX 7900 XTX, RADV (Mesa 26.3.1), Wine, from a local build of
mainfac8b4bb9with this change and two others (RT-VSHARP-SLOT-RECORDS and #2230):bindless set: 65536 2D images, 4096 samplers, 65536 2D-array, 65536 3D, 65536 1D, 4096 storage indices in 2D.a bindless image array is fullline, and "no view for the T#'s format or range" stays at a handful per window.mainhere (three of nine earlier runs), so it is not shown to come from this change, but the run stopped before the point (about 340 s) where the 1D array used to fill. So the run shows no regression and the new sizes, not yet the picture after the old fill point.Not tested
bindless_sizing_test).AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)
World runs fill one bindless image array a few minutes in: `a bindless image array is full; dimension 3: 4096 indices, 4092 T#s of 4090 textures`. Dimension 3 is 1D (ImageDimension: 2D, 2D array, 3D, 1D). From then on every new 1D T# reads the fallback's zeros, and the console heaps count it as "no view for the T#'s format or range", which went from 2-28 a window to over 4000. Nothing leaks: the 4096 indices are the fallback, 4092 entries of image_entries and 3 replaced views, every one held by a texture the runtime still has registered, and a texture's indices go back when it goes (forget_image, the deferred bindless_slot release, remove_image). The cause is the size: size_bindings grew 2D images to 65536 but 3D and 1D only to 4096 and 2D arrays to 16384, constants that guessed how many textures of each dimension a title keeps, whatever the device holds (RADV allows 8388606 sampled images, llvmpipe 1015808). - vulkan_bindless.h: one maximum (max_images, 65536) for the sampled array of every single-sample dimension, in place of max_2d_images, max_2d_array_images, max_3d_images and max_1d_images. The 2D-array, 3D and 1D arrays grow together after 2D and the storage arrays, so on a device whose limits stop growth earlier none of them is favoured. The bound is memory (each generation's pool holds every element): 325729 descriptors on an RTX 5070, 10-20 MiB at 32-64 bytes a descriptor. The shaders declare runtime arrays, so no shader changes; the set layout changes, so compute pipelines get new journal names (hash_bindless_layout) and the pipeline cache is rebuilt. - BindlessSet::image_refusal says why add_image returned 0: no array for the dimension, the array is full, or only its shorter storage range is. - d3d12_vulkan_device.cpp: bind_image_locked and bind_image_views_locked report that reason; bind_title_image counts it ("the bindless array of the T#'s dimension is full", or "the bindless storage arrays of the T#'s dimension are full") instead of "no view for the T#'s format or range". The once-per-dimension line names the dimension, the storage range and how many of the textures holding indices are still registered at their address. - docs/d3d12_vulkan.md: the sizes, and the new reason. Tests: bindless_sizing_test checks RADV's and llvmpipe's limits (every sampled dimension at 65536; on main 1D and 3D stop at 4096) and that the three dimensions share a short budget alike. vk_bindless_dimensions_test (new, GLSL shader) sizes a set from the device, gives 5000 live 1D, 2D-array and 3D images an index each and reads every one through its index, then fills the rest of the array: the next is refused as full, and removed indices come back at once or, after an erased key, at the next flush. On main it fails at "1D: 4096 indices in the set". vk_bindless_test's index-space case filled 1D expecting the first index to be 1, which held only while the 1D array was as short as its storage arrays; it now checks every index once and that indices above the storage arrays go first. Co-Authored-By: Claude Opus 5.5 <[email protected]>@aslan2142 on GitHub · 2026-11-26 21:41 UTC · original
Merging. This is a self-merge.
main2d43417d4+ this PR (7d5d82077), Mesa 26.3.1:vk_bindless_dimensions_test(5,000 live 1D, 2D-array and 3D images, each read through its index) passes on llvmpipe, the integrated RDNA2 GPU and the RX 7900 XTX with the validation layer, and fails onmainwith "1D: 4096 indices".ctest: 114/114. Windows suite under Wine: the new test is the only change againstmain.mainhas as well; it ended before the old fill point.AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)
@ecox982745 on GitHub · 2026-11-26 21:49 UTC · original
I verified the merged change on a physical RTX 4090 (Windows 11, NVIDIA 616.64, Vulkan validation enabled) at
55e2bd9e9e.vk_bindless_dimensionstest read the expected texel from 5,000 live images in each of 1D, 2D array, and 3D. Each dimension reported 65,536 slots, refused an additional allocation when full, and reused released slots.storage_full. A sampled-only allocation immediately succeeded at index 4,096 in each dimension. The 50 refused handles read the expected fallback, and the probe reported zero mismatches and zero validation errors.This also checks the storage-exhaustion diagnostic on NVIDIA while sampled slots are still available.
@Tauwni on GitHub · 2026-11-27 13:18 UTC · original