diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-26 21:36:53 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-27 11:22:16 +0100 |
commit | ecefc932e64bf4ab8442d3c9808a2e54429e7001 (patch) | |
tree | 5c89e97f5893905cfc490ef3a7d67ae066be23ae /src/video_core/texture_cache/util.cpp | |
parent | Texture Cache: Further fix regressions. (diff) | |
download | yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.tar yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.tar.gz yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.tar.bz2 yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.tar.lz yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.tar.xz yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.tar.zst yuzu-ecefc932e64bf4ab8442d3c9808a2e54429e7001.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/util.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 9b1613008..7bd31b211 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -1151,19 +1151,25 @@ bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* dst, const ImageBase* src) { - bool is_resolve = false; - if (src) { - is_resolve = src->info.num_samples > 1; - src_info.num_samples = src->info.num_samples; - src_info.size.width = src->info.size.width; - src_info.size.height = src->info.size.height; - } - if (dst) { - dst_info.num_samples = dst->info.num_samples; - dst_info.size.width = dst->info.size.width; - dst_info.size.height = dst->info.size.height; - } - ASSERT(!is_resolve || dst_info.format == src_info.format); + const auto original_dst_format = dst_info.format; + if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) { + src_info.format = src->info.format; + } + if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { + dst_info.format = dst->info.format; + } + if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) { + dst_info.format = src->info.format; + } + if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { + if (src) { + if (GetFormatType(src->info.format) == SurfaceType::ColorTexture) { + dst_info.format = original_dst_format; + } + } else { + src_info.format = dst->info.format; + } + } } u32 MapSizeBytes(const ImageBase& image) { |