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

Paul Berry stereotype441 at gmail.com
Fri Oct 12 14:52:10 PDT 2012


On 12 October 2012 08:20, Brian Paul <brianp at vmware.com> wrote:

> 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>
>
>
Yeah, looks reasonable to me too.

Chad and I have recently been talking about a long term plan to import the
piglit-dispatch code to Waffle so that it can be useful to other projects.
When I get around to that I'll be sure to put in a more general mechanism
to solve this problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121012/bfac042c/attachment-0001.html>


More information about the Piglit mailing list