From 09fd7abde01e7951aa32855606591d09df181b86 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 9 Mar 2018 15:24:28 +0100 Subject: [PATCH] [d3d11] Fix potentially invalid value for anisotropic filtering --- src/d3d11/d3d11_sampler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d3d11/d3d11_sampler.cpp b/src/d3d11/d3d11_sampler.cpp index 3809e0a1..804286df 100644 --- a/src/d3d11/d3d11_sampler.cpp +++ b/src/d3d11/d3d11_sampler.cpp @@ -33,6 +33,10 @@ namespace dxvk { info.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; info.usePixelCoord = VK_FALSE; // Not supported in D3D11 + // Make sure to use a valid anisotropy value + if (desc.MaxAnisotropy < 1) info.maxAnisotropy = 1.0f; + if (desc.MaxAnisotropy > 16) info.maxAnisotropy = 16.0f; + // Try to find a matching border color if clamp to border is enabled if (info.addressModeU == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER || info.addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER