From a5f0faefc36848a9afad54776bb63feaeb39a51f Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 10 Mar 2021 23:30:39 +0300 Subject: [PATCH] vk: Check for uninitialized target before going into any scaling op --- rpcs3/Emu/RSX/VK/VKTexture.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rpcs3/Emu/RSX/VK/VKTexture.cpp b/rpcs3/Emu/RSX/VK/VKTexture.cpp index e33f18fa52..73319a5a43 100644 --- a/rpcs3/Emu/RSX/VK/VKTexture.cpp +++ b/rpcs3/Emu/RSX/VK/VKTexture.cpp @@ -1071,6 +1071,13 @@ namespace vk vk::image* real_src = src; vk::image* real_dst = dst; + if (dst->current_layout == VK_IMAGE_LAYOUT_UNDEFINED) + { + // Watch out for lazy init + ensure(src != dst); + dst->change_layout(cmd, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); + } + // Optimization pass; check for pass-through data transfer if (!xfer_info.flip_horizontal && !xfer_info.flip_vertical && src_area.height() == dst_area.height()) {