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:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 17:22:43 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 17:22:43 +0100
commit3d1dbf1cef8b9240cce69b2bcdba0c09ea0f1d5e (patch)
tree5d84c2e541aa31bcf23d9921dde7e9cb92b2ac59 /runtime/test/bindless_sizing_test.cpp
parent2560485f76c45779ec93a2a6dc001c93211f7b3f (diff)
parent4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff)
Merge main into test/coverage-gaps (#1299)
Conflicts: runtime/test/shaders/check.py, scripts/run_gpu_tests.py AI-assisted.
Diffstat (limited to 'runtime/test/bindless_sizing_test.cpp')
-rw-r--r--runtime/test/bindless_sizing_test.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/runtime/test/bindless_sizing_test.cpp b/runtime/test/bindless_sizing_test.cpp
index 469274d56..07715f01e 100644
--- a/runtime/test/bindless_sizing_test.cpp
+++ b/runtime/test/bindless_sizing_test.cpp
@@ -172,6 +172,37 @@ int main() {
172 EXPECT(totals(f).all <= 30000 && count(f, D::dim_2d) > 4096); 172 EXPECT(totals(f).all <= 30000 && count(f, D::dim_2d) > 4096);
173 } 173 }
174 174
175 // D3D-219: past maxPerSetDescriptors, growth follows layout_supported (vkGetDescriptorSetLayoutSupport), which
176 // is asked only above that limit. Intel's Xe-LP reports 6159 and supports the full sizes.
177 {
178 Device d = uniform(1048576, 1048576);
179 d.v11.maxPerSetDescriptors = 6159;
180 d.limits.maxSamplerAllocationCount = 4000;
181 unsigned asked = 0, asked_within = 0;
182 const auto all_supported = [&](const BindlessFeatures& candidate) {
183 ++asked;
184 asked_within += totals(candidate).all <= 6159;
185 return true;
186 };
187 BindlessFeatures f = with_ms(true);
188 EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, all_supported));
189 EXPECT(asked > 0 && asked_within == 0);
190 EXPECT(count(f, D::dim_2d) == bindless::max_2d_images &&
191 f.counts[bindless::sampler_binding] == 4000 - bindless::reserved_samplers);
192 EXPECT(storage(f, D::dim_2d) == bindless::max_storage_indices && storage_consistent(f));
193
194 // A driver that supports less: growth stops where it says no.
195 const auto up_to_20000 = [&](const BindlessFeatures& candidate) { return totals(candidate).all <= 20000; };
196 f = with_ms(true);
197 EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, up_to_20000));
198 EXPECT(totals(f).all <= 20000 && totals(f).all > 6159 && count(f, D::dim_2d) > 4096);
199
200 // Without the callback, maxPerSetDescriptors still caps growth as before.
201 f = with_ms(true);
202 EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12));
203 EXPECT(totals(f).all <= 6159 || (count(f, D::dim_2d) == 4096 && f.counts[bindless::sampler_binding] == 1024));
204 }
205
175 // The default features are today's counts, which the device-less users (vk_image_fuzz) still get. 206 // The default features are today's counts, which the device-less users (vk_image_fuzz) still get.
176 EXPECT(BindlessFeatures{}.counts == defaults); 207 EXPECT(BindlessFeatures{}.counts == defaults);
177 std::printf("bindless sizing: synthetic limits gave the expected counts\n"); 208 std::printf("bindless sizing: synthetic limits gave the expected counts\n");