Skip to content

Fix mesh loading on Apple#5

Merged
julcst merged 1 commit into
masterfrom
fix-apple-mesh-loading
Jun 20, 2026
Merged

Fix mesh loading on Apple#5
julcst merged 1 commit into
masterfrom
fix-apple-mesh-loading

Conversation

@julcst

@julcst julcst commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Fixes a quirk with Apple Core Profile implementation of OpenGL that requires a VAO to be bound for every buffer operation. #4

Copilot AI review requested due to automatic review settings June 20, 2026 12:08
@julcst julcst merged commit 1a4e354 into master Jun 20, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect mesh index-buffer association on macOS / OpenGL 4.1 Core Profile by ensuring the correct VAO is bound before legacy (non-DSA) buffer operations, preventing later mesh loads from affecting previously loaded meshes (Issue #4).

Changes:

  • Bind the mesh VAO before vbo.load(...) / ebo.load(...) in all Mesh::load(...) overloads when MODERN_GL is not defined (legacy path).
  • Remove the redundant later vao.bind() calls in the legacy setup blocks, since the VAO is already bound earlier.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/framework/mesh.cpp
Comment on lines +46 to +48
#ifndef MODERN_GL
vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers
#endif
Comment thread src/framework/mesh.cpp
Comment on lines +85 to +87
#ifndef MODERN_GL
vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers
#endif
Comment thread src/framework/mesh.cpp
Comment on lines +119 to +121
#ifndef MODERN_GL
vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers
#endif
Comment thread src/framework/mesh.cpp
Comment on lines +159 to +161
#ifndef MODERN_GL
vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers
#endif
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