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

Andres Gomez agomez at igalia.com
Sat Jul 9 08:40:30 UTC 2016


Makes sense.

Reviewed-by: Andres Gomez <agomez at igalia.com>

On Fri, 2016-07-08 at 21:15 +0200, Alejandro PiƱeiro wrote:
> 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) {
-- 

Br,

Andres


More information about the Piglit mailing list