Overv / VulkanTutorial

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

UpdateUniformBuffer between fences is misleading for a beginner. #356

Closed Snouf-ID closed 6 months ago

Snouf-ID commented 10 months ago

I propose to pass this line "updateUniformBuffer" after "vkResetFences". As a beginner in Vulkan I thought the update had to be between the two calls, but not at all. I think for beginners it would be good to keep the fence functions close. If it is validated and no one has the motivation I can make a merge request to update all the code pages :)

        vkWaitForFences(device, 1, &computeInFlightFences[currentFrame], VK_TRUE, UINT64_MAX);
        updateUniformBuffer(currentFrame);
        vkResetFences(device, 1, &computeInFlightFences[currentFrame]);

to

        vkWaitForFences(device, 1, &computeInFlightFences[currentFrame], VK_TRUE, UINT64_MAX);
        vkResetFences(device, 1, &computeInFlightFences[currentFrame]);
        updateUniformBuffer(currentFrame);
Snouf-ID commented 6 months ago

It's was split for resize code, my bad.