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*/
|
/*pWaitSemaphores*/
|
||||||
(separate_present_queue_) ? &image_ownership_semaphores_[frame_index_]
|
(separate_present_queue_) ? &image_ownership_semaphores_[frame_index_]
|
||||||
: &draw_complete_semaphores_[frame_index_],
|
: &draw_complete_semaphores_[frame_index_],
|
||||||
/*swapchainCount*/ 0,
|
/*swapchainCount*/ 1,
|
||||||
/*pSwapchain*/ nullptr,
|
/*pSwapchains*/ &window_.swapchain,
|
||||||
/*pImageIndices*/ nullptr,
|
/*pImageIndices*/ &window_.current_buffer,
|
||||||
/*pResults*/ nullptr,
|
/*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);
|
DCHECK(window_.swapchain != VK_NULL_HANDLE);
|
||||||
|
|
||||||
swapchains[present.swapchainCount] = window_.swapchain;
|
|
||||||
pImageIndices[present.swapchainCount] = window_.current_buffer;
|
|
||||||
present.swapchainCount++;
|
|
||||||
|
|
||||||
err = QueuePresentKHR(present_queue_, &present);
|
err = QueuePresentKHR(present_queue_, &present);
|
||||||
|
|
||||||
frame_index_ += 1;
|
frame_index_ += 1;
|
||||||
|
|
Loading…
Reference in New Issue