2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

TextureCache: force same image format when resolving an image.

This commit is contained in:
Fernando Sahmkow 2021-11-19 05:46:57 +01:00
parent b130f648d7
commit 0ff228405f
2 changed files with 9 additions and 2 deletions

View file

@ -759,7 +759,8 @@ ImageId TextureCache<P>::FindImage(const ImageInfo& info, GPUVAddr gpu_addr,
return ImageId{}; return ImageId{};
} }
} }
const bool broken_views = runtime.HasBrokenTextureViewFormats(); const bool broken_views =
runtime.HasBrokenTextureViewFormats() || True(options & RelaxedOptions::ForceBrokenViews);
const bool native_bgr = runtime.HasNativeBgr(); const bool native_bgr = runtime.HasNativeBgr();
ImageId image_id; ImageId image_id;
const auto lambda = [&](ImageId existing_image_id, ImageBase& existing_image) { const auto lambda = [&](ImageId existing_image_id, ImageBase& existing_image) {
@ -1096,7 +1097,12 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages(
continue; continue;
} }
src_id = FindOrInsertImage(src_info, src_addr); src_id = FindOrInsertImage(src_info, src_addr);
dst_id = FindOrInsertImage(dst_info, dst_addr); RelaxedOptions dst_options{};
if (src_info.num_samples > 1) {
// it's a resolve, we must enforce the same format.
dst_options = RelaxedOptions::ForceBrokenViews;
}
dst_id = FindOrInsertImage(dst_info, dst_addr, dst_options);
} while (has_deleted_images); } while (has_deleted_images);
return BlitImages{ return BlitImages{
.dst_id = dst_id, .dst_id = dst_id,

View file

@ -54,6 +54,7 @@ enum class RelaxedOptions : u32 {
Size = 1 << 0, Size = 1 << 0,
Format = 1 << 1, Format = 1 << 1,
Samples = 1 << 2, Samples = 1 << 2,
ForceBrokenViews = 1 << 3,
}; };
DECLARE_ENUM_FLAG_OPERATORS(RelaxedOptions) DECLARE_ENUM_FLAG_OPERATORS(RelaxedOptions)