[Mesa-dev] [PATCH] indices: fix provoking vertex for quads/quadstrips

Ilia Mirkin imirkin at alum.mit.edu
Mon Apr 6 23:20:32 PDT 2015


On Tue, Apr 7, 2015 at 1:44 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>
> Pushing this through a complete piglit run, but it seems to fix
>
>   bin/arb-provoking-vertex-render
>
> on a3xx. Please take special care to double-check that I didn't mess
> up cw/ccw order or something. I'm especially weak on the quadstrip
> case.
>
>  src/gallium/auxiliary/indices/u_indices_gen.py | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py
> index 687a717..b17d132 100644
> --- a/src/gallium/auxiliary/indices/u_indices_gen.py
> +++ b/src/gallium/auxiliary/indices/u_indices_gen.py
> @@ -142,8 +142,12 @@ def do_tri( intype, outtype, ptr, v0, v1, v2, inpv, outpv ):
>              tri( intype, outtype, ptr, v2, v0, v1 )
>
>  def do_quad( intype, outtype, ptr, v0, v1, v2, v3, inpv, outpv ):
> -    do_tri( intype, outtype, ptr+'+0',  v0, v1, v3, inpv, outpv );
> -    do_tri( intype, outtype, ptr+'+3',  v1, v2, v3, inpv, outpv );
> +    if inpv == LAST:
> +        do_tri( intype, outtype, ptr+'+0',  v0, v1, v3, inpv, outpv );
> +        do_tri( intype, outtype, ptr+'+3',  v1, v2, v3, inpv, outpv );
> +    else:
> +        do_tri( intype, outtype, ptr+'+0',  v0, v1, v3, inpv, outpv );
> +        do_tri( intype, outtype, ptr+'+3',  v0, v3, v2, inpv, outpv );

Erm, make that v0, v1, v2; v0, v2, v3. Oops :)

>
>  def name(intype, outtype, inpv, outpv, pr, prim):
>      if intype == GENERATE:
> @@ -331,7 +335,10 @@ def quadstrip(intype, outtype, inpv, outpv, pr):
>          print '         i += 4;'
>          print '         goto restart;'
>          print '      }'
> -    do_quad( intype, outtype, 'out+j', 'i+2', 'i+0', 'i+1', 'i+3', inpv, outpv );
> +    if inpv == LAST:
> +        do_quad( intype, outtype, 'out+j', 'i+2', 'i+0', 'i+1', 'i+3', inpv, outpv );
> +    else:
> +        do_quad( intype, outtype, 'out+j', 'i+0', 'i+1', 'i+3', 'i+2', inpv, outpv );
>      print '   }'
>      postamble()
>
> --
> 2.0.5
>


More information about the mesa-dev mailing list