Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces raw hexadecimal values representing WebGL/OpenGL constants with named constant definitions (such as GL_BYTE, GL_INVALID_OPERATION, and GL_TEXTURE_2D) across src/lib/libwebgl.js and src/lib/libwebgl2.js to improve code readability and maintainability. To support these constants, src/struct_info.json has been updated with the new definitions, and the generated files src/struct_info_generated.json and src/struct_info_generated_wasm64.json have been rebuilt accordingly. There are no review comments, and I have no feedback to provide.
…and libwebgl2. NFC
Replace hardcoded magic numbers in the WebGL libraries with symbolic
constants exposed via `struct_info` (using `{{{ cDefs.* }}}` macro keys
where needed to avoid Closure code size regressions). Stacked on
`magic_numbers_4_libglemu`; adds 138 defines.
This is part 8 of a 9-part series replacing hardcoded numeric constants
across JS libraries and runtime code. Across the full series, 938 new
defines are added to `struct_info` (534 -> 1,472), adding ~22 ms (~2.7%)
to an uncached hello-world link (0 ms on cached builds).
Split out from emscripten-core#28199
sbc100
force-pushed
the
magic_numbers_8_libwebgl
branch
from
November 14, 2026 06:21
dcdbf10 to
0d60f23
Compare
This branch has not been deployed
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.
Replace hardcoded magic numbers in the WebGL libraries with symbolic constants exposed via
struct_info(using{{{ cDefs.* }}}macro keys where needed to avoid Closure code size regressions).This is part 8 of a 9-part series replacing hardcoded numeric constants across JS libraries and runtime code. Across the full series, 938 new defines are added to
struct_info(534 -> 1,472), adding ~22 ms (~2.7%) to an uncached hello-world link (0 ms on cached builds).Split out from #28199