servo / surfman

Accelerated offscreen graphics for WebGL
Apache License 2.0
172 stars 84 forks source link

Check if an extension is supported, before calling function pointer returned by eglGelProcAddress #317

Open jschwe opened 2 weeks ago

jschwe commented 2 weeks ago

A non-NULL return value does not guarantee that an extension function is actually supported at runtime. The client must also make a corresponding query, such as glGetString(GL_EXTENSIONS) for OpenGL and OpenGL ES extensions; vgGetString(VG_EXTENSIONS) for OpenVG extensions; eglQueryString(display, EGL_EXTENSIONS); or query the EGL or client API version for non-extension functions, to determine if a function is supported by EGL or a specific client API context.

Source: https://registry.khronos.org/EGL/sdk/docs/man/html/eglGetProcAddress.xhtml

I haven't ran into any specific problem, but currently we are not doing this check.