diff --git a/src/xenia/gpu/d3d12/d3d12_texture_cache.cc b/src/xenia/gpu/d3d12/d3d12_texture_cache.cc index 1cd7635c9..b06e46fc7 100644 --- a/src/xenia/gpu/d3d12/d3d12_texture_cache.cc +++ b/src/xenia/gpu/d3d12/d3d12_texture_cache.cc @@ -1050,17 +1050,32 @@ void D3D12TextureCache::WriteSampler(SamplerParameters parameters, // LOD biasing is performed in shaders. desc.MipLODBias = 0.0f; desc.ComparisonFunc = D3D12_COMPARISON_FUNC_NEVER; - // TODO(Triang3l): Border colors k_ACBYCR_BLACK and k_ACBCRY_BLACK. - if (parameters.border_color == xenos::BorderColor::k_AGBR_White) { - desc.BorderColor[0] = 1.0f; - desc.BorderColor[1] = 1.0f; - desc.BorderColor[2] = 1.0f; - desc.BorderColor[3] = 1.0f; - } else { - desc.BorderColor[0] = 0.0f; - desc.BorderColor[1] = 0.0f; - desc.BorderColor[2] = 0.0f; - desc.BorderColor[3] = 0.0f; + switch (parameters.border_color) { + case xenos::BorderColor::k_ABGR_White: + desc.BorderColor[0] = 1.0f; + desc.BorderColor[1] = 1.0f; + desc.BorderColor[2] = 1.0f; + desc.BorderColor[3] = 1.0f; + break; + case xenos::BorderColor::k_ACBYCR_Black: + desc.BorderColor[0] = 0.5f; + desc.BorderColor[1] = 0.0f; + desc.BorderColor[2] = 0.5f; + desc.BorderColor[3] = 0.0f; + break; + case xenos::BorderColor::k_ACBCRY_Black: + desc.BorderColor[0] = 0.0f; + desc.BorderColor[1] = 0.5f; + desc.BorderColor[2] = 0.5f; + desc.BorderColor[3] = 0.0f; + break; + default: + assert_true(parameters.border_color == xenos::BorderColor::k_ABGR_Black); + desc.BorderColor[0] = 0.0f; + desc.BorderColor[1] = 0.0f; + desc.BorderColor[2] = 0.0f; + desc.BorderColor[3] = 0.0f; + break; } desc.MinLOD = float(parameters.mip_min_level); if (parameters.mip_base_map) { diff --git a/src/xenia/gpu/xenos.h b/src/xenia/gpu/xenos.h index acbff6642..4ce4794f5 100644 --- a/src/xenia/gpu/xenos.h +++ b/src/xenia/gpu/xenos.h @@ -130,10 +130,17 @@ enum class AnisoFilter : uint32_t { }; enum class BorderColor : uint32_t { - k_AGBR_Black = 0, - k_AGBR_White = 1, - k_ACBYCR_BLACK = 2, - k_ACBCRY_BLACK = 3, + // (0.0, 0.0, 0.0) + // TODO(Triang3l): Is the alpha 0 or 1? + k_ABGR_Black = 0, + // (1.0, 1.0, 1.0, 1.0) + k_ABGR_White = 1, + // Unknown precisely, but likely (0.5, 0.0, 0.5) for unsigned (Cr, Y, Cb) + // TODO(Triang3l): Real hardware border color, and is the alpha 0 or 1? + k_ACBYCR_Black = 2, + // Unknown precisely, but likely (0.0, 0.5, 0.5) for unsigned (Y, Cr, Cb) + // TODO(Triang3l): Real hardware border color, and is the alpha 0 or 1? + k_ACBCRY_Black = 3, }; // For the tfetch instruction (not the fetch constant) and related instructions,