summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/texture_cache.h8
-rw-r--r--src/video_core/texture_cache/util.cpp25
2 files changed, 17 insertions, 16 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 06257f064..4188f93c5 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1096,13 +1096,13 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages(
1096 if (GetFormatType(dst_info.format) != GetFormatType(src_info.format)) { 1096 if (GetFormatType(dst_info.format) != GetFormatType(src_info.format)) {
1097 continue; 1097 continue;
1098 } 1098 }
1099 src_id = FindOrInsertImage(src_info, src_addr); 1099 RelaxedOptions find_options{};
1100 RelaxedOptions dst_options{};
1101 if (src_info.num_samples > 1) { 1100 if (src_info.num_samples > 1) {
1102 // it's a resolve, we must enforce the same format. 1101 // it's a resolve, we must enforce the same format.
1103 dst_options = RelaxedOptions::ForceBrokenViews; 1102 find_options = RelaxedOptions::ForceBrokenViews;
1104 } 1103 }
1105 dst_id = FindOrInsertImage(dst_info, dst_addr, dst_options); 1104 src_id = FindOrInsertImage(src_info, src_addr, find_options);
1105 dst_id = FindOrInsertImage(dst_info, dst_addr, find_options);
1106 } while (has_deleted_images); 1106 } while (has_deleted_images);
1107 return BlitImages{ 1107 return BlitImages{
1108 .dst_id = dst_id, 1108 .dst_id = dst_id,
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index 8f9eb387c..e4d82631e 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
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 bool is_resolve = false;
1155 const auto original_src_format = src_info.format;
1156 const auto original_dst_format = dst_info.format;
1154 if (src) { 1157 if (src) {
1155 src_info.format = src->info.format; 1158 if (GetFormatType(src->info.format) != SurfaceType::ColorTexture) {
1159 src_info.format = src->info.format;
1160 }
1161 is_resolve = src->info.num_samples > 1;
1156 src_info.num_samples = src->info.num_samples; 1162 src_info.num_samples = src->info.num_samples;
1157 src_info.size = src->info.size; 1163 src_info.size = src->info.size;
1158 } 1164 }
1159 if (dst) { 1165 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) {
1160 dst_info.format = dst->info.format; 1166 dst_info.format = dst->info.format;
1161 dst_info.num_samples = dst->info.num_samples;
1162 dst_info.size = dst->info.size;
1163 } 1167 }
1164 if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) { 1168 if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) {
1165 if (dst) { 1169 if (dst) {
1166 src_info.format = dst_info.format; 1170 if (GetFormatType(dst->info.format) == SurfaceType::ColorTexture) {
1171 src_info.format = original_src_format;
1172 }
1167 } else { 1173 } else {
1168 dst_info.format = src->info.format; 1174 dst_info.format = src->info.format;
1169 } 1175 }
@@ -1171,18 +1177,13 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase*
1171 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { 1177 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) {
1172 if (src) { 1178 if (src) {
1173 if (GetFormatType(src->info.format) == SurfaceType::ColorTexture) { 1179 if (GetFormatType(src->info.format) == SurfaceType::ColorTexture) {
1174 dst_info.format = src->info.format; 1180 dst_info.format = original_dst_format;
1175 } 1181 }
1176 } else { 1182 } else {
1177 src_info.format = dst->info.format; 1183 src_info.format = dst->info.format;
1178 } 1184 }
1179 } 1185 }
1180 if (src_info.num_samples > 1) { 1186 ASSERT(!is_resolve || dst_info.format == src_info.format);
1181 dst_info.format = src_info.format;
1182 }
1183 if (dst_info.num_samples > 1) {
1184 src_info.format = dst_info.format;
1185 }
1186} 1187}
1187 1188
1188u32 MapSizeBytes(const ImageBase& image) { 1189u32 MapSizeBytes(const ImageBase& image) {