[Piglit] [PATCH v2] piglit-dispatch: patch glDraw{Arrays, Elements}InstancedARB dispatch to accept ARB_instanced_arrays.

jfonseca at vmware.com jfonseca at vmware.com
Fri Oct 12 00:54:17 PDT 2012


From: José Fonseca <jfonseca at vmware.com>

ARB_instanced_arrays specification says:

    Dependencies on ARB_draw_instanced

        If neither ARB_draw_instanced nor EXT_draw_instanced is
        supported, all references to instanceID should be removed from
        section 2.8.

        If ARB_draw_instanced is not supported, all references to
        gl_InstanceIDARB should be removed from section 2.8.  This
        extension will introduce the following additional New Procedures
        and Functions:

            void DrawArraysInstancedARB(enum mode, int first, sizei count,
                    sizei primcount);
            void DrawElementsInstancedARB(enum mode, sizei count, enum type,
                    const void *indices, sizei primcount);

This is a quick hack until glapi.json can allow a function to have
multiple categories.
---
 tests/util/gen_dispatch.py |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/util/gen_dispatch.py b/tests/util/gen_dispatch.py
index 96a7f77..46e96fd 100644
--- a/tests/util/gen_dispatch.py
+++ b/tests/util/gen_dispatch.py
@@ -474,6 +474,14 @@ def generate_resolve_function(ds):
 
 	condition_code_pairs.append((condition, code))
 
+    # XXX: glDraw{Arrays,Elements}InstancedARB are exposed by
+    # ARB_instanced_arrays in addition to ARB_draw_instanced, but neither
+    # gl.spec nor gl.json can accomodate an extension with two categories, so
+    # insert these cases here.
+	if f.gl_name in ('glDrawArraysInstancedARB', 'glDrawElementsInstancedARB'):
+	    condition = 'check_extension("GL_ARB_instanced_arrays")'
+	    condition_code_pairs.append((condition, code))
+
     # Finally, if none of the previous conditions were satisfied, then
     # the given dispatch set is not supported by the implementation,
     # so we want to call the unsupported() function.
-- 
1.7.9.5



More information about the Piglit mailing list