#Is there any reason why vkSubmitQueue would throw an error at runtime?
23 messages · Page 1 of 1 (latest)
logd("fence wait");
vkWaitForFences(device, 1, &inFlightFences[currentFrame], VK_TRUE, UINT64_MAX);
uint32_t imgIndex;
VkResult result = vkAcquireNextImageKHR(device, swapchain, UINT64_MAX,
imgAvailableSemaphores[currentFrame], VK_NULL_HANDLE, &imgIndex);
if (result == VK_ERROR_OUT_OF_DATE_KHR) {
logd("recreating swapchain");
recreateSwapchain();
return;
} else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
logd("failing swapchain image acquisition?");
processVkResult("Vulkan acquire next image", result);
}
logd("reseting fences");
processVkResult("Vulkan reset fences",
vkResetFences(device, 1, &inFlightFences[currentFrame]));
logd("reseting cmd buffer");
// TODO -- understand commented out part
processVkResult("Vulkan reset command buffer",
vkResetCommandBuffer(commandBuffers[currentFrame], /*VkCommandBufferResetFlagBits*/ 0));
recordCommandBuffer(commandBuffers[currentFrame], imgIndex);
VkSubmitInfo submitInfo {};
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
VkSemaphore waitSemaphores[] = {imgAvailableSemaphores[currentFrame]};
VkPipelineStageFlags waitStages[] = {VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT};
submitInfo.waitSemaphoreCount = 1;
submitInfo.pWaitSemaphores = waitSemaphores;
submitInfo.pWaitDstStageMask = waitStages;
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &commandBuffers[currentFrame];
VkSemaphore signalSemaphores[] = {renderFinishedSemaphores[currentFrame]};
submitInfo.signalSemaphoreCount = 1;
submitInfo.pSignalSemaphores = signalSemaphores;
logd("submitting queue to draw buffer");
// processVkResult("Vulkan submit queue to draw buffer",
// vkQueueSubmit(graphicsQueue, 1, &submitInfo, inFlightFences[currentFrame]), false);
vkQueueSubmit(graphicsQueue, 1, &submitInfo, inFlightFences[currentFrame]);
right after the last statement, there's another logd message that never gets printed. logd is just a macro i made that prints out the message as well as the file and line number
What error code do you get?
I don't get an error code
A failure at vkQueueSubmit is very common and may hint at undefined behaviour of your app.
but usually the failure would be in the form of a VkResult, right?
Yes
you need to check the return value of vkQueueSubmit(graphicsQueue, 1, &submitInfo, inFlightFences[currentFrame]);
if you don't do it already: enable validation layers and check errors and warnings up to the error at submission time
you can do that in vkconfig without any code changes
I have validation layers, and I've tried checking the resulting value
and what result did you get?
If I do something like
logd("submitting queue to draw buffer");
VkResult r = vkQueueSubmit(graphicsQueue, 1, &submitInfo, inFlightFences[currentFrame]);
logd("r: " << r);
the program still quits before the debug line is reached
That's likely the case, I should probably check every argument there isn't secretly null, although i dont know how that'd happen
any debugger recommendations?
you don't really have a choice in debuggers
gdb for gcc/clang
and whatever visual studio uses for msvc
thanks
the chance of this is very low but, are you sure that vkQueueSubmit function loaded correctly?