vulkan: Use closest available equivalent to missing clamp modes. (#1007)

This commit is contained in:
squidbus 2024-09-22 05:07:05 -07:00 committed by GitHub
parent f0ab14acb8
commit 564b4d3267
2 changed files with 10 additions and 0 deletions

View file

@ -199,8 +199,17 @@ vk::SamplerAddressMode ClampMode(AmdGpu::ClampMode mode) {
return vk::SamplerAddressMode::eMirroredRepeat;
case AmdGpu::ClampMode::ClampLastTexel:
return vk::SamplerAddressMode::eClampToEdge;
case AmdGpu::ClampMode::MirrorOnceHalfBorder:
case AmdGpu::ClampMode::MirrorOnceBorder:
LOG_WARNING(Render_Vulkan, "Unimplemented clamp mode {}, using closest equivalent.",
static_cast<u32>(mode));
[[fallthrough]];
case AmdGpu::ClampMode::MirrorOnceLastTexel:
return vk::SamplerAddressMode::eMirrorClampToEdge;
case AmdGpu::ClampMode::ClampHalfBorder:
LOG_WARNING(Render_Vulkan, "Unimplemented clamp mode {}, using closest equivalent.",
static_cast<u32>(mode));
[[fallthrough]];
case AmdGpu::ClampMode::ClampBorder:
return vk::SamplerAddressMode::eClampToBorder;
default:

View file

@ -310,6 +310,7 @@ bool Instance::CreateDevice() {
.separateDepthStencilLayouts = vk12_features.separateDepthStencilLayouts,
.hostQueryReset = vk12_features.hostQueryReset,
.timelineSemaphore = vk12_features.timelineSemaphore,
.samplerMirrorClampToEdge = vk12_features.samplerMirrorClampToEdge,
},
vk::PhysicalDeviceMaintenance4FeaturesKHR{
.maintenance4 = true,