upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/bindless_sizing_test.cpp
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-28 22:09:01 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-29 06:34:52 -0500
commit484d98388c422e72c27828a685049f3e4c177bbe (patch)
treef055aad27dffb54c80b8f42b161703f5b0fa8532 /runtime/test/bindless_sizing_test.cpp
parent09c99e53e3762362880176f76d54bc21019e679c (diff)
rendering(r4b-rt): add VK_EXT_shader_image_atomic_int64 R64ui binding 29, buffer UAV R32_UINT format, and T# tail/extent guards
Diffstat (limited to 'runtime/test/bindless_sizing_test.cpp')
-rw-r--r--runtime/test/bindless_sizing_test.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/runtime/test/bindless_sizing_test.cpp b/runtime/test/bindless_sizing_test.cpp
index b83294852..435bf42c9 100644
--- a/runtime/test/bindless_sizing_test.cpp
+++ b/runtime/test/bindless_sizing_test.cpp
@@ -83,6 +83,7 @@ bool storage_consistent(const BindlessFeatures& f) {
83 if (bindless::r32ui_binding(dimension) != bindless::no_binding && 83 if (bindless::r32ui_binding(dimension) != bindless::no_binding &&
84 f.counts[bindless::r32ui_binding(dimension)] != held) 84 f.counts[bindless::r32ui_binding(dimension)] != held)
85 return false; 85 return false;
86 if (dimension == ImageDimension::dim_2d && f.counts[bindless::r64ui_binding] != held) return false;
86 } 87 }
87 // 1D arrays have no sampled capacity, but all three storage classes are always present. 88 // 1D arrays have no sampled capacity, but all three storage classes are always present.
88 const auto array = ImageDimension::dim_1d_array; 89 const auto array = ImageDimension::dim_1d_array;
@@ -304,6 +305,31 @@ int main() {
304 305
305 // The default features are today's counts, which the device-less users (vk_image_fuzz) still get. 306 // The default features are today's counts, which the device-less users (vk_image_fuzz) still get.
306 EXPECT(BindlessFeatures{}.counts == defaults); 307 EXPECT(BindlessFeatures{}.counts == defaults);
308
309 // Binding 29 (2D r64ui storage images) is gated on shader_image_int64_atomics and tracks 2D storage capacity.
310 {
311 static_assert(bindless::binding_count == 30 && bindless::r64ui_binding == 29);
312 static_assert(defaults[bindless::r64ui_binding] == 1024);
313 BindlessFeatures f{};
314 f.update_after_bind = f.partially_bound = true;
315 f.shader_image_int64_atomics = true;
316 EXPECT(bindless::binding_enabled(bindless::r64ui_binding, f));
317 const bindless::SetLayout layout(f);
318 EXPECT(layout.info.bindingCount == 24 && layout.flags_info.bindingCount == 24);
319 const auto& last = layout.entries[layout.info.bindingCount - 1];
320 EXPECT(last.binding == bindless::r64ui_binding &&
321 last.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE &&
322 last.descriptorCount == 1024);
323
324 const Device d = uniform(1048576, 1048576);
325 BindlessFeatures sized = with_ms(true);
326 sized.shader_image_int64_atomics = true;
327 EXPECT(bindless::size_bindings(sized, d.limits, d.v11, d.v12));
328 EXPECT(sized.counts[bindless::r64ui_binding] == bindless::max_storage_indices);
329 EXPECT(totals(sized).all == 325729 + bindless::max_storage_indices);
330 EXPECT(storage_consistent(sized));
331 }
332
307 std::printf("bindless sizing: synthetic limits gave the expected counts\n"); 333 std::printf("bindless sizing: synthetic limits gave the expected counts\n");
308 return 0; 334 return 0;
309} 335}