diff options
| author | 2021-11-19 05:46:57 +0100 | |
|---|---|---|
| committer | 2021-11-19 05:46:57 +0100 | |
| commit | 0ff228405faae92a39167b9aec072e14744eae35 (patch) | |
| tree | ee6baffc8e2b49ffbc9733fb5434d9082cbf0f66 /src | |
| parent | TextureCache: Fix regression caused by ART and improve blit detection algorit... (diff) | |
| download | yuzu-0ff228405faae92a39167b9aec072e14744eae35.tar.gz yuzu-0ff228405faae92a39167b9aec072e14744eae35.tar.xz yuzu-0ff228405faae92a39167b9aec072e14744eae35.zip | |
TextureCache: force same image format when resolving an image.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 10 | ||||
| -rw-r--r-- | src/video_core/texture_cache/types.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 5ade3ce55..06257f064 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -759,7 +759,8 @@ ImageId TextureCache<P>::FindImage(const ImageInfo& info, GPUVAddr gpu_addr, | |||
| 759 | return ImageId{}; | 759 | return ImageId{}; |
| 760 | } | 760 | } |
| 761 | } | 761 | } |
| 762 | const bool broken_views = runtime.HasBrokenTextureViewFormats(); | 762 | const bool broken_views = |
| 763 | runtime.HasBrokenTextureViewFormats() || True(options & RelaxedOptions::ForceBrokenViews); | ||
| 763 | const bool native_bgr = runtime.HasNativeBgr(); | 764 | const bool native_bgr = runtime.HasNativeBgr(); |
| 764 | ImageId image_id; | 765 | ImageId image_id; |
| 765 | const auto lambda = [&](ImageId existing_image_id, ImageBase& existing_image) { | 766 | const auto lambda = [&](ImageId existing_image_id, ImageBase& existing_image) { |
| @@ -1096,7 +1097,12 @@ typename TextureCache<P>::BlitImages TextureCache<P>::GetBlitImages( | |||
| 1096 | continue; | 1097 | continue; |
| 1097 | } | 1098 | } |
| 1098 | src_id = FindOrInsertImage(src_info, src_addr); | 1099 | src_id = FindOrInsertImage(src_info, src_addr); |
| 1099 | dst_id = FindOrInsertImage(dst_info, dst_addr); | 1100 | RelaxedOptions dst_options{}; |
| 1101 | if (src_info.num_samples > 1) { | ||
| 1102 | // it's a resolve, we must enforce the same format. | ||
| 1103 | dst_options = RelaxedOptions::ForceBrokenViews; | ||
| 1104 | } | ||
| 1105 | dst_id = FindOrInsertImage(dst_info, dst_addr, dst_options); | ||
| 1100 | } while (has_deleted_images); | 1106 | } while (has_deleted_images); |
| 1101 | return BlitImages{ | 1107 | return BlitImages{ |
| 1102 | .dst_id = dst_id, | 1108 | .dst_id = dst_id, |
diff --git a/src/video_core/texture_cache/types.h b/src/video_core/texture_cache/types.h index 5c274abdf..5ac27b3a7 100644 --- a/src/video_core/texture_cache/types.h +++ b/src/video_core/texture_cache/types.h | |||
| @@ -54,6 +54,7 @@ enum class RelaxedOptions : u32 { | |||
| 54 | Size = 1 << 0, | 54 | Size = 1 << 0, |
| 55 | Format = 1 << 1, | 55 | Format = 1 << 1, |
| 56 | Samples = 1 << 2, | 56 | Samples = 1 << 2, |
| 57 | ForceBrokenViews = 1 << 3, | ||
| 57 | }; | 58 | }; |
| 58 | DECLARE_ENUM_FLAG_OPERATORS(RelaxedOptions) | 59 | DECLARE_ENUM_FLAG_OPERATORS(RelaxedOptions) |
| 59 | 60 | ||