diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2021-06-17 03:08:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 03:08:07 +0200 |
commit | c5b517aa5f2039e5bc28b029afd279f196939a8d (patch) | |
tree | ff53dcf7a2cf3aa0344f45a8424f289b599d8ff0 /src/video_core/texture_cache/util.cpp | |
parent | Merge pull request #6464 from ameerj/disable-astc (diff) | |
parent | texture_cache/util: Avoid relaxed image views on different bytes per pixel (diff) | |
download | yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.gz yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.bz2 yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.lz yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.xz yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.tar.zst yuzu-c5b517aa5f2039e5bc28b029afd279f196939a8d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/util.cpp | 10 |
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 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; } |