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

Re: [Public WebGL] Purpose of WebGLObjectArray ?



On Jun 3, 2010, at 11:47 PM, Cedric Vivier wrote:

> On Fri, Jun 4, 2010 at 08:45, Chris Marrin <cmarrin@apple.com> wrote:
>> It's true, this was done before we felt we could use sequence<>. In fact I thought we had decided to get rid of it a while back in favor of sequence<WebGLShader>.
> 
> Great.
> 
> After reading WebIDL spec I've understood that T[ ] is passed
> by-reference and sequence<T> is passed by-value, which sounds possibly
> less efficient and farther in principle than the C signature, any
> reason to prefer sequence instead of array ?
> 
> Also is untyped "sequence" valid (and intended) for all uniform*v and
> vertexAttrib*v signatures ?
> I guess they should be "sequence<GLfloat>" or sequence<GLint>".
> 
> (here also, passing by-value may generate unwanted copies on some bindings ?)

I'm not sure how WebGL deals with return values. The semantics needs to be that a new array is created, filled and returned. Perhaps that requires the use of sequence? Seems like whether this is literally returned by value or by a reference to a newly created object is a detail of the language binding. But I don't have any preference for one syntax over the other.

-----
~Chris
cmarrin@apple.com




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