Skip to content

Fix issue with glReadPixels() not taking into account the GL_PACK_ROW_LENGTH - #27243

Merged
juj merged 5 commits into
emscripten-core:mainfrom
juj:fix_webgl2_readpixels_pack_row_length
Nov 19, 2026
Merged

juj merged 5 commits into
emscripten-core:mainfrom
juj:fix_webgl2_readpixels_pack_row_length

Conversation

@juj

@juj juj commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Fix issue with glReadPixels() not taking into account the GL_PACK_ROW_LENGTH, when WEBGL_USE_GARBAGE_FREE_APIS=false e.g. in Wasm64 mode, due to https://crbug.com/324992397 and https://bugzil.la/1838218 .

…_LENGTH, when WEBGL_USE_GARBAGE_FREE_APIS=false, e.g. in Wasm64 mode, due to https://crbug.com/324992397 and https://bugzil.la/1838218.
@juj
juj enabled auto-merge (squash) July 2, 2026 17:19
@sbc100

sbc100 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Looks like you need to run ./test/runner other.test_gen_struct_info --rebase.

juj and others added 3 commits November 19, 2026 14:08
…_pack_row_length

# Conflicts:
#	src/struct_info.json
#	src/struct_info_generated.json
- Zero-initialize the buffer in the test with `= {0}` instead of
  calling memset().
- Regenerate `struct_info_generated_wasm64.json`, which was missing the
  new `GL_PACK_ROW_LENGTH` define (`other.test_gen_struct_info`).
- Refer to `GL_PACK_ROW_LENGTH` directly, the same way as the other GL
  constants are now referred to since emscripten-core#28144.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The glReadPixels() change adds 31 bytes of JS to this test.  The Wasm
size is not affected.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@juj
juj force-pushed the fix_webgl2_readpixels_pack_row_length branch from cf841a0 to 6b934b5 Compare November 19, 2026 12:17
@juj

juj commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Ops, this PR fell in between. Updated it now to latest, though it looks like there's some kind of network outage on the CI.

Comment thread test/test_browser.py

@requires_webgl2
def test_webgl2_readpixels(self):
self.btest_exit('webgl2_readpixels_pack_row_length.c', cflags=['-sMIN_WEBGL_VERSION=2'])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you rename either test method or the filename, so that they match?

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm with test change

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@juj
juj merged commit 4141f85 into emscripten-core:main Nov 19, 2026
43 checks passed
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.

2 participants