Skip to content

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

Description

@willeastcott

Two leftovers from the WebGL1 no-mipmaps-on-NPOT restriction, which does not apply to WebGL2:

src/platform/graphics/webgl/webgl-texture.js:481:

if (!texture._needsUpload && ((texture._needsMipmapsUpload && texture._mipmapsUploaded) || !texture.pot)) {
    return;
}

The || !texture.pot clause early-returns mipmap-only upload requests for any NPOT texture, even though NPOT mipmaps are legal in WebGL2.

src/platform/graphics/texture.js:962:

const mips = this.pot && this._mipmaps && !(this._compressed && this._levels.length === 1);

gpuSize under-reports VRAM for every NPOT mipmapped texture.

🤖 Found during a code audit with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions