Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.08k stars 513 forks source link

Why are some results not handled? #207

Closed maltekliemann closed 3 years ago

maltekliemann commented 3 years ago

The following API calls return VkResult, but their results are not checked: vkBindBufferMemory, vkMapMemory, vkBindImageMemory, vkAllocateCommandBuffers, vkBeginCommandBuffer, vkEndCommandBuffer, vkQueueWaitIdle, vkWaitForFences, vkResetFences. There may be more.

If there is a clever reason for omitting the error handling (code bloat?), then I think it should be mentioned to avoid confusion. Otherwise, I could create a pull request for the fix (just want to make sure I'm not missing anything before putting in the work)?

Overv commented 3 years ago

This is indeed to avoid code bloat. A common pattern across these functions is that they generally only fail due to out-of-memory errors and those are currently intentionally not handled in the tutorial because it's very unlikely for them to occur.