summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRodrigo Locatti <reinuseslisp@airmail.cc>2020-02-21 19:56:09 +0100
committerGitHub <noreply@github.com>2020-02-21 19:56:09 +0100
commit4a6a1aeab489960d73a4e0f2f62865f06944a3a2 (patch)
treef6d2bac565533c6b9d0db675d6706ed7d0b18c7f /src
parentMerge pull request #3434 from namkazt/patch-2 (diff)
parentfixups mistake auto commit. (diff)
downloadyuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.tar
yuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.tar.gz
yuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.tar.bz2
yuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.tar.lz
yuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.tar.xz
yuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.tar.zst
yuzu-4a6a1aeab489960d73a4e0f2f62865f06944a3a2.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_sampler_cache.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_sampler_cache.cpp b/src/video_core/renderer_vulkan/vk_sampler_cache.cpp
index 0a8ec8398..204b7c39c 100644
--- a/src/video_core/renderer_vulkan/vk_sampler_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_sampler_cache.cpp
@@ -23,7 +23,14 @@ static std::optional<vk::BorderColor> TryConvertBorderColor(std::array<float, 4>
} else if (color == std::array<float, 4>{1, 1, 1, 1}) {
return vk::BorderColor::eFloatOpaqueWhite;
} else {
- return {};
+ if (color[0] + color[1] + color[2] > 1.35f) {
+ // If color elements are brighter than roughly 0.5 average, use white border
+ return vk::BorderColor::eFloatOpaqueWhite;
+ }
+ if (color[3] > 0.5f) {
+ return vk::BorderColor::eFloatOpaqueBlack;
+ }
+ return vk::BorderColor::eFloatTransparentBlack;
}
}
@@ -37,8 +44,6 @@ UniqueSampler VKSamplerCache::CreateSampler(const Tegra::Texture::TSCEntry& tsc)
const auto border_color{tsc.GetBorderColor()};
const auto vk_border_color{TryConvertBorderColor(border_color)};
- UNIMPLEMENTED_IF_MSG(!vk_border_color, "Unimplemented border color {} {} {} {}",
- border_color[0], border_color[1], border_color[2], border_color[3]);
constexpr bool unnormalized_coords{false};