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

Re: [Public WebGL] Shared resources between contexts



On Thu, Jan 5, 2012 at 2:17 AM, Rehno Lindeque <rehno.lindeque@gmail.com> wrote:
>
> What happens if one calls getContext twice on the canvas with the same
> contextId but different arguments?

The same WebGL context object that was created during the first call
to getContext() will be returned from the second call. The context
creation attributes will be ignored during the second call. See
http://www.khronos.org/registry/webgl/specs/latest/#2.2 , "The
WebGLContextAttributes object is only used on the first call to
getContext".

-Ken

> I've done this once before (calling getContext a second time, where
> the first context was held by another library) and it appeared to me
> as if the two contexts didn't share their depth buffers... I might
> have made a mistake though I'm not sure (Could be that I accidentally
> used a different contextId?)
>
> On Thu, Jan 5, 2012 at 12:00 PM, Florian Bösch <pyalot@gmail.com> wrote:
>> If the context is synonymous, then "linking" is achieved as if it was two
>> contexts being "linked". Therefore #3 is possible.
>>
>>
>> On Thu, Jan 5, 2012 at 7:24 AM, 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.
>
> -----------------------------------------------------------
> 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
> -----------------------------------------------------------
>

-----------------------------------------------------------
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
-----------------------------------------------------------