summaryrefslogtreecommitdiffstats
path: root/src/video_core/compatible_formats.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-01-06 08:39:51 +0100
committerGitHub <noreply@github.com>2021-01-06 08:39:51 +0100
commite8d40559d50b952335f4899392944a9dca418b62 (patch)
tree94cbbc1e616e12ecc6b9c167f630649b829368fe /src/video_core/compatible_formats.cpp
parentMerge pull request #5250 from lat9nq/appimage (diff)
parentgl_texture_cache: Avoid format views on Intel and AMD (diff)
downloadyuzu-e8d40559d50b952335f4899392944a9dca418b62.tar
yuzu-e8d40559d50b952335f4899392944a9dca418b62.tar.gz
yuzu-e8d40559d50b952335f4899392944a9dca418b62.tar.bz2
yuzu-e8d40559d50b952335f4899392944a9dca418b62.tar.lz
yuzu-e8d40559d50b952335f4899392944a9dca418b62.tar.xz
yuzu-e8d40559d50b952335f4899392944a9dca418b62.tar.zst
yuzu-e8d40559d50b952335f4899392944a9dca418b62.zip
Diffstat (limited to 'src/video_core/compatible_formats.cpp')
-rw-r--r--src/video_core/compatible_formats.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/compatible_formats.cpp b/src/video_core/compatible_formats.cpp
index 1619d8664..acf2668dc 100644
--- a/src/video_core/compatible_formats.cpp
+++ b/src/video_core/compatible_formats.cpp
@@ -10,9 +10,7 @@
#include "video_core/surface.h"
namespace VideoCore::Surface {
-
namespace {
-
using Table = std::array<std::array<u64, 2>, MaxPixelFormat>;
// Compatibility table taken from Table 3.X.2 in:
@@ -233,10 +231,13 @@ constexpr Table MakeCopyTable() {
EnableRange(copy, COPY_CLASS_64_BITS);
return copy;
}
-
} // Anonymous namespace
-bool IsViewCompatible(PixelFormat format_a, PixelFormat format_b) {
+bool IsViewCompatible(PixelFormat format_a, PixelFormat format_b, bool broken_views) {
+ if (broken_views) {
+ // If format views are broken, only accept formats that are identical.
+ return format_a == format_b;
+ }
static constexpr Table TABLE = MakeViewTable();
return IsSupported(TABLE, format_a, format_b);
}