diff options
| author | 2020-02-16 01:48:33 -0300 | |
|---|---|---|
| committer | 2020-02-16 04:15:42 -0300 | |
| commit | bfda5ff3f6695034486184275a1d6eb05810f62c (patch) | |
| tree | 449380520fb85c3282c625361cc14309303b876f /src | |
| parent | Merge pull request #3401 from FernandoS27/synchronization (diff) | |
| download | yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.gz yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.tar.xz yuzu-bfda5ff3f6695034486184275a1d6eb05810f62c.zip | |
texture_cache: Avoid matches in 3D textures
Code before this commit was trying to match 3D textures with another
target. Fix that.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 19 |
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: | |||
| 721 | std::pair<TSurface, TView> GetSurface(const GPUVAddr gpu_addr, const CacheAddr cache_addr, | 721 | std::pair<TSurface, TView> GetSurface(const GPUVAddr gpu_addr, const CacheAddr cache_addr, |
| 722 | const SurfaceParams& params, bool preserve_contents, | 722 | const SurfaceParams& params, bool preserve_contents, |
| 723 | bool is_render) { | 723 | bool is_render) { |
| 724 | |||
| 725 | // Step 1 | 724 | // Step 1 |
| 726 | // Check Level 1 Cache for a fast structural match. If candidate surface | 725 | // Check Level 1 Cache for a fast structural match. If candidate surface |
| 727 | // matches at certain level we are pretty much done. | 726 | // matches at certain level we are pretty much done. |
| @@ -733,14 +732,18 @@ private: | |||
| 733 | return RecycleSurface(overlaps, params, gpu_addr, preserve_contents, | 732 | return RecycleSurface(overlaps, params, gpu_addr, preserve_contents, |
| 734 | topological_result); | 733 | topological_result); |
| 735 | } | 734 | } |
| 735 | |||
| 736 | const auto struct_result = current_surface->MatchesStructure(params); | 736 | const auto struct_result = current_surface->MatchesStructure(params); |
| 737 | if (struct_result != MatchStructureResult::None && | 737 | if (struct_result != MatchStructureResult::None) { |
| 738 | (params.target != SurfaceTarget::Texture3D || | 738 | const auto& old_params = current_surface->GetSurfaceParams(); |
| 739 | current_surface->MatchTarget(params.target))) { | 739 | const bool not_3d = params.target != SurfaceTarget::Texture3D && |
| 740 | if (struct_result == MatchStructureResult::FullMatch) { | 740 | old_params.target != SurfaceTarget::Texture3D; |
| 741 | return ManageStructuralMatch(current_surface, params, is_render); | 741 | if (not_3d || current_surface->MatchTarget(params.target)) { |
| 742 | } else { | 742 | if (struct_result == MatchStructureResult::FullMatch) { |
| 743 | return RebuildSurface(current_surface, params, is_render); | 743 | return ManageStructuralMatch(current_surface, params, is_render); |
| 744 | } else { | ||
| 745 | return RebuildSurface(current_surface, params, is_render); | ||
| 746 | } | ||
| 744 | } | 747 | } |
| 745 | } | 748 | } |
| 746 | } | 749 | } |