diff options
author | Nguyen Dac Nam <nam.kazt.91@gmail.com> | 2020-02-18 10:52:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 10:52:54 +0100 |
commit | ba84f0988fcec59bb3a68a0e7dc952538972aa28 (patch) | |
tree | f7dd4da0b8f762aa1a829cf28b6c097ef76a5b6a /src/video_core | |
parent | Merge pull request #3412 from Morph1984/aspect-ratio (diff) | |
download | yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.tar yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.tar.gz yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.tar.bz2 yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.tar.lz yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.tar.xz yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.tar.zst yuzu-ba84f0988fcec59bb3a68a0e7dc952538972aa28.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_sampler_cache.cpp | 13 |
1 files changed, 10 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..839cfc1c3 100644 --- a/src/video_core/renderer_vulkan/vk_sampler_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_sampler_cache.cpp @@ -23,7 +23,16 @@ 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; + } else { + if (color[3] > 0.5f) { + return vk::BorderColor::eFloatOpaqueBlack; + } else { + return vk::BorderColor::eFloatTransparentBlack; + } + } } } @@ -37,8 +46,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}; |