summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-05-21 07:56:53 -0400
committerGravatar ReinUsesLisp2019-06-20 21:38:33 -0300
commitfcac55d5bff025fee822c2e7b0e06cdc178143dc (patch)
treec7a15716d3f2fac94717e879ee2f23ccd2e8c185 /src
parenttexture_cache: Fermi2D reform and implement View Mirage (diff)
downloadyuzu-fcac55d5bff025fee822c2e7b0e06cdc178143dc.tar.gz
yuzu-fcac55d5bff025fee822c2e7b0e06cdc178143dc.tar.xz
yuzu-fcac55d5bff025fee822c2e7b0e06cdc178143dc.zip
texture_cache: Add checks for texture buffers.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/surface_base.h18
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 a3dd1c607..210f27907 100644
--- a/src/video_core/texture_cache/surface_base.h
+++ b/src/video_core/texture_cache/surface_base.h
@@ -114,10 +114,23 @@ public:
114 bool MatchesTopology(const SurfaceParams& rhs) const { 114 bool MatchesTopology(const SurfaceParams& rhs) const {
115 const u32 src_bpp{params.GetBytesPerPixel()}; 115 const u32 src_bpp{params.GetBytesPerPixel()};
116 const u32 dst_bpp{rhs.GetBytesPerPixel()}; 116 const u32 dst_bpp{rhs.GetBytesPerPixel()};
117 return std::tie(src_bpp, params.is_tiled) == std::tie(dst_bpp, rhs.is_tiled); 117 const bool ib1 = params.IsBuffer();
118 const bool ib2 = rhs.IsBuffer();
119 return std::tie(src_bpp, params.is_tiled, ib1) == std::tie(dst_bpp, rhs.is_tiled, ib2);
118 } 120 }
119 121
120 MatchStructureResult MatchesStructure(const SurfaceParams& rhs) const { 122 MatchStructureResult MatchesStructure(const SurfaceParams& rhs) const {
123 // Buffer surface Check
124 if (params.IsBuffer()) {
125 const std::size_t wd1 = params.width*params.GetBytesPerPixel();
126 const std::size_t wd2 = rhs.width*rhs.GetBytesPerPixel();
127 if (wd1 == wd2) {
128 return MatchStructureResult::FullMatch;
129 }
130 return MatchStructureResult::None;
131 }
132
133 // Linear Surface check
121 if (!params.is_tiled) { 134 if (!params.is_tiled) {
122 if (std::tie(params.width, params.height, params.pitch) == 135 if (std::tie(params.width, params.height, params.pitch) ==
123 std::tie(rhs.width, rhs.height, rhs.pitch)) { 136 std::tie(rhs.width, rhs.height, rhs.pitch)) {
@@ -125,7 +138,8 @@ public:
125 } 138 }
126 return MatchStructureResult::None; 139 return MatchStructureResult::None;
127 } 140 }
128 // Tiled surface 141
142 // Tiled Surface check
129 if (std::tie(params.depth, params.block_width, params.block_height, params.block_depth, 143 if (std::tie(params.depth, params.block_width, params.block_height, params.block_depth,
130 params.tile_width_spacing, params.num_levels) == 144 params.tile_width_spacing, params.num_levels) ==
131 std::tie(rhs.depth, rhs.block_width, rhs.block_height, rhs.block_depth, 145 std::tie(rhs.depth, rhs.block_width, rhs.block_height, rhs.block_depth,