[Piglit] [PATCH] gen_builtin_uniform_tests.py: Draw small rectangles per test, and probe them.

Eric Anholt eric at anholt.net
Fri Apr 10 13:39:21 PDT 2015


Kenneth Graunke <kenneth at whitecape.org> writes:

> On Friday, April 10, 2015 12:19:23 AM Eric Anholt wrote:
>> @@ -367,17 +378,21 @@ class ShaderTest(object):
>>      def glsl_version(self):
>>          return self._signature.version_introduced
>>  
>> -    def draw_command(self):
>> -        return 'draw rect -1 -1 2 2\n'
>> +    def draw_command(self, test_num):
>> +        x = (test_num % self.tests_per_row) * self.rect_width
>> +        y = (test_num // self.tests_per_row) * self.rect_height
>> +        assert(y < self.test_rows)
>> +        return 'draw rect ortho {0} {1} {2} {3}\n'.format(x, y,
>> +                                                          self.rect_width,
>> +                                                          self.rect_height)
>>  
>>      def probe_command(self, test_num, probe_vector):
>> -        # Note: shader_runner uses a 250x250 window so we must
>> -        # ensure that test_num <= 250.
>> -        return 'probe rgb {0} 0 {1} {2} {3} {4}\n'.format(test_num % 250,
>> -                                                          probe_vector[0],
>> -                                                          probe_vector[1],
>> -                                                          probe_vector[2],
>> -                                                          probe_vector[3])
>> +        return 'probe rect rgba ({0}, {1}, {2}, {3}) ({4}, {5}, {6}, {7})\n'.format(
>> +            (test_num % self.tests_per_row) * self.rect_width,
>> +            (test_num // self.tests_per_row) * self.rect_height,
>> +            self.rect_width,
>> +            self.rect_height,
>> +            probe_vector[0], probe_vector[1], probe_vector[2], probe_vector[3])
>
> FWIW, it looks like this needs your patch from August to work -
> "shader_runner: Add a non-relative, rgba variant of relative probe rect rgb."
>
> I just sent comments and an R-b for that, in case you still need one.
>
> This patch is also:
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
>
> Sorry for taking over 7 months to look at this, especially when you
> explicitly asked me to.  Thanks for Cc'ing me again.

In fairness, you were the one that caught that my small window sizes
broke on some window managers, which made me fix the series yesterday.

Thanks for taking a look!  I've rewritten the comment with a bit more
context, and I'm ready to push.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150410/2f29f52b/attachment.sig>


More information about the Piglit mailing list