add check for starting a frame in an invalid situation
This commit is contained in:
parent
4d9d8cf57e
commit
ca41d7e4f4
20
vulkan.d
20
vulkan.d
@ -439,6 +439,11 @@ struct Vulkan
|
|||||||
Arena arena;
|
Arena arena;
|
||||||
Arena[FRAME_OVERLAP] frame_arenas;
|
Arena[FRAME_OVERLAP] frame_arenas;
|
||||||
|
|
||||||
|
debug
|
||||||
|
{
|
||||||
|
bool frame_started;
|
||||||
|
}
|
||||||
|
|
||||||
u32 frame_index;
|
u32 frame_index;
|
||||||
u32 semaphore_index;
|
u32 semaphore_index;
|
||||||
|
|
||||||
@ -774,6 +779,16 @@ MapBuffer(T)(Buffer* buffer, u64 count)
|
|||||||
void
|
void
|
||||||
BeginFrame()
|
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
|
// 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);
|
VkResult result = vkWaitForFences(g_vk.device, 1, g_vk.render_fence_ptr, VK_TRUE, 1000000000);
|
||||||
VkCheckA("BeginFrame failure: vkWaitForFences error", result);
|
VkCheckA("BeginFrame failure: vkWaitForFences error", result);
|
||||||
@ -961,6 +976,11 @@ SubmitAndPresent()
|
|||||||
{
|
{
|
||||||
VkCheckA("FinishFrame failure: vkQueuePresentKHR failure", result);
|
VkCheckA("FinishFrame failure: vkQueuePresentKHR failure", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug
|
||||||
|
{
|
||||||
|
g_vk.frame_started = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user