yuzu-emu
/
yuzu
Archived
1
0
Fork 0

Merge pull request #3423 from ReinUsesLisp/no-match-3d

texture_cache: Avoid matches in 3D textures
This commit is contained in:
bunnei 2020-02-21 12:16:51 -05:00 committed by GitHub
commit dc7ebc2d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -721,7 +721,6 @@ private:
std::pair<TSurface, TView> GetSurface(const GPUVAddr gpu_addr, const CacheAddr cache_addr, std::pair<TSurface, TView> GetSurface(const GPUVAddr gpu_addr, const CacheAddr cache_addr,
const SurfaceParams& params, bool preserve_contents, const SurfaceParams& params, bool preserve_contents,
bool is_render) { bool is_render) {
// Step 1 // Step 1
// Check Level 1 Cache for a fast structural match. If candidate surface // Check Level 1 Cache for a fast structural match. If candidate surface
// matches at certain level we are pretty much done. // matches at certain level we are pretty much done.
@ -733,14 +732,18 @@ private:
return RecycleSurface(overlaps, params, gpu_addr, preserve_contents, return RecycleSurface(overlaps, params, gpu_addr, preserve_contents,
topological_result); topological_result);
} }
const auto struct_result = current_surface->MatchesStructure(params); const auto struct_result = current_surface->MatchesStructure(params);
if (struct_result != MatchStructureResult::None && if (struct_result != MatchStructureResult::None) {
(params.target != SurfaceTarget::Texture3D || const auto& old_params = current_surface->GetSurfaceParams();
current_surface->MatchTarget(params.target))) { const bool not_3d = params.target != SurfaceTarget::Texture3D &&
if (struct_result == MatchStructureResult::FullMatch) { old_params.target != SurfaceTarget::Texture3D;
return ManageStructuralMatch(current_surface, params, is_render); if (not_3d || current_surface->MatchTarget(params.target)) {
} else { if (struct_result == MatchStructureResult::FullMatch) {
return RebuildSurface(current_surface, params, is_render); return ManageStructuralMatch(current_surface, params, is_render);
} else {
return RebuildSurface(current_surface, params, is_render);
}
} }
} }
} }