From e2ec3a84489cb796fa843fc94b6e40a9d3288431 Mon Sep 17 00:00:00 2001 From: CowDeV <252005651+CowBoYdu76@users.noreply.github.com> Date: Sun, 22 Nov 2026 15:08:32 +0100 Subject: 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 --- runtime/test/bindless_sizing_test.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'runtime/test/bindless_sizing_test.cpp') 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() { EXPECT(totals(f).all <= 30000 && count(f, D::dim_2d) > 4096); } + // D3D-219: past maxPerSetDescriptors, growth follows layout_supported (vkGetDescriptorSetLayoutSupport), which + // is asked only above that limit. Intel's Xe-LP reports 6159 and supports the full sizes. + { + Device d = uniform(1048576, 1048576); + d.v11.maxPerSetDescriptors = 6159; + d.limits.maxSamplerAllocationCount = 4000; + unsigned asked = 0, asked_within = 0; + const auto all_supported = [&](const BindlessFeatures& candidate) { + ++asked; + asked_within += totals(candidate).all <= 6159; + return true; + }; + BindlessFeatures f = with_ms(true); + EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, all_supported)); + EXPECT(asked > 0 && asked_within == 0); + EXPECT(count(f, D::dim_2d) == bindless::max_2d_images && + f.counts[bindless::sampler_binding] == 4000 - bindless::reserved_samplers); + EXPECT(storage(f, D::dim_2d) == bindless::max_storage_indices && storage_consistent(f)); + + // A driver that supports less: growth stops where it says no. + const auto up_to_20000 = [&](const BindlessFeatures& candidate) { return totals(candidate).all <= 20000; }; + f = with_ms(true); + EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, up_to_20000)); + EXPECT(totals(f).all <= 20000 && totals(f).all > 6159 && count(f, D::dim_2d) > 4096); + + // Without the callback, maxPerSetDescriptors still caps growth as before. + f = with_ms(true); + EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12)); + EXPECT(totals(f).all <= 6159 || (count(f, D::dim_2d) == 4096 && f.counts[bindless::sampler_binding] == 1024)); + } + // The default features are today's counts, which the device-less users (vk_image_fuzz) still get. EXPECT(BindlessFeatures{}.counts == defaults); std::printf("bindless sizing: synthetic limits gave the expected counts\n"); -- cgit v1.2.3