From fcc39171557223d7451e9bc0431634d01d693913 Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Tue, 11 May 2021 17:05:43 -0400 Subject: [PATCH] Fix crash when trying to load scene editor on Vulkan --- engine/gfx/vulkan/src/gfx_vulkan.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/gfx/vulkan/src/gfx_vulkan.cpp b/engine/gfx/vulkan/src/gfx_vulkan.cpp index 615e429..7e57940 100755 --- a/engine/gfx/vulkan/src/gfx_vulkan.cpp +++ b/engine/gfx/vulkan/src/gfx_vulkan.cpp @@ -1168,10 +1168,12 @@ void GFXVulkan::submit(GFXCommandBuffer* command_buffer, const int identifier) { case GFXCommandType::SetGraphicsPipeline: { currentPipeline = (GFXVulkanPipeline*)command.data.set_graphics_pipeline.pipeline; - vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, currentPipeline->handle); + if(currentPipeline != nullptr) { + vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, currentPipeline->handle); - resetDescriptorState(); - lastDescriptorHash = 0; + resetDescriptorState(); + lastDescriptorHash = 0; + } } break; case GFXCommandType::SetVertexBuffer: