[Piglit] [PATCH 1/2] Fix bogus assertions in builtin uniform test generator.
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Wed May 16 10:52:07 UTC 2018
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
On 10/05/18 00:12, Kenneth Graunke wrote:
> self.test_rows is measured in a number of 4x4 rectangles, but y is
> measured in pixels, so they are not comparable. The only reason this
> doesn't trip is because self.test_rows is currently the number of 4x4
> rectangles that can fit in a 250x250 window (62)...and no test has
> nearly that many rows of rectangles.
>
> Instead, just assert y fits in the window height.
> ---
> generated_tests/gen_builtin_uniform_tests.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py
> index 50cced444..ac09a64fc 100644
> --- a/generated_tests/gen_builtin_uniform_tests.py
> +++ b/generated_tests/gen_builtin_uniform_tests.py
> @@ -386,7 +386,7 @@ class ShaderTest(object):
> 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)
> + assert(y + self.rect_height <= self.win_height)
> return 'draw rect ortho {0} {1} {2} {3}\n'.format(x, y,
> self.rect_width,
> self.rect_height)
> @@ -662,7 +662,7 @@ class TessellationShaderTest(ShaderTest):
> 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)
> + assert(y + self.rect_height <= self.win_height)
> return 'draw rect ortho patch {0} {1} {2} {3}\n'.format(x, y,
> self.rect_width,
> self.rect_height)
More information about the Piglit
mailing list