Skip to content

Commit

Permalink
Vulkan: fixed (recently broken) command buffer indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
ec- committed Jan 17, 2025
1 parent 9d8d9a0 commit f7fb7f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions code/renderervk/tr_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,9 +1797,7 @@ void RB_ExecuteRenderCommands( const void *data ) {
default:
// stop rendering
#ifdef USE_VULKAN
if ( vk.frame_count ) {
vk_end_frame();
}
vk_end_frame();
// if (com_errorEntered && (begin_frame_called && !end_frame_called)) {
// vk_end_frame();
// }
Expand Down
8 changes: 4 additions & 4 deletions code/renderervk/vk.c
Original file line number Diff line number Diff line change
Expand Up @@ -7214,10 +7214,6 @@ void vk_end_frame( void )
VK_CHECK( qvkQueueSubmit( vk.queue, 1, &submit_info, vk.cmd->rendering_finished_fence ) );
vk.cmd->waitForFence = qtrue;

// pickup next command buffer for rendering
vk.cmd_index++;
vk.cmd_index %= NUM_COMMAND_BUFFERS;

// presentation may take undefined time to complete, we can't measure it in a reliable way
backEnd.pc.msec = ri.Milliseconds() - backEnd.pc.msec;

Expand All @@ -7229,6 +7225,10 @@ void vk_present_frame( void )
VkPresentInfoKHR present_info;
VkResult res;

// pickup next command buffer for rendering
vk.cmd_index++;
vk.cmd_index %= NUM_COMMAND_BUFFERS;

if ( ri.CL_IsMinimized() )
return;

Expand Down

0 comments on commit f7fb7f7

Please sign in to comment.