From 8f194b5fffc834883cbd53eaa306b5785ab1810e Mon Sep 17 00:00:00 2001 From: GPUCode Date: Sun, 5 Mar 2023 16:36:19 +0200 Subject: [PATCH] rasterizer_cache: Handle null surface id in GetTextureSurface * Pokemon X tries to use a texture with zero width. The previous code handled this so will we --- src/video_core/rasterizer_cache/rasterizer_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/rasterizer_cache/rasterizer_cache.h b/src/video_core/rasterizer_cache/rasterizer_cache.h index e77bd83ea..7940aa2af 100644 --- a/src/video_core/rasterizer_cache/rasterizer_cache.h +++ b/src/video_core/rasterizer_cache/rasterizer_cache.h @@ -617,7 +617,7 @@ auto RasterizerCache::GetTextureSurface(const Pica::Texture::TextureInfo& inf } SurfaceId surface_id = GetSurface(params, ScaleMatch::Ignore, true); - return slot_surfaces[surface_id]; + return surface_id ? slot_surfaces[surface_id] : slot_surfaces[NULL_SURFACE_ID]; } template