vk: Properly use declared pitch when loading simple images

This commit is contained in:
kd-11 2020-02-29 18:59:59 +03:00 committed by Ivan
parent 14aebeac58
commit 7fe9802f87
2 changed files with 3 additions and 4 deletions

View File

@ -338,7 +338,7 @@ vk::image* VKGSRender::get_present_source(vk::present_surface_info* info, const
}
m_texture_cache.invalidate_range(*m_current_command_buffer, range, rsx::invalidation_cause::read);
image_to_flip = m_texture_cache.upload_image_simple(*m_current_command_buffer, info->address, info->width, info->height);
image_to_flip = m_texture_cache.upload_image_simple(*m_current_command_buffer, info->address, info->width, info->height, info->pitch);
}
return image_to_flip;

View File

@ -1467,7 +1467,7 @@ namespace vk
baseclass::on_frame_end();
}
vk::image *upload_image_simple(vk::command_buffer& cmd, u32 address, u32 width, u32 height)
vk::image *upload_image_simple(vk::command_buffer& cmd, u32 address, u32 width, u32 height, u32 pitch)
{
if (!m_formats_support.bgra8_linear)
{
@ -1490,7 +1490,6 @@ namespace vk
void* mem = image->memory->map(0, layout.rowPitch * height);
u32 row_pitch = width * 4;
auto src = vm::_ptr<const char>(address);
auto dst = static_cast<char*>(mem);
@ -1503,7 +1502,7 @@ namespace vk
for (u32 col = 0; col < width; ++col)
casted_dst[col] = casted_src[col];
src += row_pitch;
src += pitch;
dst += layout.rowPitch;
}