Skip to content

Fix paperdoll and world GPU rendering conflict#7

Open
MiRinChan wants to merge 6 commits into
OpenYSMDev:mainfrom
MiRinFork:fix-gpu
Open

Fix paperdoll and world GPU rendering conflict#7
MiRinChan wants to merge 6 commits into
OpenYSMDev:mainfrom
MiRinFork:fix-gpu

Conversation

@MiRinChan
Copy link
Copy Markdown

@MiRinChan MiRinChan commented May 27, 2026

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 GpuMesh only 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:

2026-05-28_22 30 46

After:

2026-05-28_22 32 32

Try close #11, Real Camera require send the vertex to VertexConsumer

@MiRinChan MiRinChan changed the title fix GPU renderer add GPU renderer for opengl es 3.2 May 28, 2026
MiRinChan added 3 commits May 28, 2026 21:49
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.
@MiRinChan MiRinChan changed the title add GPU renderer for opengl es 3.2 Fix paperdoll and world GPU rendering conflict May 28, 2026
@MiRinChan MiRinChan marked this pull request as draft May 28, 2026 16:11
- 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
@MiRinChan MiRinChan marked this pull request as ready for review May 28, 2026 17:46
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.

[Feat] RealCamera支持?

1 participant