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

Re: [Public WebGL] Error codes in drawArrays / drawElements



On Thu, Jun 3, 2010 at 1:17 PM, Benoit Jacob <bjacob@mozilla.com> wrote:
>
> ----- "Kenneth Russell" <kbr@google.com> wrote:
>
>> On Wed, Jun 2, 2010 at 3:22 PM, Benoit Jacob <bjacob@mozilla.com>
>> wrote:
>> > Hi,
>> >
>> > These Khronos tests suggests that in certain circumstances drawArray
>> / drawElements give INVALID_OPERATION, as opposed to INVALID_VALUE:
>> >
>> >
>> https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/fast/draw-arrays-out-of-bounds.html
>> >
>> https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/fast/draw-elements-out-of-bounds.html
>> >
>> > But neither the WebGL spec, nor the OpenGL ES documentation, say
>> that these functions can give INVALID_OPERATION.
>>
>> Section 4.1 of the WebGL indicates, but does not currently specify,
>> this behavior.
>>
>> We agreed at the F2F that generating an INVALID_OPERATION error will
>> be the specified behavior. The spec still needs to catch up but the
>> tests verify the intended behavior.
>
> Thanks for the answer, I now have a more specific question:
>
> From the draw-elements-out-of-bounds test:
>
> shouldGenerateGLError(context, context.INVALID_VALUE,
>  "context.drawArrays(context.TRIANGLES, 0, -1)");
> shouldGenerateGLError(context, context.INVALID_OPERATION,
>  "context.drawArrays(context.TRIANGLES, 1, 0)");
> shouldGenerateGLError(context, context.INVALID_VALUE,
>  "context.drawArrays(context.TRIANGLES, -1, 0)");
> shouldGenerateGLError(context, context.INVALID_OPERATION,
>  "context.drawArrays(context.TRIANGLES, 1, -1)");
> shouldGenerateGLError(context, context.INVALID_OPERATION,
>  "context.drawArrays(context.TRIANGLES, -1, 1)");
>
> Could you please explain me the logic here, choosing between VALUE and OPERATION?
>
> Benoit
>

I think with negative first/count, it should generate INVALID_VALUE.

INVALID_OPERATION is for out-of-boundary errors.

For the situation where count==0 and first is out of boundary, I am
not sure if an error should be generated.

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