summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ameer J2021-06-16 21:08:07 -0400
committerGravatar GitHub2021-06-16 21:08:07 -0400
commitc5b517aa5f2039e5bc28b029afd279f196939a8d (patch)
treeff53dcf7a2cf3aa0344f45a8424f289b599d8ff0
parentMerge pull request #6464 from ameerj/disable-astc (diff)
parenttexture_cache/util: Avoid relaxed image views on different bytes per pixel (diff)
downloadyuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.gz
yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.xz
yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.zip
Merge pull request #6469 from ReinUsesLisp/blit-view-compat
texture_cache/util: Avoid relaxed image views on different bytes per block
Diffstat (limited to '')
-rw-r--r--src/video_core/texture_cache/util.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index 0d3e0804f..6835fd747 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -1096,7 +1096,15 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const
1096 return std::nullopt; 1096 return std::nullopt;
1097 } 1097 }
1098 const ImageInfo& existing = image.info; 1098 const ImageInfo& existing = image.info;
1099 if (False(options & RelaxedOptions::Format)) { 1099 if (True(options & RelaxedOptions::Format)) {
1100 // Format checking is relaxed, but we still have to check for matching bytes per block.
1101 // This avoids creating a view for blits on UE4 titles where formats with different bytes
1102 // per block are aliased.
1103 if (BytesPerBlock(existing.format) != BytesPerBlock(candidate.format)) {
1104 return std::nullopt;
1105 }
1106 } else {
1107 // Format comaptibility is not relaxed, ensure we are creating a view on a compatible format
1100 if (!IsViewCompatible(existing.format, candidate.format, broken_views, native_bgr)) { 1108 if (!IsViewCompatible(existing.format, candidate.format, broken_views, native_bgr)) {
1101 return std::nullopt; 1109 return std::nullopt;
1102 } 1110 }