diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-03-03 00:03:07 +0100 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-03-04 03:33:50 +0100 |
commit | a7fb80e6127645dd42fcd41ab57666c68da8a442 (patch) | |
tree | fac8ec3731a66f68abcea8c966e3a146c4ed61d1 /src/video_core/renderer_vulkan/vk_texture_cache.cpp | |
parent | Merge pull request #9832 from liamwhite/hle-mp (diff) | |
download | yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.tar yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.tar.gz yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.tar.bz2 yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.tar.lz yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.tar.xz yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.tar.zst yuzu-a7fb80e6127645dd42fcd41ab57666c68da8a442.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 80adb70eb..69b654994 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -189,13 +189,16 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { if (info.IsRenderTarget()) { return ImageAspectMask(info.format); } - const bool is_first = info.Swizzle()[0] == SwizzleSource::R; + bool any_r = + std::ranges::any_of(info.Swizzle(), [](SwizzleSource s) { return s == SwizzleSource::R; }); switch (info.format) { case PixelFormat::D24_UNORM_S8_UINT: case PixelFormat::D32_FLOAT_S8_UINT: - return is_first ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_STENCIL_BIT; + // R = depth, G = stencil + return any_r ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_STENCIL_BIT; case PixelFormat::S8_UINT_D24_UNORM: - return is_first ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; + // R = stencil, G = depth + return any_r ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; case PixelFormat::D16_UNORM: case PixelFormat::D32_FLOAT: return VK_IMAGE_ASPECT_DEPTH_BIT; @@ -1763,7 +1766,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t .minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.MinLod(), .maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.MaxLod(), .borderColor = - arbitrary_borders ? VK_BORDER_COLOR_INT_CUSTOM_EXT : ConvertBorderColor(color), + arbitrary_borders ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT : ConvertBorderColor(color), .unnormalizedCoordinates = VK_FALSE, }); } |