Skip to content

fix(windows): WebGL2's sized texImage2D/texSubImage2D take a canvas or image - #186

Merged
triniwiz merged 1 commit into
masterfrom
fix/windows-webgl-sized-teximage-source
Oct 24, 2026
Merged

triniwiz merged 1 commit into
masterfrom
fix/windows-webgl-sized-teximage-source

Conversation

@triniwiz

Copy link
Copy Markdown
Member

WebGL2 lets the sized forms take any texture source, not just pixels:

gl.texImage2D(target, level, internalformat, width, height, border, format, type, source);
gl.texSubImage2D(target, level, x, y, width, height, format, type, source);

The Node-API binding (Windows) takes images and canvases only in the unsized forms, so a source in a sized form threw InvalidArg ("Value is none of these types ArrayBuffer | ArrayBufferView, i64"). PixiJS uploads every Text this way, so on Windows text never rendered.

On Node-API hosts, a source passed to a sized form now goes through the unsized form, which sizes the texture from the source as the sized form does. Buffers, offsets and null take the sized path as before. iOS and Android are unchanged.

Testing: on Windows, a PixiJS 8 scene whose Text was baked with renderer.generateTexture threw InvalidArg before this change and renders its labels after it.

The repo's pre-commit prettier also dropped redundant parentheses on three isCanvasView(...) || isOffscreenCanvas(...) conditions.

…r image

WebGL2 lets the sized forms, texImage2D(target, level, internalformat, width,
height, border, format, type, source) and texSubImage2D(target, level, x, y,
width, height, format, type, source), take an image, canvas, video, bitmap or
ImageData. The Node-API binding takes sources only in the unsized forms, so
on Windows these threw InvalidArg ("Value is none of these types ArrayBuffer |
ArrayBufferView, i64"). PixiJS uploads every Text this way, so text never
rendered.

On Node-API hosts a source in the sized form now goes through the unsized
form, which sizes the texture from the source as the sized one does.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 67360801-ca85-4473-b334-112785158f3b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@triniwiz
triniwiz merged commit a171dd6 into master Oct 24, 2026
14 of 21 checks passed
@triniwiz
triniwiz deleted the fix/windows-webgl-sized-teximage-source branch October 24, 2026 10:19
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