texture_cache: Handle greater guest_size with equal resources.

This commit is contained in:
squidbus 2025-05-22 11:55:51 -07:00
parent 37887e8fde
commit f10d63a02c

View File

@ -222,14 +222,15 @@ std::tuple<ImageId, int, int> TextureCache::ResolveOverlap(const ImageInfo& imag
-1, -1}; -1, -1};
} }
ImageId new_image_id{}; ASSERT(image_info.type == tex_cache_image.info.type);
if (image_info.type == tex_cache_image.info.type) { if (image_info.resources == tex_cache_image.info.resources) {
ASSERT(image_info.resources > tex_cache_image.info.resources); // Could happen due to texture and render target guest_size mismatch
new_image_id = ExpandImage(image_info, cache_image_id); return {cache_image_id, -1, -1};
} else {
UNREACHABLE();
} }
return {new_image_id, -1, -1};
// At this point, something is wrong if we aren't expanding the image
ASSERT(image_info.resources > tex_cache_image.info.resources);
return {ExpandImage(image_info, cache_image_id), -1, -1};
} }
// Right overlap, the image requested is a possible subresource of the image from cache. // Right overlap, the image requested is a possible subresource of the image from cache.