From 92992199770591d2f5708b6bb439adc9121dc10a Mon Sep 17 00:00:00 2001 From: niki Date: Tue, 3 May 2022 17:51:35 +0200 Subject: [PATCH] perform prepareDraw only once per frame --- src/modules/graphics/vulkan/Graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/vulkan/Graphics.cpp b/src/modules/graphics/vulkan/Graphics.cpp index a35c6ce72..6b85fa47a 100644 --- a/src/modules/graphics/vulkan/Graphics.cpp +++ b/src/modules/graphics/vulkan/Graphics.cpp @@ -147,6 +147,8 @@ namespace love { endRecordingGraphicsCommands(); + prepareDraw(currentFrame); + if (imagesInFlight[imageIndex] != VK_NULL_HANDLE) { vkWaitForFences(device, 1, &imagesInFlight.at(imageIndex), VK_TRUE, UINT64_MAX); } @@ -231,8 +233,6 @@ namespace love { buffers.push_back((VkBuffer)cmd.buffers->info[0].buffer->getHandle()); offsets.push_back((VkDeviceSize) 0); - prepareDraw(currentFrame); - vkCmdBindDescriptorSets(commandBuffers.at(imageIndex), VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSets.at(currentFrame), 0, nullptr); vkCmdBindVertexBuffers(commandBuffers.at(imageIndex), 0, 1, buffers.data(), offsets.data()); vkCmdBindIndexBuffer(commandBuffers.at(imageIndex), (VkBuffer) cmd.indexBuffer->getHandle(), 0, VK_INDEX_TYPE_UINT16);