macOS: render entity models via VBO, not empty display lists - #7
Merged
Merged
Conversation
ArmorScreen showed the right-side player preview as an empty pane because ModelPart::draw() was guarded on OPENGL_ES instead of USE_VBO, the same shape of bug that baa7155 fixed for chunk VBOs. On the macOS desktop GL 2.1 build, gles.h defines USE_VBO but does NOT define OPENGL_ES. Under USE_VBO, Tesselator::end(true, vboId) only uploads geometry to the VBO and never issues a draw call. The old compile() wrapped that upload in glNewList / glEndList, so the display list captured zero draw commands. draw() then called glCallList on an empty list and nothing rendered: head, body, arms, legs, all gone — every place an entity model is drawn (player preview, third-person view, other mobs). Gate the glNewList/glEndList pair on !USE_VBO and gate the drawArrayVT_NoState path on USE_VBO so each platform takes the matching half of compile and draw: - Win32 (USE_VBO undef, OPENGL_ES undef): display-list path, Tesselator::end issues the draw, captured into glNewList. Same as before. - iOS/Android/RPi (OPENGL_ES => USE_VBO): VBO path, unchanged. - macOS desktop (USE_VBO, no OPENGL_ES): VBO path, FIXED — no more empty display list.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Fixes the last reported bug from the previous round: the Armor screen's player preview was empty. Same family of bug as the chunk-VBO regression in
baa7155— a USE_VBO/OPENGL_ES mismatch.ModelPart::draw()(used for the player, every mob, item-in-hand, etc.) was branching on#ifdef OPENGL_ES:…and
compile()symmetrically wrapped the tesselator upload inglNewList(list, GL_COMPILE) … glEndList()on the#ifndef OPENGL_ESpath.On macOS desktop GL 2.1,
gles.hdefinesUSE_VBObut does not defineOPENGL_ES. UnderUSE_VBO,Tesselator::end(true, vboId)only uploads geometry into the VBO and never issues anyglDrawArrays:So on macOS,
compile()was wrapping a pure VBO upload inside a display list and recording zero draw calls.draw()then calledglCallList(list)on that empty list. Result: the model parts were uploaded to GPU memory, but nothing ever drew them — the player preview pane stayed blank, and the same thing would happen for any entity model rendered throughModelPart::draw()(other mobs, third-person player, etc.).Fix is to gate both halves on
USE_VBOinstead ofOPENGL_ESso each platform takes the matching half of compile + draw:USE_VBOundef,OPENGL_ESundef): display-list path.Tesselator::endissues a realglDrawArrays(the#ifndef USE_VBOblock), the display list captures it,glCallListreplays it. Behavior unchanged.OPENGL_ES⇒USE_VBO): VBO path.glNewList/glEndListwere already skipped under!defined(OPENGL_ES); they stay skipped under!defined(USE_VBO). Behavior unchanged.USE_VBO, noOPENGL_ES): VBO path now.compile()just uploads to the VBO,draw()callsdrawArrayVT_NoState(vboId, …). Fixed.Review & Testing Checklist for Human
Yellow risk. The change is small and platform-gated, but it touches every entity model render on every platform — please verify nothing regressed elsewhere:
ModelPartfor some models).Notes
for (int i = 0; i < 6; i++)outer loop incompile()(the inner one shadowsi) is an unrelated old bug — it makes the VBO 6× larger than necessary, butdraw()only readscubes.size() * 36vertices so the visible geometry is correct. Leaving it alone to keep this PR scoped.Link to Devin session: https://app.devin.ai/sessions/5a7050a439284734a4b5702cd21fd2b7
Requested by: @j92580498-max