mirror of https://github.com/auygun/kaliber.git
Fix memory issue in VulkanContext::SwapBuffers
This commit is contained in:
parent
26514fd142
commit
10823cd459
|
@ -1536,24 +1536,13 @@ bool VulkanContext::SwapBuffers() {
|
|||
/*pWaitSemaphores*/
|
||||
(separate_present_queue_) ? &image_ownership_semaphores_[frame_index_]
|
||||
: &draw_complete_semaphores_[frame_index_],
|
||||
/*swapchainCount*/ 0,
|
||||
/*pSwapchain*/ nullptr,
|
||||
/*pImageIndices*/ nullptr,
|
||||
/*swapchainCount*/ 1,
|
||||
/*pSwapchains*/ &window_.swapchain,
|
||||
/*pImageIndices*/ &window_.current_buffer,
|
||||
/*pResults*/ nullptr,
|
||||
};
|
||||
|
||||
VkSwapchainKHR* swapchains = (VkSwapchainKHR*)alloca(sizeof(VkSwapchainKHR*));
|
||||
uint32_t* pImageIndices = (uint32_t*)alloca(sizeof(uint32_t*));
|
||||
|
||||
present.pSwapchains = swapchains;
|
||||
present.pImageIndices = pImageIndices;
|
||||
|
||||
DCHECK(window_.swapchain != VK_NULL_HANDLE);
|
||||
|
||||
swapchains[present.swapchainCount] = window_.swapchain;
|
||||
pImageIndices[present.swapchainCount] = window_.current_buffer;
|
||||
present.swapchainCount++;
|
||||
|
||||
err = QueuePresentKHR(present_queue_, &present);
|
||||
|
||||
frame_index_ += 1;
|
||||
|
|
Loading…
Reference in New Issue