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

Ian Romanick idr at freedesktop.org
Sat Apr 9 19:24:53 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/09/2011 10:21 AM, Brian Paul wrote:
> 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?

Where are those?  I must have overlooked them...

> Here's the output of running the the new tests with softpipe/llvmpipe:
> 
> $ bin/shader_runner
> tests/spec/arb_draw_instanced/execution/draw-non-instanced.shader_test
> 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

Oh damn.  I sent the wrong patch set out.  I somehow sent the ones that
were modified to work on NVIDIA's drivers.  They don't have
gl_InstanceIDARB, so the tests were modified to use gl_InstanceID which
doesn't work on Mesa.

> PIGLIT: {'result': 'fail' }
> 
> $ bin/shader_runner
> tests/spec/arb_draw_instanced/execution/instance-array-dereference.shader_test
> 
> 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

This test has the same problem as the previous, and it should also have
#version 120 because of the uniform initializer.  How lovely that
neither NVIDIA nor AMD rejected that.  Sigh...

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

Yes.

I'll spin a new patch series on Monday.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2hFPUACgkQX1gOwKyEAw94ggCgoHLm81LPiuuuE1ii2uVAMgLV
XtsAn3rt4D/aOJLESsyt9P8VwAKmcn6+
=oel+
-----END PGP SIGNATURE-----


More information about the Piglit mailing list