emscripten-core / emscripten-core/emscripten

glFenceSync and glClientWaitSync causing 'null function or function signature mismatch'

Open
#15,953 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Please include the following in your bug report:

**Version of emscripten/emsdk:**
3.0.1

**Full link command and output with `-v` appended:**
-s EVAL_CTORS=0
-s MIN_WEBGL_VERSION=1
-s MAX_WEBGL_VERSION=2
-s USE_WEBGL2=1
-s FULL_ES2=1
-s FULL_ES3=1
--bind
-s BINARYEN_EXTRA_PASSES=--one-caller-inline-max-function-size=1024
-s TOTAL_STACK=16mb
-s TOTAL_MEMORY=128mb
-s ALLOW_MEMORY_GROWTH=0
-Os

I am debugging a graphics C++ application on WebAssembly which directly calls OpenGL commands. When I compile and run the following code:
```
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
glClientWaitSync(sync, 0, 0); // same issue with glWaitSync(sync, 0, GL_TIMEOUT_IGNORED);
```

I get the following exception:
`null function or function signature mismatch`

on Chrome 96.0.4664.110.

Any ideas on where the error might be caused from? In the js glue file, i see:

```
function _emscripten_glWaitSync(sync, flags, timeoutLo, timeoutHi) {
// See WebGL2 vs GLES3 difference on GL_TIMEOUT_IGNORED above (https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.15)
GLctx.waitSync(GL.syncs[sync], flags, convertI32PairToI53(timeoutLo, timeoutHi));
}
```
which i tried printing a manual console log in to see if it ever gets invoked. The console log does not get invoked before the error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.