perform prepareDraw only once per frame

This commit is contained in:
niki
2022-05-03 17:51:35 +02:00
parent 0953f3540e
commit 9299219977
+2 -2
View File
@@ -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);