diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-22 00:00:01 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-22 00:00:01 +0100 |
commit | 853284943901560081f6ff992b6c04b7c33f0d21 (patch) | |
tree | 841c26186ab3c572851a612d2fc52407ab797d6f /src/video_core/texture_cache | |
parent | VulkanTexturECache: Use reinterpret on D32_S8 formats. (diff) | |
download | yuzu-853284943901560081f6ff992b6c04b7c33f0d21.tar yuzu-853284943901560081f6ff992b6c04b7c33f0d21.tar.gz yuzu-853284943901560081f6ff992b6c04b7c33f0d21.tar.bz2 yuzu-853284943901560081f6ff992b6c04b7c33f0d21.tar.lz yuzu-853284943901560081f6ff992b6c04b7c33f0d21.tar.xz yuzu-853284943901560081f6ff992b6c04b7c33f0d21.tar.zst yuzu-853284943901560081f6ff992b6c04b7c33f0d21.zip |
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 0e4907c53..9548abec8 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1781,7 +1781,13 @@ void TextureCache<P>::CopyImage(ImageId dst_id, ImageId src_id, std::vector<Imag const SubresourceExtent src_extent{.levels = 1, .layers = 1}; const SubresourceRange dst_range{.base = dst_base, .extent = dst_extent}; const SubresourceRange src_range{.base = src_base, .extent = src_extent}; - const ImageViewInfo dst_view_info(ImageViewType::e2D, dst.info.format, dst_range); + PixelFormat dst_format = dst.info.format; + if (GetFormatType(src.info.format) == SurfaceType::DepthStencil && + GetFormatType(dst_format) == SurfaceType::ColorTexture && + BytesPerBlock(dst_format) == 4) { + dst_format = PixelFormat::A8B8G8R8_UNORM; + } + const ImageViewInfo dst_view_info(ImageViewType::e2D, dst_format, dst_range); const ImageViewInfo src_view_info(ImageViewType::e2D, src.info.format, src_range); const auto [dst_framebuffer_id, dst_view_id] = RenderTargetFromImage(dst_id, dst_view_info); Framebuffer* const dst_framebuffer = &slot_framebuffers[dst_framebuffer_id]; |