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

[Public WebGL] Explicit unboxing for object identifiers



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