Re: [Public WebGL] Re: WebGL IDL for uniform1fv is not valid WebIDL

On 4/2/12 8:42 PM, Glenn Maynard wrote:
> On Mon, Apr 2, 2012 at 7:26 PM, Boris Zbarsky <bzbarsky@mit.edu
> <mailto:bzbarsky@mit.edu>> wrote:
>
>         I think removing the Float32Array overload will make passing JS
>         Arrays
>         of Numbers and Float32Array objects work.
>
>
>     But require copies in the process, no?  That seems highly
>     undesirable in this case.
>
>
> If it matters as an optimization, implementations could still create
> separate overloads for this as long as it's transparent to the user,
> right?

There are tons of edge cases here, and more being added by the JS folks 
all the time, so doing anything other than exactly what the spec says is 
a good way of introducing bugs...

As an example, if the spec says to get the elements from the input thing 
one by one in order to construct the IDL array, then grabbing a float* 
from an input typed array would have observably different behavior in 
situations where the page has defined a property getter for an indexed 
property on the typed array object in question.  Unless the WebIDL 
indexed access takes priority over user-defined properties, which I 
think it might for the moment.  I'd really rather not have the 
performance characteristics of the platform depending on such fragile 
interactions if we can avoid it.  :(

-Boris

Received on Tuesday, 3 April 2012 15:18:58 UTC