Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vk: Fix section merge calculations when using a temp resource #14657

Merged
merged 2 commits into from Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions rpcs3/Emu/RSX/VK/VKTextureCache.cpp
Expand Up @@ -384,15 +384,15 @@ namespace vk
{
// Either a bitcast is required or a scale+copy to mipmap level / layer
const u32 requested_width = dst->width();
const u32 requested_height = src_y + src_h + section.dst_h;
const u32 requested_height = src_y + src_h + section.dst_h; // Accounts for possible typeless ref on the same helper on src
_dst = vk::get_typeless_helper(src_image->format(), src_image->format_class(), requested_width, requested_height);
_dst->change_layout(cmd, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
}

if (_dst == src_image)
if (_dst != dst)
{
// Write-to-self situation. Account for the initial typeless copy.
ensure(dst != _dst);
// We place the output after the source to account for the initial typeless-xfer if applicable
// If src_image == _dst then this is just a write-to-self. Either way, use best-fit placement.
dst_x = 0;
dst_y = src_y + src_h;
}
Expand Down