1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 04:29:15 +01:00

[d3d11] Fix potentially invalid value for anisotropic filtering

This commit is contained in:
Philip Rebohle 2018-03-09 15:24:28 +01:00
parent 220c3301cf
commit 09fd7abde0
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -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