From c415578e79060ef8190cf2aed08e94e45578a88f Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 13 Nov 2019 16:51:38 +0300 Subject: [PATCH] vk: Clamp buffer row length to never be less than declared width - Fixes some games with broken textures --- rpcs3/Emu/RSX/VK/VKTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/VK/VKTexture.cpp b/rpcs3/Emu/RSX/VK/VKTexture.cpp index 602c83e112..61a9f7e94b 100644 --- a/rpcs3/Emu/RSX/VK/VKTexture.cpp +++ b/rpcs3/Emu/RSX/VK/VKTexture.cpp @@ -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(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) {