summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-11-21 05:32:34 +0100
committerGravatar Fernando Sahmkow2021-11-21 05:37:01 +0100
commit779f4ac72d2ea2788c2106c8d2d1ec0e01b77b81 (patch)
tree035e612bd819dd191ce79046c2e5900fccbfbeba /src
parentMerge pull request #7368 from FernandoS27/vulkan-conv (diff)
downloadyuzu-779f4ac72d2ea2788c2106c8d2d1ec0e01b77b81.tar.gz
yuzu-779f4ac72d2ea2788c2106c8d2d1ec0e01b77b81.tar.xz
yuzu-779f4ac72d2ea2788c2106c8d2d1ec0e01b77b81.zip
TextureCache: Eliminate format deduction as full depth conversion has been supported.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/texture_cache.h6
-rw-r--r--src/video_core/texture_cache/util.cpp28
2 files changed, 5 insertions, 29 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 44a0d42ba..0e4907c53 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1079,7 +1079,7 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA
1079template <class P> 1079template <class P>
1080typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages( 1080typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages(
1081 const Tegra::Engines::Fermi2D::Surface& dst, const Tegra::Engines::Fermi2D::Surface& src) { 1081 const Tegra::Engines::Fermi2D::Surface& dst, const Tegra::Engines::Fermi2D::Surface& src) {
1082 static constexpr auto FIND_OPTIONS = RelaxedOptions::Format | RelaxedOptions::Samples; 1082 static constexpr auto FIND_OPTIONS = RelaxedOptions::Samples;
1083 const GPUVAddr dst_addr = dst.Address(); 1083 const GPUVAddr dst_addr = dst.Address();
1084 const GPUVAddr src_addr = src.Address(); 1084 const GPUVAddr src_addr = src.Address();
1085 ImageInfo dst_info(dst); 1085 ImageInfo dst_info(dst);
@@ -1093,9 +1093,7 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages(
1093 const ImageBase* const dst_image = dst_id ? &slot_images[dst_id] : nullptr; 1093 const ImageBase* const dst_image = dst_id ? &slot_images[dst_id] : nullptr;
1094 const ImageBase* const src_image = src_id ? &slot_images[src_id] : nullptr; 1094 const ImageBase* const src_image = src_id ? &slot_images[src_id] : nullptr;
1095 DeduceBlitImages(dst_info, src_info, dst_image, src_image); 1095 DeduceBlitImages(dst_info, src_info, dst_image, src_image);
1096 if (GetFormatType(dst_info.format) != GetFormatType(src_info.format)) { 1096 ASSERT(GetFormatType(dst_info.format) == GetFormatType(src_info.format));
1097 continue;
1098 }
1099 RelaxedOptions find_options{}; 1097 RelaxedOptions find_options{};
1100 if (src_info.num_samples > 1) { 1098 if (src_info.num_samples > 1) {
1101 // it's a resolve, we must enforce the same format. 1099 // it's a resolve, we must enforce the same format.
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index e4d82631e..777503488 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -1152,36 +1152,14 @@ bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr
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; 1154 bool is_resolve = false;
1155 const auto original_src_format = src_info.format;
1156 const auto original_dst_format = dst_info.format;
1157 if (src) { 1155 if (src) {
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 is_resolve = src->info.num_samples > 1;
1162 src_info.num_samples = src->info.num_samples; 1157 src_info.num_samples = src->info.num_samples;
1163 src_info.size = src->info.size; 1158 src_info.size = src->info.size;
1164 } 1159 }
1165 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { 1160 if (dst) {
1166 dst_info.format = dst->info.format; 1161 dst_info.num_samples = dst->info.num_samples;
1167 } 1162 dst_info.size = dst->info.size;
1168 if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) {
1169 if (dst) {
1170 if (GetFormatType(dst->info.format) == SurfaceType::ColorTexture) {
1171 src_info.format = original_src_format;
1172 }
1173 } else {
1174 dst_info.format = src->info.format;
1175 }
1176 }
1177 if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) {
1178 if (src) {
1179 if (GetFormatType(src->info.format) == SurfaceType::ColorTexture) {
1180 dst_info.format = original_dst_format;
1181 }
1182 } else {
1183 src_info.format = dst->info.format;
1184 }
1185 } 1163 }
1186 ASSERT(!is_resolve || dst_info.format == src_info.format); 1164 ASSERT(!is_resolve || dst_info.format == src_info.format);
1187} 1165}