Skip to content

perf(webgl): drop unused stencil buffer from context attributes#117

Merged
chiefcll merged 1 commit into
mainfrom
claude/naughty-chaum-ea84b5
Jul 2, 2026
Merged

perf(webgl): drop unused stencil buffer from context attributes#117
chiefcll merged 1 commit into
mainfrom
claude/naughty-chaum-ea84b5

Conversation

@chiefcll

@chiefcll chiefcll commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Change stencil: true to stencil: false in createWebGLContext (src/utils.ts). One-line change.

Why

A repo-wide search shows nothing uses the stencil buffer: no stencilFunc/stencilOp/stencilMask/STENCIL_TEST anywhere, clipping is scissor-based, WebGlContextWrapper.clear() only clears COLOR_BUFFER_BIT, and the RTT framebuffer (WebGlCtxRenderTexture) attaches only COLOR_ATTACHMENT0 with no stencil renderbuffer.

Per the tile-based GPU rules in CLAUDE.md, every enabled buffer costs tile memory bandwidth on every flush on Mali 400-class targets — so an unused stencil buffer is pure waste.

Verification

  • stencil: true in utils.ts was the only stencil reference in the repo (src/, exports/, examples/)
  • pnpm test: 267/267 unit tests pass
  • Visual regression: deferred to CI on this PR

🤖 Generated with Claude Code

No code path uses the stencil buffer (no stencilFunc/stencilOp/STENCIL_TEST;
clipping is scissor-based and clear() only touches COLOR_BUFFER_BIT), but
requesting it costs tile memory bandwidth on every flush on tile-based GPUs
(Mali 400-class targets).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chiefcll chiefcll merged commit ecc8fd2 into main Jul 2, 2026
1 check passed
@chiefcll chiefcll deleted the claude/naughty-chaum-ea84b5 branch July 2, 2026 00:38
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