From 9b21f31b0db941202ed77aac644f33bd43e514a9 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 21 Mar 2022 15:02:22 +1000 Subject: [PATCH] GS/Vulkan: Fix crash is vertex/index buffer causes exec --- pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index be0ef04e4b..520921a047 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -865,7 +865,7 @@ void GSDeviceVK::IASetVertexBuffer(const void* vertex, size_t stride, size_t cou const u32 size = static_cast(stride) * static_cast(count); if (!m_vertex_stream_buffer.ReserveMemory(size, static_cast(stride))) { - ExecuteCommandBuffer(false, "Uploading %u bytes to vertex buffer", size); + ExecuteCommandBufferAndRestartRenderPass("Uploading bytes to vertex buffer"); if (!m_vertex_stream_buffer.ReserveMemory(size, static_cast(stride))) pxFailRel("Failed to reserve space for vertices"); } @@ -885,7 +885,7 @@ bool GSDeviceVK::IAMapVertexBuffer(void** vertex, size_t stride, size_t count) const u32 size = static_cast(stride) * static_cast(count); if (!m_vertex_stream_buffer.ReserveMemory(size, static_cast(stride))) { - ExecuteCommandBuffer(false, "Mapping %u bytes to vertex buffer", size); + ExecuteCommandBufferAndRestartRenderPass("Mapping bytes to vertex buffer"); if (!m_vertex_stream_buffer.ReserveMemory(size, static_cast(stride))) pxFailRel("Failed to reserve space for vertices"); } @@ -911,7 +911,7 @@ void GSDeviceVK::IASetIndexBuffer(const void* index, size_t count) const u32 size = sizeof(u32) * static_cast(count); if (!m_index_stream_buffer.ReserveMemory(size, sizeof(u32))) { - ExecuteCommandBuffer(false, "Uploading %u bytes to index buffer", size); + ExecuteCommandBufferAndRestartRenderPass("Uploading bytes to index buffer"); if (!m_index_stream_buffer.ReserveMemory(size, sizeof(u32))) pxFailRel("Failed to reserve space for vertices"); } @@ -2799,15 +2799,14 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config) config.drawarea.width(), config.drawarea.height()); DoCopyRect(draw_rt, draw_rt_clone, config.drawarea, config.drawarea); - draw_rt_clone->TransitionToLayout(VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); - PSSetShaderResource(2, draw_rt_clone, false); + PSSetShaderResource(2, draw_rt_clone, true); } } if (config.tex && config.tex == config.ds) { // requires a copy of the depth buffer. this is mainly for ico. - copy_ds = static_cast(CreateDepthStencil(rtsize.x, rtsize.y, GSTexture::Format::DepthStencil, false)); + copy_ds = static_cast(CreateDepthStencil(rtsize.x, rtsize.y, GSTexture::Format::DepthStencil, true)); if (copy_ds) { EndRenderPass();