diff --git a/vulkan.d b/vulkan.d index c604e2c..558eb2f 100644 --- a/vulkan.d +++ b/vulkan.d @@ -439,6 +439,11 @@ struct Vulkan Arena arena; Arena[FRAME_OVERLAP] frame_arenas; + debug + { + bool frame_started; + } + u32 frame_index; u32 semaphore_index; @@ -774,6 +779,16 @@ MapBuffer(T)(Buffer* buffer, u64 count) void BeginFrame() { + debug + { + if(g_vk.frame_started) + { + assert(false, "BeginFrame called twice, did you forget to end the frame?"); + } + + g_vk.frame_started = true; + } + // TODO: move vkWaitForFences so it no longer holds up the frame, will need to change how fences are handled in regards to images though VkResult result = vkWaitForFences(g_vk.device, 1, g_vk.render_fence_ptr, VK_TRUE, 1000000000); VkCheckA("BeginFrame failure: vkWaitForFences error", result); @@ -961,6 +976,11 @@ SubmitAndPresent() { VkCheckA("FinishFrame failure: vkQueuePresentKHR failure", result); } + + debug + { + g_vk.frame_started = false; + } } void