diff options
author | Ameer <aj662@drexel.edu> | 2020-07-04 06:59:40 +0200 |
---|---|---|
committer | Ameer <aj662@drexel.edu> | 2020-07-04 06:59:40 +0200 |
commit | f829932ed191ad469df01342191bf2725e8a20bb (patch) | |
tree | 0ae185ce3ef43ef9b085aae7b9ad5abb04e3d239 /src/video_core/compatible_formats.h | |
parent | Fix for always firing triggers on some controllers, trigger threshold more universal (diff) | |
parent | Merge pull request #4218 from ogniK5377/opus-external (diff) | |
download | yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.gz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.bz2 yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.lz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.xz yuzu-f829932ed191ad469df01342191bf2725e8a20bb.tar.zst yuzu-f829932ed191ad469df01342191bf2725e8a20bb.zip |
Diffstat (limited to 'src/video_core/compatible_formats.h')
-rw-r--r-- | src/video_core/compatible_formats.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/compatible_formats.h b/src/video_core/compatible_formats.h new file mode 100644 index 000000000..d1082566d --- /dev/null +++ b/src/video_core/compatible_formats.h @@ -0,0 +1,32 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <array> +#include <bitset> +#include <cstddef> + +#include "video_core/surface.h" + +namespace VideoCore::Surface { + +class FormatCompatibility { +public: + using Table = std::array<std::bitset<MaxPixelFormat>, MaxPixelFormat>; + + explicit FormatCompatibility(); + + bool TestView(PixelFormat format_a, PixelFormat format_b) const noexcept { + return view[static_cast<size_t>(format_a)][static_cast<size_t>(format_b)]; + } + + bool TestCopy(PixelFormat format_a, PixelFormat format_b) const noexcept { + return copy[static_cast<size_t>(format_a)][static_cast<size_t>(format_b)]; + } + +private: + Table view; + Table copy; +}; + +} // namespace VideoCore::Surface |