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



On Sun, Apr 15, 2012 at 11:29 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>
> Can the objects passed in to these functions ever be gotten back from the
> WebGLContext?  All the functions returning "any" seem to say that a new
> object is returned on each call for the cases when returning arrays.  Are
> there other cases that return an IDL array object?
>
> Alternately, are mutations to the array object that's passed in supposed to
> affect behavior after the call?
>
> If neither of the above is true, then making these sequences seems like it
> would make more sense.

Early drafts of the WebGL spec used sequences for these arguments.
When arrays were added to Web IDL, they were changed to arrays, to
potentially support more efficient calls from JavaScript to C++.
However, these entry points never mutate the incoming array.

If they were changed to sequence<T>, then could a browser still pass
them throughout its DOM bindings by reference, as long as it promises
to not mutate the object? If so, that could work.

-Ken

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