fix(editor): render the overlay from the BGFX submit path - #26
Open
Unny984 wants to merge 1 commit into
Open
Conversation
Overlays that detour IDXGISwapChain::Present, such as RivaTuner Statistics Server, can bypass the replay timeline's own present detour. When that happened the replay browser opened logically but never drew: the button handler ran and menu input was suspended, yet renderInternal was never reached, so not even its warnings were logged. Composite the overlay at the end of the RendererContextD3D12::submit hook instead. That hook is on the client's own renderer, so it cannot be detoured away, and BGFX has not flipped the back buffer yet. The present detours keep their existing path and skip the frame when the submit path already drew it, so machines without a competing overlay render exactly once. Offline export is left on its current route. Because a competing overlay also swallows ResizeBuffers, add syncSwapChainGeometry() so the overlay rebuilds its swap-chain resources when the back buffer changes size without beforeResize() being called. Validated on Minecraft Bedrock 1.26.10.04 with LeviLamina 26.10.14, with RivaTuner Statistics Server 7.x and MSI Afterburner attached: the replay browser now renders, with the RTSS OSD composited above it.
indpriyanshuraj
approved these changes
Aug 25, 2026
indpriyanshuraj
left a comment
Contributor
There was a problem hiding this comment.
Went through the changes, approach looks good to me. Moving the overlay rendering to bgfx submit path should avoid the Present detour issue, and the submit flag handles the case where normal path is still reached so we don't render twice. Resize handling also makes sense for when ResizeBuffers gets bypassed. Overall the change is pretty focused,i didn't spotted anything concerning in the diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overlays that detour IDXGISwapChain::Present, such as RivaTuner Statistics Server, can bypass the replay timeline's own present detour. When that happened the replay browser opened logically but never drew: the button handler ran and menu input was suspended, yet renderInternal was never reached, so not even its warnings were logged.
Composite the overlay at the end of the RendererContextD3D12::submit hook instead. That hook is on the client's own renderer, so it cannot be detoured away, and BGFX has not flipped the back buffer yet. The present detours keep their existing path and skip the frame when the submit path already drew it, so machines without a competing overlay render exactly once. Offline export is left on its current route.
Because a competing overlay also swallows ResizeBuffers, add syncSwapChainGeometry() so the overlay rebuilds its swap-chain resources when the back buffer changes size without beforeResize() being called.
Validated on Minecraft Bedrock 1.26.10.04 with LeviLamina 26.10.14, with RivaTuner Statistics Server 7.x and MSI Afterburner attached: the replay browser now renders, with the RTSS OSD composited above it.
Summary
Describe the problem and the focused change that resolves it.
Validation
xmake -r -ygit diff --checkDescribe any additional validation and list the Minecraft, LeviLamina, and Playback versions used.
Compatibility and Replay Impact
Describe changes to compatibility, replay files, recorded data, or runtime behavior. Write
Nonewhen not applicable.Checklist