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

Re: [Public WebGL] questions about vertexAttribPointer / getVertexAttrib offsets



A few points:

The reason vertexAttribOffset accepts a signed value at all is that
when converting the signature from C to JavaScript, the desire was to
use a preexisting typedef from gl2.h which was closest to the desired
semantics. GLintptr_t (which is signed) was chosen, and extended to 64
bits via the choice of IDL type "long long".

There is however no use case for negative offsets. The spec for
vertexAttribPointer has been updated to indicate that it generates an
INVALID_VALUE error if the offset is negative.

The constant VERTEX_ATTRIB_ARRAY_POINTER is used; it has to be passed
to getVertexAttribOffset, mirroring the behavior of
glGetVertexAttribPointerv (it's currently the only enum accepted).

-Ken


On Mon, Apr 23, 2012 at 6:12 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>
> On 4/23/12 7:32 PM, Gregg Tavares (勤) wrote:
>>
>> Update this test to use -4. I think that makes it check for negative
>> offsets instead of the offset not being the correct size of the type.
>
>
> Yes.
>
> Now Chrome passes this test, while my Firefox build with the check for
> negative offset removed fails.
>
> Chrome still doesn't generate an error when the offset is -8000000000,
> though.
>
>
> -Boris
>
> -----------------------------------------------------------
> 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
-----------------------------------------------------------