增加QueuePresent安全性
This commit is contained in:
parent
ece292965c
commit
cb15487cbe
@ -286,10 +286,20 @@ bool Device::QueuePresent()
|
||||
{
|
||||
present_info.pImageIndices=¤t_frame;
|
||||
|
||||
if(vkQueuePresentKHR(attr->graphics_queue,&present_info)!=VK_SUCCESS)
|
||||
return(false);
|
||||
VkResult result=vkQueuePresentKHR(attr->graphics_queue,&present_info);
|
||||
|
||||
if(vkQueueWaitIdle(attr->graphics_queue)!=VK_SUCCESS)
|
||||
if (!((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR)))
|
||||
{
|
||||
if (result == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||
// Swap chain is no longer compatible with the surface and needs to be recreated
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
result=vkQueueWaitIdle(attr->graphics_queue);
|
||||
|
||||
if(result!=VK_SUCCESS)
|
||||
return(false);
|
||||
|
||||
return(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user