Fix paperdoll and world GPU rendering conflict#7
Open
MiRinChan wants to merge 6 commits into
Open
Conversation
Use four per-mesh bone buffers so a new upload does not immediately overwrite data that the driver may still be consuming from an earlier draw. The ring relies on normal driver implicit synchronization; no explicit GL fences are added here.
- Extract shared computeBoneMatrices() helper used by both the direct-draw and consumer render paths - Replace coversContiguousQuad/hasIndex scan with an isContiguousQuad bitmask - Remove the now-unused Matrix3f import
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.
On my machine Minecraft reports the GL version as
OpenGL ES 3.2 NVIDIA 595.45.04.In this setup, the GPU renderer could not reliably render the same model in both the paperdoll and the third-person world view at the same time. (I think so.) The third-person model disappeared, or only flashed for a short moment when the sync state changed.
This PR try to fix that case.
Previously, each
GpuMeshonly had one bone SSBO. When the paperdoll and the world view rendered the same model in the same frame, both draws updated that same buffer. On my driver, that could make one draw read bone data that had already been overwritten by the other draw.Now each mesh has 4 bone SSBOs and rotates between them for each draw. The size is meant to cover the usual few frames that may still be in flight on the GPU. This still relies on the driver's normal implicit synchronization; there are no explicit GL fences in this PR.
I also changed the GPU render path to restore the GL state it touches, so the custom renderer does not leak state into the next render pass.
The shader compatibility change is only for the normal GPU path. It no longer requires GL 4.3 core when the required ARB extensions are available. The Iris/Oculus path still requires GL 4.3 because it uses a compute shader.
Before:
After:
Try close #11, Real Camera require send the vertex to
VertexConsumer