[Piglit] [PATCH v2] piglit-dispatch: patch glDraw{Arrays, Elements}InstancedARB dispatch to accept ARB_instanced_arrays.
Brian Paul
brianp at vmware.com
Fri Oct 12 08:20:03 PDT 2012
On 10/12/2012 01:54 AM, jfonseca at vmware.com wrote:
> 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.
I'm not too familiar with this code but this looks OK to me.
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the Piglit
mailing list