[Piglit] [PATCH] arb_texture_barrier: count of elements need to be multiple of three

Alejandro PiƱeiro apinheiro at igalia.com
Fri Jul 8 19:15:20 UTC 2016


glDrawRangeElements is used to draw triangles so the count of elements
needs to be a multiple of three, so we need to be careful when
dividing by the number of draw calls specified for the test.

Fixes the 40 failing subtests on i965. Now all the 144 tests are passing.
---

For Andres:
This is the correct version of this line you reviewed on v3:
 > +{
 > +        unsigned int basic_count = (total_indices * 3)/(3 * draw_passes);

 3/3 == 1

That I just dropped for v4.


 tests/spec/arb_texture_barrier/blending-in-shader-arb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_texture_barrier/blending-in-shader-arb.c b/tests/spec/arb_texture_barrier/blending-in-shader-arb.c
index 24697bc..e438f56 100644
--- a/tests/spec/arb_texture_barrier/blending-in-shader-arb.c
+++ b/tests/spec/arb_texture_barrier/blending-in-shader-arb.c
@@ -328,7 +328,9 @@ clean_resources()
 static GLvoid
 draw_rect_tex()
 {
-        unsigned int basic_count = total_indices / draw_passes;
+        /* This multiply and divide by three is a trick to ensure that
+         * basic_count is a multiple of three */
+        unsigned int basic_count = 3 * (total_indices / (3 * draw_passes));
         unsigned int first = 0;
 
         while (first < total_indices) {
-- 
2.7.4



More information about the Piglit mailing list