diff options
| author | CowDeV <252005651+CowBoYdu76@users.noreply.github.com> | 2026-11-22 15:08:32 +0100 |
|---|---|---|
| committer | CowDeV <252005651+CowBoYdu76@users.noreply.github.com> | 2026-11-22 15:08:32 +0100 |
| commit | e2ec3a84489cb796fa843fc94b6e40a9d3288431 (patch) | |
| tree | 37e4497e7a6b427cadc49e9f7f5447ceddb1bb5b /runtime/test/bindless_sizing_test.cpp | |
| parent | 89b047cd8fab50675a43d76722a6a8a881f55dc2 (diff) | |
Runtime: exact minimum-LOD views and full bindless set on Intel Xe-LP (D3D-219)
d3d12_descriptor failed every run on an Intel UHD 770 (101.7092) for two
reasons, both from the driver taking an option the Vulkan spec allows:
- VK_EXT_image_view_min_lod: the driver selects levels with
minLodInteger = floor(minLod), the spec's "alternative", so a 0.75 or
1.75 ResourceMinLODClamp read one mip too detailed. On Intel integrated
GPUs bind_image now passes the clamp rounded to the nearest level,
which point mip filtering selects exactly.
LEONIDA_MIN_LOD_INTEGER=1/0 forces it either way.
- The bindless set stayed at its default counts (4096 2D images, 1024
samplers) because the driver reports maxPerSetDescriptors = 6159 with
every other limit at 1048576. size_bindings now takes an optional
layout_supported callback, and past maxPerSetDescriptors the device
asks vkGetDescriptorSetLayoutSupport about the grown layout.
bindless::SetLayout describes set 0 once for create_layout and that
query.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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"); |