Skip to content

Commit

Permalink
Fix image-decoder-to-texture in WebGL 2 mode. (KhronosGroup#3652)
Browse files Browse the repository at this point in the history
The test was fetching nonexistent "width" and "height" properties on
the VideoFrame, leading to a (0, 0)-sized texture upload. codedWidth
and codedHeight are the best approximation without handling the full
visibleRect in the test.

Follow-on to KhronosGroup#3641 .

Associated with Chromium bug crbug.com/337904214 .
  • Loading branch information
kenrussell authored May 4, 2024
1 parent 992583d commit 1b63714
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
let frame = decodeResult.image;
if (window.WebGL2RenderingContext && gl instanceof window.WebGL2RenderingContext) {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, frame.width, frame.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, frame);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, frame.codedWidth, frame.codedHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, frame);
} else {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);
}
Expand Down

0 comments on commit 1b63714

Please sign in to comment.