[Piglit] [PATCH 0/4] Add simple GL_ARB_draw_instanced tests
Ian Romanick
idr at freedesktop.org
Fri Apr 8 19:49:28 PDT 2011
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.
tests/all.tests | 12 ++++++
tests/shaders/shader_runner.c | 39 ++++++++++++++++++
.../compiler/instanceidarb-disabled.frag | 25 ++++++++++++
.../compiler/instanceidarb-disabled.vert | 25 ++++++++++++
.../compiler/instanceidarb-enabled.frag | 24 +++++++++++
.../compiler/instanceidarb-enabled.vert | 24 +++++++++++
.../execution/draw-non-instanced.shader_test | 41 +++++++++++++++++++
.../instance-array-dereference.shader_test | 42 ++++++++++++++++++++
.../preprocessor/feature-macro-disabled.frag | 12 ++++++
.../preprocessor/feature-macro-disabled.vert | 12 ++++++
.../preprocessor/feature-macro-enabled.frag | 15 +++++++
.../preprocessor/feature-macro-enabled.vert | 15 +++++++
12 files changed, 286 insertions(+), 0 deletions(-)
More information about the Piglit
mailing list