diff options
author | Lioncash <mathew1800@gmail.com> | 2018-04-21 01:50:02 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-04-21 01:50:05 +0200 |
commit | 7db0b8d74fbcf6bb21518698d21d617445b3436b (patch) | |
tree | 3975fea754673e86e79e8d87128106949b4534ab /src | |
parent | Merge pull request #340 from mailwl/vi-update (diff) | |
download | yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.tar yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.tar.gz yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.tar.bz2 yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.tar.lz yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.tar.xz yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.tar.zst yuzu-7db0b8d74fbcf6bb21518698d21d617445b3436b.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 6c1c6775a..fff1e1a5a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -672,7 +672,8 @@ void CachedSurface::DownloadGLTexture(const MathUtil::Rectangle<u32>& rect, GLui glPixelStorei(GL_PACK_ROW_LENGTH, 0); } -enum MatchFlags { +enum class MatchFlags { + None = 0, Invalid = 1, // Flag that can be applied to other match types, invalid matches require // validation before they can be used Exact = 1 << 1, // Surfaces perfectly match @@ -686,6 +687,10 @@ constexpr MatchFlags operator|(MatchFlags lhs, MatchFlags rhs) { return static_cast<MatchFlags>(static_cast<int>(lhs) | static_cast<int>(rhs)); } +constexpr MatchFlags operator&(MatchFlags lhs, MatchFlags rhs) { + return static_cast<MatchFlags>(static_cast<int>(lhs) & static_cast<int>(rhs)); +} + /// Get the best surface match (and its match type) for the given flags template <MatchFlags find_flags> Surface FindMatch(const SurfaceCache& surface_cache, const SurfaceParams& params, @@ -703,15 +708,15 @@ Surface FindMatch(const SurfaceCache& surface_cache, const SurfaceParams& params : (params.res_scale <= surface->res_scale); // validity will be checked in GetCopyableInterval bool is_valid = - find_flags & MatchFlags::Copy + (find_flags & MatchFlags::Copy) != MatchFlags::None ? true : surface->IsRegionValid(validate_interval.value_or(params.GetInterval())); - if (!(find_flags & MatchFlags::Invalid) && !is_valid) + if ((find_flags & MatchFlags::Invalid) == MatchFlags::None && !is_valid) continue; auto IsMatch_Helper = [&](auto check_type, auto match_fn) { - if (!(find_flags & check_type)) + if ((find_flags & check_type) == MatchFlags::None) return; bool matched; |