[Piglit] [PATCH 0/4] Add simple GL_ARB_draw_instanced tests

Brian Paul brianp at vmware.com
Sat Apr 9 10:21:03 PDT 2011

On 04/08/2011 08:49 PM, Ian Romanick wrote:
> These are super basic tests, but they're better than what we had before
> (which was nothing).
> All of the tests except a couple of the negative tests pass on
> AMD's closed-source driver.  On their driver, both gl_InstanceIDARB and
> GL_ARB_draw_instanced (feature macro) are available without the #extension
> line.
> Many tests fail on NVIDIA's closed-source driver.  They don't make
> gl_InstanceIDARB available at link time with or without the #extension line.
> Oddly, it is available at compile time.
> I have not tried any of these tests on Mesa.  Some Tested-by feedback would be
> appreciated.
> It would also be good to have tests that:
>     - Verify that GL_INVALID_ENUM is generated by glDrawElementsInstancedARB if
>       <type>  is not one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT or
>       GL_UNSIGNED_INT.  This is listed in the "Errors" section of the spec.
>     - Verify that GL_INVALID_VALUE is generated by glDrawArraysInstancedARB if
>       <first>  is less than zero.  This is listed in the "Errors" section of the
>       spec.
>     - Verify that glMultiDrawArrays and glMultiDrawElements do not affect the
>       value of gl_InstanceIDARB.  This is issue #2 in the spec.
>     - Verify that GL_INVALID_OPERATION is generated if glDrawArraysInstanced or
>       glDrawElementsInstanced is compiled into a display list.  This is issue
>       #3 in the spec.
>     - Verify that no error is generated and nothing is drawn if primcount for
>       glDrawArraysInstanced or glDrawElementsInstanced is less than or equal to
>       zero.  The spec does not say that an error is generated, and the "It has
>       the same effect as" code in section 2.8 will not draw anything if
>       primcount is less than or equal to zero.
>     - Verify that gl_InstanceIDARB is zero in a non-instanced draw call that
>       follows an instanced draw call.
> I'd suggest stuffing all of those in tests/specs/arb_draw_instanced/api.

What about the existing instanced tests that I added a while back?

Here's the output of running the the new tests with softpipe/llvmpipe:

$ bin/shader_runner 
Failed to compile VS: 0:11(34): error: `gl_InstanceID' undeclared
0:11(15): error: cannot construct `float' from a non-numeric data type
0:11(10): error: cannot construct `vec4' from a non-numeric data type

PIGLIT: {'result': 'fail' }

$ bin/shader_runner 

Failed to compile VS: 0:8(26): error: cannot initialize uniforms in 
GLSL 1.10
0:6(34): error: array constructors forbidden in GLSL 1.10
0:8(26): error: initializer of uniform variable `instance_colors' must 
be a constant expression
0:14(42): error: unsized array index must be constant

PIGLIT: {'result': 'fail' }

$ bin/instanced_arrays -auto
PIGLIT: {'result': 'pass' }

$ bin/shader_runner 
tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.vert -auto
PIGLIT: {'result': 'pass' }

$ bin/shader_runner 
tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.vert -auto
PIGLIT: {'result': 'pass' }

$ bin/shader_runner 
tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.frag -auto
PIGLIT: {'result': 'pass' }

$ bin/shader_runner 
tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.frag -auto
PIGLIT: {'result': 'pass' }

Is that all of them?


More information about the Piglit mailing list