Skip to content

Remove WebGL1-era POT checks from texture mipmap upload and gpuSize - #9262

Open
willeastcott wants to merge 1 commit into
mainfrom
fix-npot-mipmap-pot-checks
Open

Remove WebGL1-era POT checks from texture mipmap upload and gpuSize#9262
willeastcott wants to merge 1 commit into
mainfrom
fix-npot-mipmap-pot-checks

Conversation

@willeastcott

Copy link
Copy Markdown
Contributor

Description

WebGL1 forbade mipmaps on NPOT textures; WebGL2 (the engine's minimum) does not. Two leftovers of that restriction:

  • WebglTexture#upload early-returned any mipmap-only upload for NPOT textures (|| !texture.pot), so e.g. enabling mipmaps after creation silently did nothing for NPOT. The redundant-upload guard (_needsMipmapsUpload && _mipmapsUploaded) is kept.
  • Texture#gpuSize excluded mip memory for NPOT mipmapped textures, under-reporting VRAM stats.

These were the only two consumers of Texture#pot, which remains as public API.

Behavioural note: NPOT textures with mipmaps: true that previously skipped mip regeneration will now generate them (correct filtering, slightly more VRAM — as WebGPU already behaves).

Fixes #9256

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

WebGL1 forbade mipmaps on NPOT textures; WebGL2 does not. The upload
early-out skipped mipmap-only uploads for every NPOT texture, and
gpuSize ignored mip memory for NPOT mipmapped textures. Fixes #9256.

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.9 KB (−0.2 KB, −0.04%)
playcanvas.min.mjs 2387.8 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.

Texture: WebGL1-era POT checks skip NPOT mipmap uploads and under-report gpuSize

1 participant