diff options
| author | Aslan2142 <jan.trencansky@protonmail.com> | 2026-11-30 11:24:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-30 11:24:25 +0100 |
| commit | 012b79a6787cd47d31dcf023eb2b67a1eac6d77f (patch) | |
| tree | 0a1b3c094dd393645c2dfa30222b3ed7e8c6f99d /runtime/test/bindless_sizing_test.cpp | |
| parent | 454df8e954815e716888785df0b2e65ecfc82cf7 (diff) | |
| parent | 70ea7d6ec070730a6868c1445b2383d2789c0a79 (diff) | |
Merge pull request #2566 from aslan2142/integration/perf-cpu-gpu-r6
[integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6)
Diffstat (limited to 'runtime/test/bindless_sizing_test.cpp')
| -rw-r--r-- | runtime/test/bindless_sizing_test.cpp | 26 |
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 | } |