mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
perform prepareDraw only once per frame
This commit is contained in:
@@ -147,6 +147,8 @@ namespace love {
|
|||||||
|
|
||||||
endRecordingGraphicsCommands();
|
endRecordingGraphicsCommands();
|
||||||
|
|
||||||
|
prepareDraw(currentFrame);
|
||||||
|
|
||||||
if (imagesInFlight[imageIndex] != VK_NULL_HANDLE) {
|
if (imagesInFlight[imageIndex] != VK_NULL_HANDLE) {
|
||||||
vkWaitForFences(device, 1, &imagesInFlight.at(imageIndex), VK_TRUE, UINT64_MAX);
|
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());
|
buffers.push_back((VkBuffer)cmd.buffers->info[0].buffer->getHandle());
|
||||||
offsets.push_back((VkDeviceSize) 0);
|
offsets.push_back((VkDeviceSize) 0);
|
||||||
|
|
||||||
prepareDraw(currentFrame);
|
|
||||||
|
|
||||||
vkCmdBindDescriptorSets(commandBuffers.at(imageIndex), VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSets.at(currentFrame), 0, nullptr);
|
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());
|
vkCmdBindVertexBuffers(commandBuffers.at(imageIndex), 0, 1, buffers.data(), offsets.data());
|
||||||
vkCmdBindIndexBuffer(commandBuffers.at(imageIndex), (VkBuffer) cmd.indexBuffer->getHandle(), 0, VK_INDEX_TYPE_UINT16);
|
vkCmdBindIndexBuffer(commandBuffers.at(imageIndex), (VkBuffer) cmd.indexBuffer->getHandle(), 0, VK_INDEX_TYPE_UINT16);
|
||||||
|
|||||||
Reference in New Issue
Block a user