增加QueuePresent安全性
This commit is contained in:
parent
ece292965c
commit
cb15487cbe
@ -286,10 +286,20 @@ bool Device::QueuePresent()
|
|||||||
{
|
{
|
||||||
present_info.pImageIndices=¤t_frame;
|
present_info.pImageIndices=¤t_frame;
|
||||||
|
|
||||||
if(vkQueuePresentKHR(attr->graphics_queue,&present_info)!=VK_SUCCESS)
|
VkResult result=vkQueuePresentKHR(attr->graphics_queue,&present_info);
|
||||||
return(false);
|
|
||||||
|
if (!((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR)))
|
||||||
if(vkQueueWaitIdle(attr->graphics_queue)!=VK_SUCCESS)
|
{
|
||||||
|
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(false);
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user