mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 18:15:14 +00:00
texture_cache: Handle overlap with equal address and different tiling mode (#2981)
This commit is contained in:
parent
d124f40503
commit
e5c6c88835
@ -222,14 +222,23 @@ std::tuple<ImageId, int, int> TextureCache::ResolveOverlap(const ImageInfo& imag
|
|||||||
-1, -1};
|
-1, -1};
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageId new_image_id{};
|
if (image_info.type == tex_cache_image.info.type &&
|
||||||
if (image_info.type == tex_cache_image.info.type) {
|
image_info.resources > tex_cache_image.info.resources) {
|
||||||
ASSERT(image_info.resources > tex_cache_image.info.resources);
|
// Size and resources are greater, expand the image.
|
||||||
new_image_id = ExpandImage(image_info, cache_image_id);
|
return {ExpandImage(image_info, cache_image_id), -1, -1};
|
||||||
} else {
|
|
||||||
UNREACHABLE();
|
|
||||||
}
|
}
|
||||||
return {new_image_id, -1, -1};
|
|
||||||
|
if (image_info.tiling_mode != tex_cache_image.info.tiling_mode) {
|
||||||
|
// Size is greater but resources are not, because the tiling mode is different.
|
||||||
|
// Likely this memory address is being reused for a different image with a different
|
||||||
|
// tiling mode.
|
||||||
|
if (safe_to_delete) {
|
||||||
|
FreeImage(cache_image_id);
|
||||||
|
}
|
||||||
|
return {merged_image_id, -1, -1};
|
||||||
|
}
|
||||||
|
|
||||||
|
UNREACHABLE_MSG("Encountered unresolvable image overlap with equal memory address.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user