Skip to content

Remove dead supportsStencil assignment in initializeCapabilities - #9264

Open
willeastcott wants to merge 1 commit into
mainfrom
fix-supports-stencil-clobber
Open

Remove dead supportsStencil assignment in initializeCapabilities#9264
willeastcott wants to merge 1 commit into
mainfrom
fix-supports-stencil-clobber

Conversation

@willeastcott

Copy link
Copy Markdown
Contributor

Description

initializeCapabilities() set supportsStencil from gl.getContextAttributes(), but the constructor calls createBackbuffer() immediately afterwards, which unconditionally overwrites it with initOptions.stencil — so the queried value was always discarded. The requested-options convention is deliberate: the WebGPU backend sets supportsStencil the same way, and all readers (backbuffer, post-effect queue, depth-grab pass) use it to decide render-target stencil allocation. This removes the one dead assignment; no behaviour change.

The adjacent supportsMsaa is write-only inside the engine, but it dates to 2016 and ships typed in playcanvas.d.ts, so it is kept as app-readable surface — that resolves the other half of the issue.

Fixes #9258

Verified: lint clean; unit suite at the main baseline (2337 passing).

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

🤖 Generated with Claude Code

The value queried from getContextAttributes was always discarded:
createBackbuffer runs immediately afterwards and overwrites
supportsStencil with initOptions.stencil, which is the deliberate
convention shared with the WebGPU backend and what all readers rely on.
supportsMsaa is kept as it is typed in the d.ts and app-readable.
Fixes #9258.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2390.4 KB (−0.0 KB, −0.00%) 614.7 KB (−0.0 KB, −0.00%) 476.8 KB (−0.2 KB, −0.05%)
playcanvas.min.mjs 2387.7 KB (−0.0 KB, −0.00%) 613.4 KB (−0.0 KB, −0.00%) 476.5 KB (+0.0 KB, +0.00%)

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.

WebglGraphicsDevice: supportsStencil from context attributes is immediately clobbered; supportsMsaa never read

1 participant