Repository navigation
Runtime: respect the device limit for sampler LOD bias - #1235
Conversation
Literal GFX10 samplers can encode bias from -32 to +31. A decoded +31 exceeded the Vulkan sampler limit on both tested devices at registration. Bound the native bias while retaining the original S# for shader lookup.
|
Tested cdc9ab3 on Windows 11 with two GPUs on one machine (MSVC 14.51): no regression.
|
|
Tested cdc9ab3 on NVIDIA GeForce RTX 5080, driver 621.24 (
Control, with AI-assisted (Claude Code). |
|
Tested Setup: VS 2022 Build Tools, Windows SDK 10.0.26100, CMake Visual Studio 2022 x64 generator, Environment:
With the PR
Negative controlIn a separate worktree, restored only:
to parent Both bias samples still matched 64/64, but validation reported:
The control reported 1 validation error and exited 1. With the PR, the same validation test exits 0. This confirms the validation error is removed while the expected sampled texels are preserved on this GPU. AI-assisted (ChatGPT/Codex) setup and log review; all tests run locally. Synthetic inputs only, no game files. |
Claimed in the coordination issue as: #1218 (comment)
What and why
A literal GFX10 S# can encode a larger LOD bias than the physical device accepts. Both tested drivers reported VUID-VkSamplerCreateInfo-mipLodBias-01069 for a shader sampler registered with bias +31. Cache maxSamplerLodBias and bound the native Vulkan bias to the signed range at sampler creation. Keep the original S# in the descriptor table so the shader can look up the same four words.
Tested
gfx10_descriptorsandd3d12_descriptor: 2/2 on each adapter. The host-side test checks both signs and a representable fractional bias.Checklist