summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-11-19 03:17:54 +0100
committerGravatar Fernando Sahmkow2021-11-19 03:17:54 +0100
commitb130f648d7c629411c487722f864c6bafcd2562c (patch)
tree5feb8b55b918553a0c50782438098174e528fbdc
parentVulkan: implement D24S8 <-> RGBA8 convertions. (diff)
downloadyuzu-b130f648d7c629411c487722f864c6bafcd2562c.tar.gz
yuzu-b130f648d7c629411c487722f864c6bafcd2562c.tar.xz
yuzu-b130f648d7c629411c487722f864c6bafcd2562c.zip
TextureCache: Fix regression caused by ART and improve blit detection algorithm to be smarter.
Diffstat (limited to '')
-rw-r--r--src/video_core/texture_cache/texture_cache.h9
-rw-r--r--src/video_core/texture_cache/util.cpp28
2 files changed, 27 insertions, 10 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 241f71a91..5ade3ce55 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -475,6 +475,7 @@ void TextureCache<P>::BlitImage(const Tegra::Engines::Fermi2D::Surface& dst,
475 const BlitImages images = GetBlitImages(dst, src); 475 const BlitImages images = GetBlitImages(dst, src);
476 const ImageId dst_id = images.dst_id; 476 const ImageId dst_id = images.dst_id;
477 const ImageId src_id = images.src_id; 477 const ImageId src_id = images.src_id;
478
478 PrepareImage(src_id, false, false); 479 PrepareImage(src_id, false, false);
479 PrepareImage(dst_id, true, false); 480 PrepareImage(dst_id, true, false);
480 481
@@ -1094,12 +1095,8 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages(
1094 if (GetFormatType(dst_info.format) != GetFormatType(src_info.format)) { 1095 if (GetFormatType(dst_info.format) != GetFormatType(src_info.format)) {
1095 continue; 1096 continue;
1096 } 1097 }
1097 if (!dst_id) { 1098 src_id = FindOrInsertImage(src_info, src_addr);
1098 dst_id = InsertImage(dst_info, dst_addr, RelaxedOptions{}); 1099 dst_id = FindOrInsertImage(dst_info, dst_addr);
1099 }
1100 if (!src_id) {
1101 src_id = InsertImage(src_info, src_addr, RelaxedOptions{});
1102 }
1103 } while (has_deleted_images); 1100 } while (has_deleted_images);
1104 return BlitImages{ 1101 return BlitImages{
1105 .dst_id = dst_id, 1102 .dst_id = dst_id,
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index ddc9fb13a..8f9eb387c 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -1151,17 +1151,37 @@ bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr
1151 1151
1152void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* dst, 1152void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* dst,
1153 const ImageBase* src) { 1153 const ImageBase* src) {
1154 if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) { 1154 if (src) {
1155 src_info.format = src->info.format; 1155 src_info.format = src->info.format;
1156 src_info.num_samples = src->info.num_samples;
1157 src_info.size = src->info.size;
1156 } 1158 }
1157 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { 1159 if (dst) {
1158 dst_info.format = dst->info.format; 1160 dst_info.format = dst->info.format;
1161 dst_info.num_samples = dst->info.num_samples;
1162 dst_info.size = dst->info.size;
1159 } 1163 }
1160 if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) { 1164 if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) {
1161 dst_info.format = src->info.format; 1165 if (dst) {
1166 src_info.format = dst_info.format;
1167 } else {
1168 dst_info.format = src->info.format;
1169 }
1162 } 1170 }
1163 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { 1171 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) {
1164 src_info.format = dst->info.format; 1172 if (src) {
1173 if (GetFormatType(src->info.format) == SurfaceType::ColorTexture) {
1174 dst_info.format = src->info.format;
1175 }
1176 } else {
1177 src_info.format = dst->info.format;
1178 }
1179 }
1180 if (src_info.num_samples > 1) {
1181 dst_info.format = src_info.format;
1182 }
1183 if (dst_info.num_samples > 1) {
1184 src_info.format = dst_info.format;
1165 } 1185 }
1166} 1186}
1167 1187