[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Shared resources between contexts



On Wed, Jan 4, 2012 at 10:24 PM, Mark Callow <callow_mark@hicorp.co.jp> wrote:
> #3 is not already possible. The HTML5 canvas spec. says
>
> "If the getContext() method has already been invoked on this element for the
> same contextId, return the same object as was returned that time"
>
> and if the WebGL spec. says anything to contradict that, I could not find
> it. Mind you Section 2 could use some work. It says
>
> "the author must obtain a [context] for a given [canvas] as described below"
>
> but fails to say what the author actually has to do. It only says what the
> user agent has to do. The requirement to return the same object is cleverly
> hidden by the words "when ... a new" in the introduction to the user agent's
> steps.

The canvas spec defines the requirement to return the same object from
different calls to getContext() with the same context ID:

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-canvas-getcontext

(Mark, you're correct; it is not possible to create multiple WebGL
contexts against the same canvas. Having two references to the same
context object is not the same as having two distinct contexts, each
of which can render to the canvas.)

Figuring out how to define resource sharing between WebGL contexts is
the next important step forward. Florian, as you point out, drawing
the same content to multiple canvases can be implemented by the
application if resource sharing is supported, so I don't think this
should be explicitly added to the Canvas or WebGL APIs.

-Ken

> Regards
>
> -Mark
>
> On 29/12/2011 23:16, Florian Bösch wrote:
>
> There seem to be 3 basic concepts of interaction far as I could see:
>
> #1 Sharing of resources between different contexts (buffers, textures)
>
> #2 Sharing one context between different canvas instances and selection of
> frontbuffer to target a particular canvas. This seems to be a special case
> of #1 and can be fully satisfied with resource sharing (also please don't
> use the term "multiple render targets" for this. That term is reserved for a
> different feature).
>
> #3 Using multiple contexts for one canvas (kind of context linking). This is
> already possible with getting the context of an existing canvas.

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------