Commit 3ecdac45 authored by Kenneth Graunke's avatar Kenneth Graunke

Fix bogus assertions in builtin uniform test generator.

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.
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
parent 6ab75f7e
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment