mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
vk: Properly use declared pitch when loading simple images
This commit is contained in:
parent
14aebeac58
commit
7fe9802f87
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user