Repository navigation
fix(windows): WebGL2's sized texImage2D/texSubImage2D take a canvas or image - #186
Merged
Merged
Conversation
…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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebGL2 lets the sized forms take any texture source, not just pixels:
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 typesArrayBuffer | ArrayBufferView,i64"). PixiJS uploads everyTextthis 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
nulltake the sized path as before. iOS and Android are unchanged.Testing: on Windows, a PixiJS 8 scene whose
Textwas baked withrenderer.generateTexturethrewInvalidArgbefore this change and renders its labels after it.The repo's pre-commit prettier also dropped redundant parentheses on three
isCanvasView(...) || isOffscreenCanvas(...)conditions.