Skip to content

Swapchain TimePredictor#207

Merged
tweakoz merged 2 commits intotweakoz:developfrom
rygo6:rg-renderpredict
Mar 18, 2026
Merged

Swapchain TimePredictor#207
tweakoz merged 2 commits intotweakoz:developfrom
rygo6:rg-renderpredict

Conversation

@rygo6
Copy link
Copy Markdown
Contributor

@rygo6 rygo6 commented Mar 16, 2026

  • Add TimePredictor which tries to predict swapchain present time of a gfx context.
  • Wires a gfxContexts TimePredictor to Device through ezapp on init. Lets you call predictedRenderFinishTick from the device to get a prediction on the next swap present.

Added some comments, TODOs and cleanup related to the swapchain render loop that I found when sorting through this.

  • Created OrkVkAssert which will log out the name of the VkResult for easier debugging. Updated the OrkAssert(ok == SUCCESS) calls in vkctx to use this.
  • Added a few more OrkProfilerSampleScope calls. Moved existing ones to better location.

Due to how the waitFrame was setup, and also another bug which called vkDeviceWaitIdle every frame, there was no frame pipelining. After each submit it would fully wait for that frame to finish. I did not change that behavior in this PR. It still fully waits for the frame to finish without pipelining. But I made a few changes to make this behavior more apparent and easier to change. Specifically added an incrementFrame separate from the waitFrame, enuqueFrame and presentFrame calls so you can easily discern in which order it is queuing, presenting and waiting.

I found a chunk of the swapchain fence wait logic to not be necessary so I deleted it.

… gfx context.

* Write gxcontext to device through ezapp on init to let you call predictedRenderFinishTick from the device.
* Several other cleanups and clarifications related to the swap render loop.
@rygo6 rygo6 force-pushed the rg-renderpredict branch from 4387f93 to df0cfc5 Compare March 16, 2026 02:16
@rygo6 rygo6 changed the title TimePreditor Swapchain TimePredictor Mar 16, 2026
@tweakoz tweakoz merged commit 243e849 into tweakoz:develop Mar 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants