diff options
| author | QemmHD <stephenlethco2@gmail.com> | 2026-11-24 13:38:30 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-24 13:38:30 -0500 |
| commit | 4c8efebcf645e6723696e1fff94d0ec6c7dab929 (patch) | |
| tree | c750dfd6588c23518cc1415ddf30909e9c5194a6 /runtime/src | |
| parent | 3f203947393c3e5b8fc6f19c75cc6f66af9cb9fa (diff) | |
| parent | e9f521cebb840868260b0fe6208da5781355c687 (diff) | |
Merge pull request #535 from tahffo68hk-hash/fix/vk-sampler-unnorm-bias
Merging.
**Why merged:** VK-SAMPLER-UNNORM-BIAS: an unnormalized-coordinates sampler gets mipLodBias 0, which VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074 requires. kawaii-shakal ran it under ASan/UBSan and showed the new check fails on main.
**Why it's good:** gfx10_descriptors and d3d12_descriptor pass both plain and under validation.
Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 32950551e, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be34. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e224: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/gfx10_descriptors.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/src/gfx10_descriptors.h b/runtime/src/gfx10_descriptors.h index b225cddef..a4a9b4448 100644 --- a/runtime/src/gfx10_descriptors.h +++ b/runtime/src/gfx10_descriptors.h | |||
| @@ -631,8 +631,9 @@ inline VkSamplerCreateInfo vulkan_sampler(const Sampler& sampler, float max_lod_ | |||
| 631 | if (sampler.unnormalized) { | 631 | if (sampler.unnormalized) { |
| 632 | info.unnormalizedCoordinates = VK_TRUE; | 632 | info.unnormalizedCoordinates = VK_TRUE; |
| 633 | // VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01075: U and V clamp to the edge or the border (a | 633 | // VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01075: U and V clamp to the edge or the border (a |
| 634 | // repeating mode would wrap at a texel count the sampler cannot know); -01072: one filter for min and mag. | 634 | // repeating mode would wrap at a texel count the sampler cannot know); -01072: one filter for min and mag; |
| 635 | // The S# allows any address mode with FORCE_UNNORMALIZED, and WRAP is its default (word 0 = 0). | 635 | // -01074: mipLodBias must be zero. The S# allows any address mode or LOD bias with FORCE_UNNORMALIZED, and |
| 636 | // WRAP is its default (word 0 = 0). | ||
| 636 | const auto clamp_or_border = [](VkSamplerAddressMode m) { | 637 | const auto clamp_or_border = [](VkSamplerAddressMode m) { |
| 637 | return m == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER ? m : VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; | 638 | return m == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER ? m : VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; |
| 638 | }; | 639 | }; |
| @@ -640,6 +641,7 @@ inline VkSamplerCreateInfo vulkan_sampler(const Sampler& sampler, float max_lod_ | |||
| 640 | info.addressModeV = clamp_or_border(info.addressModeV); | 641 | info.addressModeV = clamp_or_border(info.addressModeV); |
| 641 | info.minFilter = info.magFilter; | 642 | info.minFilter = info.magFilter; |
| 642 | info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; | 643 | info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; |
| 644 | info.mipLodBias = 0.0f; | ||
| 643 | info.minLod = info.maxLod = 0.0f; | 645 | info.minLod = info.maxLod = 0.0f; |
| 644 | info.anisotropyEnable = VK_FALSE; | 646 | info.anisotropyEnable = VK_FALSE; |
| 645 | info.maxAnisotropy = 1.0f; | 647 | info.maxAnisotropy = 1.0f; |