From 5fd361757ba38a330be6ba2bd634e26e4232eabc Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 4 May 2020 20:16:56 +0200 Subject: [PATCH] [d3d9] Disable old border color hack if custom border colors are supported --- src/d3d9/d3d9_device.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 4f1b71fd..97084075 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5365,13 +5365,16 @@ namespace dxvk { for (uint32_t i = 0; i < 4; i++) colorInfo.borderColor.float32[i] = cKey.BorderColor[i]; - // HACK: Let's get OPAQUE_WHITE border color over - // TRANSPARENT_BLACK if the border RGB is white. - if (colorInfo.borderColor.float32[0] == 1.0f - && colorInfo.borderColor.float32[1] == 1.0f - && colorInfo.borderColor.float32[2] == 1.0f) { - // Then set the alpha to 1. - colorInfo.borderColor.float32[3] = 1.0f; + if (!m_dxvkDevice->features().extCustomBorderColor.customBorderColorWithoutFormat) { + // HACK: Let's get OPAQUE_WHITE border color over + // TRANSPARENT_BLACK if the border RGB is white. + if (colorInfo.borderColor.float32[0] == 1.0f + && colorInfo.borderColor.float32[1] == 1.0f + && colorInfo.borderColor.float32[2] == 1.0f + && !m_dxvkDevice->features().extCustomBorderColor.customBorderColors) { + // Then set the alpha to 1. + colorInfo.borderColor.float32[3] = 1.0f; + } } DxvkSamplerCreateInfo depthInfo = colorInfo;