diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-08-01 01:11:24 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-08-01 01:14:20 +0200 |
commit | d31676935e0842680e37a4e5005f0ee8d66021fd (patch) | |
tree | 8f5673b5b5136b6ff6fa6062cbe9da90edefd876 /src/video_core/renderer_vulkan | |
parent | vulkan_device: Return true if either depth/stencil format supports blit (diff) | |
download | yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.tar yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.tar.gz yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.tar.bz2 yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.tar.lz yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.tar.xz yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.tar.zst yuzu-d31676935e0842680e37a4e5005f0ee8d66021fd.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bf6ad6c79..ed048f7b8 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1043,15 +1043,27 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst dst_region, src_region, filter, operation); return; } + ASSERT(src.format == dst.format); if (aspect_mask == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { - if (!device.IsBlitDepthStencilSupported()) { + const auto format = src.format; + const auto can_blit_depth_stencil = [this, format] { + switch (format) { + case VideoCore::Surface::PixelFormat::D24_UNORM_S8_UINT: + case VideoCore::Surface::PixelFormat::S8_UINT_D24_UNORM: + return device.IsBlitDepth24Stencil8Supported(); + case VideoCore::Surface::PixelFormat::D32_FLOAT_S8_UINT: + return device.IsBlitDepth32Stencil8Supported(); + default: + UNREACHABLE(); + } + }(); + if (!can_blit_depth_stencil) { UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa); blit_image_helper.BlitDepthStencil(dst_framebuffer, src.DepthView(), src.StencilView(), dst_region, src_region, filter, operation); return; } } - ASSERT(src.format == dst.format); ASSERT(!(is_dst_msaa && !is_src_msaa)); ASSERT(operation == Fermi2D::Operation::SrcCopy); |