aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache/util.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-11-20 16:51:13 -0800
committerGitHub <noreply@github.com>2021-11-20 16:51:13 -0800
commitea6fa044f3e55de3b542c6c1b7ca581cbf76d77e (patch)
tree3eb75c6d43296f2a4cbb41099b4f4e787918b1a1 /src/video_core/texture_cache/util.cpp
parentc3e1ffc44b6a6c3929e8ac6eb527fe450cfc5268 (diff)
parentda2fe8190518d3266df7f4a48f9b651eaea84d4b (diff)
Merge pull request #7368 from FernandoS27/vulkan-conv
Fix ART Blit detection regression and add D24S8 <-> RGBA8 conv to Vulkan
Diffstat (limited to 'src/video_core/texture_cache/util.cpp')
-rw-r--r--src/video_core/texture_cache/util.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index ddc9fb13a..e4d82631e 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -1151,18 +1151,39 @@ bool IsSubresource(const ImageInfo& candidate, const ImageBase& image, GPUVAddr
void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase* dst,
const ImageBase* src) {
- if (src && GetFormatType(src->info.format) != SurfaceType::ColorTexture) {
- src_info.format = src->info.format;
+ bool is_resolve = false;
+ const auto original_src_format = src_info.format;
+ const auto original_dst_format = dst_info.format;
+ if (src) {
+ if (GetFormatType(src->info.format) != SurfaceType::ColorTexture) {
+ src_info.format = src->info.format;
+ }
+ is_resolve = src->info.num_samples > 1;
+ src_info.num_samples = src->info.num_samples;
+ src_info.size = src->info.size;
}
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) {
+ if (GetFormatType(dst->info.format) == SurfaceType::ColorTexture) {
+ src_info.format = original_src_format;
+ }
+ } else {
+ dst_info.format = src->info.format;
+ }
}
if (dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) {
- src_info.format = dst->info.format;
+ if (src) {
+ if (GetFormatType(src->info.format) == SurfaceType::ColorTexture) {
+ dst_info.format = original_dst_format;
+ }
+ } else {
+ src_info.format = dst->info.format;
+ }
}
+ ASSERT(!is_resolve || dst_info.format == src_info.format);
}
u32 MapSizeBytes(const ImageBase& image) {