diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-05-24 21:34:31 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:33 +0200 |
commit | 228f516bb4426a41a4d1c1756751557f7a0eecda (patch) | |
tree | 36ece73b658929c2878bdc1c7f4592fed8c595da /src/video_core/texture_cache/surface_base.h | |
parent | texture_cache: Correct copying between compressed and uncompressed formats (diff) | |
download | yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.gz yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.bz2 yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.lz yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.xz yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.tar.zst yuzu-228f516bb4426a41a4d1c1756751557f7a0eecda.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/surface_base.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h index 77c2d6758..70b5258c9 100644 --- a/src/video_core/texture_cache/surface_base.h +++ b/src/video_core/texture_cache/surface_base.h @@ -32,6 +32,12 @@ enum class MatchStructureResult : u32 { None = 2, }; +enum class MatchTopologyResult : u32 { + FullMatch = 0, + CompressUnmatch = 1, + None = 2, +}; + class StagingCache { public: StagingCache() {} @@ -136,12 +142,20 @@ public: params.target == SurfaceTarget::Texture2D && params.num_levels == 1; } - bool MatchesTopology(const SurfaceParams& rhs) const { + MatchTopologyResult MatchesTopology(const SurfaceParams& rhs) const { const u32 src_bpp{params.GetBytesPerPixel()}; const u32 dst_bpp{rhs.GetBytesPerPixel()}; const bool ib1 = params.IsBuffer(); const bool ib2 = rhs.IsBuffer(); - return std::tie(src_bpp, params.is_tiled, ib1) == std::tie(dst_bpp, rhs.is_tiled, ib2); + if (std::tie(src_bpp, params.is_tiled, ib1) == std::tie(dst_bpp, rhs.is_tiled, ib2)) { + const bool cb1 = params.IsCompressed(); + const bool cb2 = rhs.IsCompressed(); + if (cb1 == cb2) { + return MatchTopologyResult::FullMatch; + } + return MatchTopologyResult::CompressUnmatch; + } + return MatchTopologyResult::None; } MatchStructureResult MatchesStructure(const SurfaceParams& rhs) const { |