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

Re: [Public WebGL] Explicit unboxing for object identifiers



In Firefox <= 10, equal uniform locations give the same WebGLUniformLocation object, so the location1 === location2 test just works.

We just changed this for Firefox 11 as (per a mailing list discussion) there was agreement that this wasn't needed, and so the extra code in Gecko needed to make that work was seen as unneeded complexity.

What is you use case for comparing uniform locations? Why can't you implement it on your side, maybe with a shim/wrapper around webgl.getUniformLocation?

Cheers,
Benoit

----- Original Message -----
> 
> First, let me be clear that I'm not trying to re-open the old
> argument
> over whether uniform locations and other object identifiers should be
> boxed or unboxed. I'm pretty happy with hiding the object handles in
> general.
> 
> I was, however, wondering if it would be tolerable to add to the
> WebGLUniformLocation interface (and other similar interfaces) an
> explicit `toValue` / `toHandle` unbox operation that could return the
> integer handle from OpenGL ES.
> 
> At the moment I don't think the spec actually denotes whether two
> WebGLUniformLocation objects could be compared. For example, when you
> get two uniform locations for the same uniform name, does the
> implementation return a reference to the same object? If it did, one
> could test for location1 === location2
> 
> Furthermore, in glQuery I would like to use uniform locations as keys
> in a simple javascript object so it would be ideal for me if I could
> write code like:
> 
>     var locations = {};
>     locations[uniformLocation.handle] = data;
>     // possibly, locations[uniformLocation.toHandle()] = data;
> 
> Alternatively, if one could instead get the string identifier (name)
> for a uniformLocation this would work as well. Either way, it would
> not make a difference to me if it were a fast operation, however
> getting the uniform name would likely be an expensive query compared
> to getting the integer handle which is essentially just unboxing a
> WebGLUniformLocation (or similar interface).
> 
> Regards,
> Rehno
> 
> -----------------------------------------------------------
> 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
-----------------------------------------------------------