WebGL WEBGL_shared_resources Extension Rejected Specification




WebGL working group (public_webgl 'at' khronos.org)


Members of the WebGL working group


Last modified date: May 02, 2018
Revision: 4


WebGL extension #22


Written against the WebGL API 1.0 specification.


This extension exposes the ability to share WebGL resources with multiple WebGLRenderingContexts.


The OpenGL ES spec defines that you can share a resource (texture, buffer, shader, program, renderbuffer) with 2 or more GL contexts but with some caveats. To guarantee you'll see a change made in one context in other context requires calling glFinish on the context that made the change and call glBind on the context that wants to see the change.

Not calling glFinish and/or glBind does not guarantee you won't see the results which means that users may do neither and their app might just happen to work on some platforms and mysteriously have glitches, rendering corruption, gl errors or program failure on others.

WebGL must present consistent behavior for sharing and so this extension provides an API so that implementions can enforce and optimize these requirements.

When this extension is enabled:


[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WEBGL_shared_resources {
     const GLenum READ_ONLY  = 0x0001;
     const GLenum EXCLUSIVE  = 0x0004;

     const GLenum READ_FRAMEBUFFER = 0x8CA8;
     const GLenum DRAW_FRAMEBUFFER = 0x8CA9;

     readonly attribute WebGLShareGroup group;

     long acquireSharedResource(
         WebGLSharedObject resource,
         GLenum mode,
         AcquireSharedResourcesCallback callback);
     undefined releaseSharedResource(
         WebGLSharedObject resource);
     undefined cancelAcquireSharedResource(long id);

callback AcquireSharedResourcesCallback = undefined ();

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WebGLShareGroup {

interface WebGLSharedObject : WebGLObject {

interface WebGLBuffer : WebGLSharedObject {

interface WebGLProgram : WebGLSharedObject {

interface WebGLRenderbuffer : WebGLSharedObject {

interface WebGLShader : WebGLSharedObject {

interface WebGLTexture : WebGLSharedObject {


Revision History

Revision 1, 2012/02/06

Revision 2, 2013/05/14

Revision 3, 2014/07/15

Revision 4, 2018/05/02