Skip to content

refactor: remove WebGL constant imports and direct runtime GL calls - #11276

Merged
ibgreen merged 1 commit into
masterfrom
codex/webgl-interop-cleanup
Nov 22, 2026
Merged

ibgreen merged 1 commit into
masterfrom
codex/webgl-interop-cleanup

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Background

Deck.gl runtime still imports WebGL enums and makes native calls in map adapters. luma.gl exposes device operations and shader metadata for these paths.

Change List

  • Use luma device APIs for ArcGIS and Google Maps interop
  • Use portable transition buffer and terrain texture options
  • Read public shader metadata for deck.gl constant conversion
  • Remove WebGL enum imports from examples, tests, and playgrounds
  • Unit tests, render fixtures, and documentation

Lint, package type checks, website build, and focused Chromium tests passed. The grid test that failed in the commit hook passed on rerun. The broader browser run reported Heatmap failures.


Note

Low Risk
Refactors WebGL constant imports and context state management to use luma device APIs and context references without changing functional rendering behavior.

Overview
Removes remaining dependencies on @luma.gl/core/webgl-constants and legacy WebGL constant imports across core modules, examples, and test suites. Where constants are still required, code now references properties directly on the active WebGL context (gl.*), standard Buffer usage flags, or portable string parameters such as cullMode and feedbackBufferMode.

Updates runtime map integration in the ArcGIS and Google Maps overlays to manage rendering parameters through luma.gl device APIs (withDeviceParameters and withParametersWebGL) instead of raw GL state calls. Additionally, GPUVectorModel now determines constant attribute conversions using public pipeline shader layout metadata via getAttributeShaderTypeInfo.

Reviewed by Cursor Bugbot for commit d2cae3f. Bugbot is set up for automated code reviews on this repo. Configure here.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 82.867% (+0.02%) from 82.845% — codex/webgl-interop-cleanup into master

@ibgreen
ibgreen marked this pull request as ready for review November 21, 2026 22:55

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T22:57:18.265498Z d2cae3f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d2cae3f. Configure here.

const device: Device = deck.device;
device.withParametersWebGL({}, () => {
const arrayBuffer = device.getParametersWebGL(gl.ARRAY_BUFFER_BINDING);
device.withParametersWebGL({[gl.ARRAY_BUFFER_BINDING]: arrayBuffer}, () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Google Maps array buffer not restored

High Severity

The interleaved overlay no longer rebinds Google's ARRAY_BUFFER after Deck renders. withParametersWebGL does not track ARRAY_BUFFER_BINDING, so the previous explicit restore is dropped and Google Maps keeps Deck's last buffer bound.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d2cae3f. Configure here.

};

const textureToScreenPass = device.beginRenderPass({
framebuffer: screenFboAdapter as any,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ArcGIS overlay restores wrong framebuffer

High Severity

After compositing onto the map, withParametersWebGL restores the offscreen Deck framebuffer that deck.redraw left bound, instead of leaving ArcGIS's screen framebuffer bound. The previous path rebound the captured screen FBO and reset per-FBO drawBuffers.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d2cae3f. Configure here.

);
if (declaration && !getAttributeShaderTypeInfo(declaration.type).integer) {
attributes = {...attributes, [name]: new Float32Array(value)};
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Integer constants skip float conversion

Medium Severity

Integer-backed constant attributes convert to floats only when pipeline already exists. setConstantAttributes often runs before the first draw, so a missing pipeline leaves Int32Array/Uint32Array values on float shader inputs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d2cae3f. Configure here.

@ibgreen
ibgreen added this pull request to the merge queue Nov 22, 2026
Merged via the queue into master with commit 9dfa0dc Nov 22, 2026
8 checks passed
@ibgreen
ibgreen deleted the codex/webgl-interop-cleanup branch November 22, 2026 01:22

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed d2cae3f after merge; follow-ups below.

No P1s.

Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.


Generated by Claude Code

Comment thread docs/upgrade-guide.md
Comment on lines +36 to +37
`@luma.gl/core/webgpu`. WebGL debugging tools move to
`@luma.gl/core/webgl-debug`. Use string-valued GPU parameters in deck.gl.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P2: The v10 note no longer says where GL moved. luma.gl v10 drops @luma.gl/constants and ships @luma.gl/core/webgl-constants, so GL imports break with no pointer here.

  • luma.gl v10.0.0-beta.2 exports ./webgl-constants, and its upgrade guide maps the old path to it.

Could we keep the move next to the string-parameter advice?

Suggested change
`@luma.gl/core/webgpu`. WebGL debugging tools move to
`@luma.gl/core/webgl-debug`. Use string-valued GPU parameters in deck.gl.
`@luma.gl/core/webgpu`. WebGL constants and debugging tools move to
`@luma.gl/core/webgl-constants` and `@luma.gl/core/webgl-debug`. Prefer string-valued GPU parameters in deck.gl.

Generated by Claude Code

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.

3 participants