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

Re: [Public WebGL] Should the non-typed-array overloads of uniform*v and vertextAttrib*v be IDL arrays or IDL sequences?





----- Original Message -----
> 
> Can the objects passed in to these functions ever be gotten back from
> the WebGLContext?

The values passed by uniform*() can be queried by getUniform(). But that's just querying values stored internally by the OpenGL implementations, it's not a value that WebGL implementations cache.

Similarly, the values passed by vertexAttrib*() can be queried by getVertexAttrib(). Again, the value is not cached by the WebGL implementation, so the WebGL implementation gets it back from the GL.

We don't try hard to make these getters fast.

> All the functions returning "any" seem to say that
> a
> new object is returned on each call for the cases when returning
> arrays.

These functions too will return a new object each time, since the array is not stored by the WebGL implementation. If that's not specified in the spec, it should be.

>   Are there other cases that return an IDL array object?

getParameter can, though it's typed arrays (it's plain arrays in current Mozilla implementation, but that's a bug).

> 
> Alternately, are mutations to the array object that's passed in
> supposed
> to affect behavior after the call?

No. The WebGL implementation must do what's needed to ensure that doesn't happen. Fortunately, in most cases that problem is taken care of at the level of the underlying OpenGL implementation. For example, glTexImage2D immediately makes a copy of the texture data passed to it.

> 
> If neither of the above is true, then making these sequences seems
> like
> it would make more sense.

Not commenting on this, not competent myself.
Benoit


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