Skip to content

Use regular signatures and proxying for glWaitSync/glClientWaitSync - #25933

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:glWaitSync
Dec 18, 2025
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:glWaitSync

Conversation

@sbc100

@sbc100 sbc100 commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

I can't see why this was done this way in the first place? The PARAM_I64 support existed back in cdf7bc5 when proxying was first added.

Perhaps it was just that the EM_FUNC_SIG_XX macros were harder write before I64 was replaced with J in #20678?

Fixes: #25932

@juj

juj commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

Hmm, I can't remember. The only thing I vaguely recall about the wait timeout was the need to avoid 53-bit Number splicing.. but that doesn't seem to happen here. LGTM.

I can't see why this was done this way in the first place?  The
`PARAM_I64` support existed back in cdf7bc5 when proxying was first
added.

Perhaps it was just that the `EM_FUNC_SIG_XX` macros were harder write
before `I64` was replaced with `J` in emscripten-core#20678?

Fixes: emscripten-core#25932
@sbc100
sbc100 merged commit b624060 into emscripten-core:main Dec 18, 2025
@sbc100
sbc100 deleted the glWaitSync branch December 18, 2025 00:51
hubot pushed a commit to google/skia that referenced this pull request Feb 6, 2026
Upstream ref: emscripten-core/emscripten#25933

Change-Id: Ia5f33516abfc921ffedfca7297c4af6d4b07c0eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1155136
Reviewed-by: Ben Wagner <[email protected]>
Reviewed-by: Thomas Smith <[email protected]>
Commit-Queue: Ben Wagner <[email protected]>
inolen pushed a commit to inolen/emscripten that referenced this pull request Feb 13, 2026
…mscripten-core#25933)

I can't see why this was done this way in the first place? The
`PARAM_I64` support existed back in cdf7bc5 when proxying was first
added.

Perhaps it was just that the `EM_FUNC_SIG_XX` macros were harder write
before `I64` was replaced with `J` in emscripten-core#20678?

Fixes: emscripten-core#25932
ramezgerges added a commit to ramezgerges/skia that referenced this pull request Apr 26, 2026
Skia commit 75daa3a ("Update Emscripten related code", upstream
chrome/m146, references emscripten-core/emscripten#25933) added
unconditional `#include <emscripten/version.h>` to both:

  - include/gpu/ganesh/gl/GrGLFunctions.h
  - src/gpu/ganesh/gl/GrGLGpu.cpp

The header is part of the Emscripten PR that moved the
__EMSCRIPTEN_major__ / _minor__ / _tiny__ definitions out of -D
flags and into a system header. It only ships on Emscripten versions
that include that PR.

SkiaSharp's WASM CI matrix still builds against Emscripten 2.0.6 and
2.0.23 (used by the pre-.NET-6 / .NET 7 era runtimes that SkiaSharp
keeps shipping). Those toolchains:
  - still pass -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0
    -D__EMSCRIPTEN_tiny__=6 on the emcc command line, and
  - do not ship the <emscripten/version.h> header at all.
The unconditional include therefore fails the WASM 2.0.x compile
with:

    fatal error: 'emscripten/version.h' file not found

Wrap both includes in `#if __has_include(<emscripten/version.h>)`.
On modern Emscripten the header is included as before; on
2.0.x the include is skipped and the macros remain available via
the compiler's -D defines, so the rest of the file still picks
up the right __EMSCRIPTEN_major__-based switch (e.g. the
GrGLClientWaitSyncFn signature toggle in GrGLFunctions.h:224).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.

glClientWaitSync and glWaitSync broken with WASM_BIGINT=1

2 participants