Skip to content

[GL] Support cross-library alias targets in recordGLProcAddressGet - #28104

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:fix-gl-emu-alias-targets
Open

sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:fix-gl-emu-alias-targets

Conversation

@sbc100

@sbc100 sbc100 commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

When recordGLProcAddressGet processes LibraryGLEmulation, alias targets such as glGenFramebuffers live in LibraryGL (which has already been merged into LibraryManager.library), not in lib.

Check LibraryManager.library in addition to lib so that targets like glGenFramebuffers in emscripten_glGenFramebuffersOES are updated to point to emscripten_glGenFramebuffers.

See: #27852

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates src/lib/libwebgl.js to support cross-library alias targets by looking them up in LibraryManager.library, and adds a corresponding test test_dylink_glemu_alias in test/test_other.py. Feedback suggests using Object.prototype.hasOwnProperty.call instead of calling hasOwnProperty directly on lib and LibraryManager.library to prevent potential runtime errors if hasOwnProperty is shadowed.

Comment thread src/lib/libwebgl.js
When `recordGLProcAddressGet` processes `LibraryGLEmulation`, alias
targets such as `glGenFramebuffers` live in `LibraryGL` (which has
already been merged into `LibraryManager.library`), not in `lib`.

Check `LibraryManager.library` in addition to `lib` so that targets
like `glGenFramebuffers` in `emscripten_glGenFramebuffersOES` are updated
to point to `emscripten_glGenFramebuffers`.

See: emscripten-core#27852
@sbc100
sbc100 force-pushed the fix-gl-emu-alias-targets branch from aabd127 to 952d880 Compare October 29, 2026 20:39
@sbc100
sbc100 requested a review from kripken October 29, 2026 20:39

This branch has not been deployed

No deployments
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.

1 participant