mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-14 14:43:15 +00:00
texture_cache: Handle overlap with equal address and different tiling mode (#2981)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
d124f40503
commit
e5c6c88835
1 changed files with 16 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue