[Piglit] [PATCH 1/9] all.py: Use MSAA_SAMPLE_COUNTS instead of open coding

Ian Romanick idr at freedesktop.org
Fri Nov 20 15:08:33 PST 2015


On 11/20/2015 02:10 PM, Dylan Baker wrote:
> On Thu, Nov 19, 2015 at 08:00:07PM -0800, Ian Romanick wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> ---
>>  tests/all.py | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index 8dd7487..578bcae 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -1428,13 +1428,13 @@ for stage in ['vs', 'gs', 'fs']:
>>  
>>      for type in ('i', 'u', ''):
>>          for sampler in ('sampler2DMS', 'sampler2DMSArray'):
>> -            for samples in ('2', '4', '8'):
>> +            for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
>>                  stype = '{}{}'.format(type, sampler)
>>                  profile.test_list[grouptools.join(
>>                      'spec', 'arb_shader_texture_image_samples',
>> -                    'textureSamples', '{}-{}-{}'.format(stage, stype, samples))
>> +                    'textureSamples', '{}-{}-{}'.format(stage, stype, sample_count))
>>                  ] = PiglitGLTest([
>> -                    'textureSamples', stage, stype, samples])
>> +                    'textureSamples', stage, stype, sample_count])
> 
> In cases where an int() or float() are passed into str.format() the
> explicit conversion to str() isn't strictly needed, format does that for
> you. All the same I don't think the explicitness is bad either

I mostly used the explicit str() here so that I wouldn't have to add it
in the next patch. :)

>>  with profile.group_manager(
>>          PiglitGLTest,
>> @@ -1736,9 +1736,8 @@ with profile.group_manager(
>>      g(['texelFetch', 'fs', 'sampler2DMSArray', '4', '98x129x1-98x129x9'])
>>      g(['arb_texture_multisample-texstate'])
>>      g(['arb_texture_multisample-errors'])
>> -    g(['arb_texture_multisample-texelfetch', '2'])
>> -    g(['arb_texture_multisample-texelfetch', '4'])
>> -    g(['arb_texture_multisample-texelfetch', '8'])
>> +    for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
>> +        g(['arb_texture_multisample-texelfetch', sample_count])
>>      g(['arb_texture_multisample-sample-mask'])
>>      g(['arb_texture_multisample-sample-mask-value'])
>>      g(['arb_texture_multisample-sample-mask-execution'])
>> @@ -2201,7 +2200,7 @@ with profile.group_manager(
>>            'ignore-centroid-qualifier {}'.format(num_samples),
>>            run_concurrent=False)
>>  
>> -    for num_samples in [0, 2, 4, 6, 8]:
>> +    for num_samples in (0,) + MSAA_SAMPLE_COUNTS:
> 
> I don't really care which way, but this is how you'd write it in the
> same style as you're using elsewhere:
> 
> for num_samples in (str(x) for x in ((0,) + MSAA_SAMPLE_COUNTS)):

Ah!  I tried about four different, failing variations while I was doing
this patch and the next one.  I'll probably submit a follow-up that
changes the (0,) + MSAA_SAMPLE_COUNTS uses to the other idiom.

>>          g(['arb_sample_shading-builtin-gl-sample-mask-simple',
>>             str(num_samples)],
>>            'builtin-gl-sample-mask-simple {}'.format(num_samples))
>> -- 
>> 2.1.0
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
> 
> Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20151120/b69f25a5/attachment.sig>


More information about the Piglit mailing list