summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-15 02:03:14 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-06-15 02:03:57 +0200
commit3d89398b84812aad44356f8c067fc7607655092b (patch)
treefe86f1f090f0c703609176afc2bdb6dac5d9432e /src/video_core/texture_cache
parentMerge pull request #6453 from lat9nq/libusb-fix-msvc (diff)
downloadyuzu-3d89398b84812aad44356f8c067fc7607655092b.tar
yuzu-3d89398b84812aad44356f8c067fc7607655092b.tar.gz
yuzu-3d89398b84812aad44356f8c067fc7607655092b.tar.bz2
yuzu-3d89398b84812aad44356f8c067fc7607655092b.tar.lz
yuzu-3d89398b84812aad44356f8c067fc7607655092b.tar.xz
yuzu-3d89398b84812aad44356f8c067fc7607655092b.tar.zst
yuzu-3d89398b84812aad44356f8c067fc7607655092b.zip
Diffstat (limited to 'src/video_core/texture_cache')
-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 906604a39..f07ce5500 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -1087,7 +1087,15 @@ std::optional<SubresourceBase> FindSubresource(const ImageInfo& candidate, const
return std::nullopt;
}
const ImageInfo& existing = image.info;
- if (False(options & RelaxedOptions::Format)) {
+ if (True(options & RelaxedOptions::Format)) {
+ // Format checking is relaxed, but we still have to check for matching bytes per block.
+ // This avoids creating a view for blits on UE4 titles where formats with different bytes
+ // per block are aliased.
+ if (BytesPerBlock(existing.format) != BytesPerBlock(candidate.format)) {
+ return std::nullopt;
+ }
+ } else {
+ // Format comaptibility is not relaxed, ensure we are creating a view on a compatible format
if (!IsViewCompatible(existing.format, candidate.format, broken_views, native_bgr)) {
return std::nullopt;
}