[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 1:11 PM, Chris Marrin <cmarrin@apple.com> wrote:
>
>
> On Jan 5, 2012, at 11:05 AM, Kenneth Russell wrote:
>
>>
>> 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".
>
> I looked and didn't find any tests for this. We should add tests that ensure that multiple calls with different params return the same context.

Why isn't getContext referentially transparent? If the same context
object must be returned, surely it is more intuitive to only return a
context if the attributes are compatible? If this constraint is
unfulfillable (say, because a previous context was generated with
differing parameters), shouldn't the result be a variant (null?) or
exception?

Already I have wasted too much of my life debugging getContext calls
that return contexts that do not have the attributes I asked for.

David

> -----
> ~Chris
> cmarrin@apple.com
>
>
>
>
>
> -----------------------------------------------------------
> 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
-----------------------------------------------------------