- output the error code when submitting a command buffer fails.

This commit is contained in:
Christoph Oelckers 2019-03-02 15:57:43 +01:00
parent f8aa48d053
commit dc9a995695

View file

@ -180,8 +180,8 @@ void VulkanFrameBuffer::Update()
submitInfo.signalSemaphoreCount = 1; submitInfo.signalSemaphoreCount = 1;
submitInfo.pSignalSemaphores = &mUploadSemaphore->semaphore; submitInfo.pSignalSemaphores = &mUploadSemaphore->semaphore;
VkResult result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, VK_NULL_HANDLE); VkResult result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, VK_NULL_HANDLE);
if (result != VK_SUCCESS) if (result < VK_SUCCESS)
I_FatalError("Failed to submit command buffer!\n"); I_FatalError("Failed to submit command buffer! Error %d\n", result);
// Wait for upload commands to finish, then submit render commands // Wait for upload commands to finish, then submit render commands
VkSemaphore waitSemaphores[] = { mUploadSemaphore->semaphore, device->imageAvailableSemaphore->semaphore }; VkSemaphore waitSemaphores[] = { mUploadSemaphore->semaphore, device->imageAvailableSemaphore->semaphore };
@ -194,8 +194,8 @@ void VulkanFrameBuffer::Update()
submitInfo.signalSemaphoreCount = 1; submitInfo.signalSemaphoreCount = 1;
submitInfo.pSignalSemaphores = &device->renderFinishedSemaphore->semaphore; submitInfo.pSignalSemaphores = &device->renderFinishedSemaphore->semaphore;
result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, device->renderFinishedFence->fence); result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, device->renderFinishedFence->fence);
if (result != VK_SUCCESS) if (result < VK_SUCCESS)
I_FatalError("Failed to submit command buffer!\n"); I_FatalError("Failed to submit command buffer! Error %d\n", result);
} }
else else
{ {
@ -212,8 +212,8 @@ void VulkanFrameBuffer::Update()
submitInfo.signalSemaphoreCount = 1; submitInfo.signalSemaphoreCount = 1;
submitInfo.pSignalSemaphores = &device->renderFinishedSemaphore->semaphore; submitInfo.pSignalSemaphores = &device->renderFinishedSemaphore->semaphore;
VkResult result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, device->renderFinishedFence->fence); VkResult result = vkQueueSubmit(device->graphicsQueue, 1, &submitInfo, device->renderFinishedFence->fence);
if (result != VK_SUCCESS) if (result < VK_SUCCESS)
I_FatalError("Failed to submit command buffer!\n"); I_FatalError("Failed to submit command buffer! Error %d\n", result);
} }
Flush3D.Unclock(); Flush3D.Unclock();