summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-02-16 05:48:33 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-16 08:15:42 +0100
commitbfda5ff3f6695034486184275a1d6eb05810f62c (patch)
tree449380520fb85c3282c625361cc14309303b876f /src
parentMerge pull request #3401 from FernandoS27/synchronization (diff)
downloadyuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar
yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.gz
yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.bz2
yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.lz
yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.xz
yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.zst
yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/texture_cache.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index f4c015635..0d105d386 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -721,7 +721,6 @@ private:
std::pair<TSurface, TView> GetSurface(const GPUVAddr gpu_addr, const CacheAddr cache_addr,
const SurfaceParams& params, bool preserve_contents,
bool is_render) {
-
// Step 1
// Check Level 1 Cache for a fast structural match. If candidate surface
// matches at certain level we are pretty much done.
@@ -733,14 +732,18 @@ private:
return RecycleSurface(overlaps, params, gpu_addr, preserve_contents,
topological_result);
}
+
const auto struct_result = current_surface->MatchesStructure(params);
- if (struct_result != MatchStructureResult::None &&
- (params.target != SurfaceTarget::Texture3D ||
- current_surface->MatchTarget(params.target))) {
- if (struct_result == MatchStructureResult::FullMatch) {
- return ManageStructuralMatch(current_surface, params, is_render);
- } else {
- return RebuildSurface(current_surface, params, is_render);
+ if (struct_result != MatchStructureResult::None) {
+ const auto& old_params = current_surface->GetSurfaceParams();
+ const bool not_3d = params.target != SurfaceTarget::Texture3D &&
+ old_params.target != SurfaceTarget::Texture3D;
+ if (not_3d || current_surface->MatchTarget(params.target)) {
+ if (struct_result == MatchStructureResult::FullMatch) {
+ return ManageStructuralMatch(current_surface, params, is_render);
+ } else {
+ return RebuildSurface(current_surface, params, is_render);
+ }
}
}
}