Skip to content

Wait for first video frame in texture-srgb-upload.html - #3788

Merged
toji merged 1 commit into
KhronosGroup:mainfrom
zijiehe-google-com:fix-srgb-upload-race
Aug 11, 2026
Merged

Wait for first video frame in texture-srgb-upload.html#3788
toji merged 1 commit into
KhronosGroup:mainfrom
zijiehe-google-com:fix-srgb-upload-race

Conversation

@zijiehe-google-com

Copy link
Copy Markdown
Contributor

Unlike other WebGL video tests, texture-srgb-upload.html previously called await video.play() without waiting for requestVideoFrameCallback or using wtu.waitVideoUploadable(video). On slow or asynchronous hardware decoders, texImage2D(..., video) could upload before the first frame was ready, reading all zeros ([0, 0, 0, 0]).

Use await wtu.waitVideoUploadable(video) before running texture upload tests to prevent this race condition, matching the standard idiom used in tex-image-and-sub-image-2d-with-video.js and other video tests.

Unlike other WebGL video tests, texture-srgb-upload.html previously
called await video.play() without waiting for requestVideoFrameCallback
or using wtu.waitVideoUploadable(video). On slow or asynchronous
hardware decoders, texImage2D(..., video) could upload before the first
frame was ready, reading all zeros ([0, 0, 0, 0]).

Use await wtu.waitVideoUploadable(video) before running texture upload
tests to prevent this race condition, matching the standard idiom used
in tex-image-and-sub-image-2d-with-video.js and other video tests.
@CLAassistant

CLAassistant commented Aug 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@zijiehe-google-com

Copy link
Copy Markdown
Contributor Author

cc @kenrussell Could you take a look at this change. I believe this change can fix this test failure on both android and fuchsia.

@zijiehe-google-com

Copy link
Copy Markdown
Contributor Author

During Ken's OOO, @toji , can you take a look at this change? Thank you.

@toji toji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@toji
toji merged commit e18dbb3 into KhronosGroup:main Aug 11, 2026
2 checks passed
@zijiehe-google-com

Copy link
Copy Markdown
Contributor Author

Thank you.

@zijiehe-google-com
zijiehe-google-com deleted the fix-srgb-upload-race branch August 11, 2026 18:59
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.

3 participants