Repository navigation
Runtime: honor minimum LOD on sampled 2D array views - #1015
Conversation
A Texture2DArray SRV encodes the clamp in its image descriptor. Forward it to Vulkan so sampling keeps the requested mip and array layer.
|
Tested a69977e on Windows 11 with two GPUs on one machine (MSVC 14.51, full shader toolchain):
Correction to my first version of this comment: that |
|
On replacement head |
|
@kapitche, thanks for the exact colors. I traced Could you run |
|
Tested
Code read: the change is right. Widening the clamp condition to
AI-assisted (Claude Code). |
|
There is a spec detail that changes how to interpret the Intel readback. Vulkan’s image-level selection explicitly allows either the floating-point image-view minimum (preferred) or its integer variant (alternative). The integer variant is floor(minLod). With explicit LOD 0 and nearest mip filtering, a 0.75 minimum therefore permits mip 0 on the integer path, while the floating-point path gives mip 1. Likewise an array view starting at mip 1 with minimum 1.75 can give mip 1 or mip 2. Exposing the extension alone does not distinguish these implementations. Vulkan image-level selection · Definition of the image-view minimum The D3D12 compatibility question is still real. If available with the Intel A/B, a native D3D12 |
|
Tested a69977e on an RTX 5070 Ti Laptop (617.42) and an Intel Arrow Lake Xe-LPG iGPU (Windows 32.0.101.8132). Windows 11 26200, MSVC 19.44, Vulkan SDK 1.4.363,
So on Intel the new 2D-array path behaves exactly like No game files. AI-assisted (Claude Code). |
An integer image-view minimum is permitted by Vulkan and was observed on Intel. Check an effective integer minimum separately and report both view groups before returning a mismatch.
|
Thanks for testing both revisions and running the two view groups independently. Commit With the new fixture against unchanged @BACONMANXDGOD or @kapitche, an unmodified run of this head on Intel would establish whether the 2.0 case advances on both layers. The previous Xe-LPG run already establishes 64/64 mismatches at 1.75. The documentation now records that limitation. |
quackottu
left a comment
There was a problem hiding this comment.
Tested 326e849 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass
ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 47- every test program in the build passes.
d3d12_vulkan_device_testandd3d12_fence_timing_testeach report 3 validation errors (VUID-vkCreateDevice-ppEnabledExtensionNames-01387), butmain43d4703 shows the same: the standalone instance dropsVK_KHR_surface, which #1027 fixes. Not from this PR. d3d12_clear_testdiffers from WARP exactly as onmain(#521).
Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.
|
Tested
No game files. AI-assisted. |
|
@Vonsek, here is the unmodified run you asked for. Current
So Intel takes the spec's integer alternative, Two facts for whether this can be worked around:
Do you want that in the 2D/2D-array path? It's your code, so I'd rather ask first. If yes, I can write it and test it on this Xe-LPG. No game files. AI-assisted (Claude Code). |
Claimed in the coordination issue as sampled Texture2DArray SRV minimum LOD.
Replacement for #974, replayed directly on 43d4703 following the merge-round request.
What and why
A D3D12
Texture2DArraySRV encodedResourceMinLODClampin its T#, but the sampled Vulkan view ignored it. A draw or dispatch requesting LOD zero could see a more detailed mip than the application allowed. Single-sampled colour 2D-array views now use the resource-relative minimum LOD handling that #829 added for 2D. This keeps the array layer range, sampler and component mapping in place and uses the existing fallback when an effective in-range clamp needs an unavailable feature.Fractional minima on Intel. The UHD 770 and Xe-LPG were observed to use the integer-floor alternative permitted by Vulkan for the existing 2D view. For the new Xe-LPG array case, 1.75 gave mip 1 on all 64 texels where native RTX/Radeon/WARP give mip 2. The test retains the fractional assertions and also checks an effective 2.0 minimum. See the Intel A/B and sampling specification.
Tested
Added distinct colours to a three-layer, three-mip RGBA8 array in
d3d12_descriptor_test. The view starts at resource mip 1 and layer 1. Through set 0, one sampler requests LOD 0 from both exposed layers. On Windows 11 build 26200, the RTX 5080 (32.0.16.1692) and AMD Radeon Graphics (32.0.21045.16010) gave these RGBA8 results:43d4703with the new test: both GPUs returned (100,100,64,255) for the first layer at 1.75. The independent native D3D12 reference returned (100,180,64,255).Texture2DArray.SampleLevelreadback gave the same 256/256 on native D3D12 RTX, Radeon and WARP.d3d12_descriptor_testpassed on both Vulkan adapters andctest --no-tests=error -R '^d3d12_vulkan_device$'passed on RTX.The combined descriptor test also checked 256 volume-view samples and 448 floating-point MSAA samples per GPU, plus the integer multisample views and their miss controls.
Checklist
docs/d3d12_vulkan.md. This change uses the existing translator bindings.AI-assisted contribution using OpenAI Codex.