mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-21 19:05:00 +00:00
texture_cache: Make sure left-overlapped mips get marked for rebind. (#2268)
This commit is contained in:
parent
e1550c9091
commit
84c27eea2a
1 changed files with 13 additions and 13 deletions
|
@ -240,22 +240,21 @@ std::tuple<ImageId, int, int> TextureCache::ResolveOverlap(const ImageInfo& imag
|
||||||
return {{}, -1, -1};
|
return {{}, -1, -1};
|
||||||
} else {
|
} else {
|
||||||
// Left overlap, the image from cache is a possible subresource of the image requested
|
// Left overlap, the image from cache is a possible subresource of the image requested
|
||||||
if (!merged_image_id) {
|
|
||||||
// We need to have a larger, already allocated image to copy this one into
|
|
||||||
return {{}, -1, -1};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto mip = tex_cache_image.info.IsMipOf(image_info); mip >= 0) {
|
if (auto mip = tex_cache_image.info.IsMipOf(image_info); mip >= 0) {
|
||||||
if (tex_cache_image.binding.is_target) {
|
if (tex_cache_image.binding.is_target) {
|
||||||
// We have a larger image created and a separate one, representing a subres of it,
|
// We have a larger image created and a separate one, representing a subres of it,
|
||||||
// bound as render target. In this case we need to rebind render target.
|
// bound as render target. In this case we need to rebind render target.
|
||||||
tex_cache_image.binding.needs_rebind = 1u;
|
tex_cache_image.binding.needs_rebind = 1u;
|
||||||
|
if (merged_image_id) {
|
||||||
GetImage(merged_image_id).binding.is_target = 1u;
|
GetImage(merged_image_id).binding.is_target = 1u;
|
||||||
|
}
|
||||||
|
|
||||||
FreeImage(cache_image_id);
|
FreeImage(cache_image_id);
|
||||||
return {merged_image_id, -1, -1};
|
return {merged_image_id, -1, -1};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We need to have a larger, already allocated image to copy this one into
|
||||||
|
if (merged_image_id) {
|
||||||
tex_cache_image.Transit(vk::ImageLayout::eTransferSrcOptimal,
|
tex_cache_image.Transit(vk::ImageLayout::eTransferSrcOptimal,
|
||||||
vk::AccessFlagBits2::eTransferRead, {});
|
vk::AccessFlagBits2::eTransferRead, {});
|
||||||
|
|
||||||
|
@ -268,6 +267,7 @@ std::tuple<ImageId, int, int> TextureCache::ResolveOverlap(const ImageInfo& imag
|
||||||
FreeImage(cache_image_id);
|
FreeImage(cache_image_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {merged_image_id, -1, -1};
|
return {merged_image_id, -1, -1};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue