summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-05-21 14:36:00 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-21 02:38:33 +0200
commite60ed2bb3e7e4ce63cc263019cce72a080c536ed (patch)
treea19de7e065f23a3f324607c25c5ac90f71b19ff4
parenttexture_cache: Add checks for texture buffers. (diff)
downloadyuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.tar
yuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.tar.gz
yuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.tar.bz2
yuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.tar.lz
yuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.tar.xz
yuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.tar.zst
yuzu-e60ed2bb3e7e4ce63cc263019cce72a080c536ed.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/texture_cache/texture_cache.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 593ceeaf6..24c87127d 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -483,6 +483,18 @@ private:
const auto host_ptr{memory_manager->GetPointer(gpu_addr)};
const auto cache_addr{ToCacheAddr(host_ptr)};
+ // Step 0: guarantee a valid surface
+ if (!cache_addr) {
+ // Return a null surface if it's invalid
+ SurfaceParams new_params = params;
+ new_params.width = 1;
+ new_params.height = 1;
+ new_params.depth = 1;
+ new_params.block_height = 0;
+ new_params.block_depth = 0;
+ return InitializeSurface(gpu_addr, new_params, false);
+ }
+
// Step 1
// Check Level 1 Cache for a fast structural match. If candidate surface
// matches at certain level we are pretty much done.