Browse Source

perform prepareDraw only once per frame

niki 3 years ago
parent
commit
9299219977
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/graphics/vulkan/Graphics.cpp

+ 2 - 2
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);