fix(@typegpu/gl): Reserve all keywords defined in the GLSL ES 3.0 spec - #2905
Conversation
|
pkg.pr.new packages benchmark commit |
There was a problem hiding this comment.
Pull request overview
This PR expands @typegpu/gl’s GLSL generator identifier reservation to cover the full set of keywords (and built-in globals) from the GLSL ES 3.0 specification, preventing generated names from colliding with reserved tokens in emitted GLSL.
Changes:
- Added a
reservedKeywordslist (GLSL ES 3.0 keywords + built-in globals) inglslGenerator.ts. - Updated
GlslGenerator.initGenerator()to reserve all entries from that list viactx.reserveIdentifier(...).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
ℹ️ ВAppпру two typos inline — both inside the new keyword list.
Reviewed changes
- Replaced the one-off
reserveIdentifier('gl_Position', 'global')/reserveIdentifier('sample', 'global')calls with a module-levelreservedKeywordsarray enumerating the globals, defined keywords, and future-reserved type/qualifier words from GLSL ES 3.0, reserved in a loop inside the generator constructor.
The list goes one word too far in a couple of places (see the inline comment and nitpick).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.80, 1.64, 3.52, 5.95, 7.00, 11.28, 21.15, 21.73]
line [0.88, 1.75, 3.33, 5.89, 6.80, 11.11, 20.96, 22.50]
line [0.84, 1.62, 3.70, 5.89, 6.62, 11.51, 21.04, 22.65]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.32, 0.54, 0.70, 0.81, 1.09, 1.08, 1.27, 1.39]
line [0.32, 0.48, 0.66, 0.74, 1.02, 1.02, 1.23, 1.42]
line [0.26, 0.45, 0.62, 0.71, 1.00, 1.07, 1.32, 1.37]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.74, 1.90, 3.36, 6.67, 11.21, 23.74, 51.23, 102.83]
line [0.78, 1.88, 2.91, 6.69, 10.86, 23.39, 50.28, 101.22]
line [0.89, 1.98, 3.24, 6.01, 11.14, 24.31, 48.67, 99.27]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 325 | 0 | 0 |
No notable changes.
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
22ac1a8 to
d151ba8
Compare
There was a problem hiding this comment.
✅ No new issues found. Prior feedback addressed in
d151ba82.
Reviewed changes
- Fixed the
pler2DMSArraytypo tosampler2DMSArray, restoring reservation of the real GLSL ES keyword (it now matches itsisampler2DMSArray/usampler2DMSArraysiblings). - Removed the duplicate
volatileentry.
Both items raised in the previous review are cleanly resolved; the keyword list now has each real GLSL ES 3.0 word once and correctly spelled.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
d151ba8 to
ccf0d00
Compare
ccf0d00 to
8ee9946
Compare

No description provided.