fix: update HTML-in-Canvas texture upload to new copyElementImageToTexture/texElementImage2D API#8828
Merged
Merged
Conversation
WebGPU copyElementImageToTexture now takes source and destination dictionaries instead of positional args. WebGL texElementImage2D now takes (target, internalformat, element), dropping level/srcFormat/destType.
mvaligursky
added a commit
that referenced
this pull request
Jun 3, 2026
WebGPU copyElementImageToTexture now takes source and destination dictionaries instead of positional args. WebGL texElementImage2D now takes (target, internalformat, element), dropping level/srcFormat/destType. Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
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.
Update the HTML-in-Canvas texture upload paths to match the breaking API change in Chromium's HTML-in-Canvas proposal (see the explainer). This only affects Chrome Canary, not a release version of any browser.
Changes:
copyElementImageToTexturenow takes two dictionaries — a source{ source: element }and a destination{ destination, width, height }— instead of positional(element, width, height, dst)args.texElementImage2Dnow takes(target, internalformat, element), dropping the oldlevel,srcFormat, anddestTypeparameters. The sized internal format (_glInternalFormat, e.g.gl.RGBA8) is used directly.API Changes:
queue.copyElementImageToTexture(element, width, height, { texture })after:
queue.copyElementImageToTexture({ source: element }, { destination: { texture }, width, height })gl.texElementImage2D(TEXTURE_2D, level, internalFormat, srcFormat, destType, element)after:
gl.texElementImage2D(TEXTURE_2D, RGBA8, element)These are internal graphics-layer calls; the public
Texture.setSource()/Texture.upload()API is unchanged, so thehtml-textureandhtml-texture-configuratorexamples need no changes.