vk: Clamp buffer row length to never be less than declared width

- Fixes some games with broken textures
This commit is contained in:
kd-11 2019-11-13 16:51:38 +03:00 committed by kd-11
parent 2408922806
commit c415578e79

View File

@ -736,7 +736,7 @@ namespace vk
copy_info.imageSubresource.layerCount = 1;
copy_info.imageSubresource.baseArrayLayer = layout.layer;
copy_info.imageSubresource.mipLevel = layout.level;
copy_info.bufferRowLength = block_in_pixel * row_pitch / block_size_in_bytes;
copy_info.bufferRowLength = std::max<u32>(block_in_pixel * row_pitch / block_size_in_bytes, layout.width_in_texel);
if (opt.require_swap || opt.require_deswizzle || dst_image->aspect() & VK_IMAGE_ASPECT_STENCIL_BIT)
{