diff options
| author | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 15:51:40 +0100 |
|---|---|---|
| committer | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 15:51:40 +0100 |
| commit | df91c6624b69ee4e6c6eeca20ed68d331ed0e728 (patch) | |
| tree | 323c88b9df89bf8abaa2b98d10808474ab675dc2 /runtime/test/bindless_sizing_test.cpp | |
| parent | b40d8039a98f57b26bd05860febbabbe59b97873 (diff) | |
| parent | 6a6704df1592e1dc4a3215ddf1423a78adb52045 (diff) | |
Merge main into test/valu-int-misc (#1492)
Conflicted files: 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.cpp | 31 |
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"); |