From 5a085c623faebf957be3fae2f82dc89ef6214585 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 7 Aug 2010 20:44:02 +0800 Subject: draw: Replace vcache by vsplit. vcache decomposes primitives while vsplit splits primitives. Splitting is generally easier to do and is faster. More importantly, vcache depends on flatshade_first to decompose. The outputs may have incorrect vertex order which is significant to GS. --- src/gallium/auxiliary/draw/draw_pipe.c | 8 ++------ src/gallium/auxiliary/draw/draw_private.h | 1 - src/gallium/auxiliary/draw/draw_pt.c | 21 ++------------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c index 6a9e4d5e90..43c25167a9 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.c +++ b/src/gallium/auxiliary/draw/draw_pipe.c @@ -169,10 +169,6 @@ static void do_triangle( struct draw_context *draw, /* * Set up macros for draw_pt_decompose.h template code. * This code uses vertex indexes / elements. - * - * Flags are needed by the stipple and unfilled stages. When the two stages - * are active, vcache_run_extras is called and the flags are stored in the - * higher bits of i0. Otherwise, flags do not matter. */ #define TRIANGLE(flags,i0,i1,i2) \ @@ -180,7 +176,7 @@ static void do_triangle( struct draw_context *draw, assert(!((i1) & DRAW_PIPE_FLAG_MASK)); \ assert(!((i2) & DRAW_PIPE_FLAG_MASK)); \ do_triangle( draw, \ - i0, /* flags */ \ + flags, \ verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK), \ verts + stride * (i1), \ verts + stride * (i2) ); \ @@ -190,7 +186,7 @@ static void do_triangle( struct draw_context *draw, do { \ assert(!((i1) & DRAW_PIPE_FLAG_MASK)); \ do_line( draw, \ - i0, /* flags */ \ + flags, \ verts + stride * (i0 & ~DRAW_PIPE_FLAG_MASK), \ verts + stride * (i1) ); \ } while (0) diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index 18b632e3d9..94b688f891 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -140,7 +140,6 @@ struct draw_context } middle; struct { - struct draw_pt_front_end *vcache; struct draw_pt_front_end *vsplit; } front; diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index b6debbecf5..b80fc8f552 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -48,7 +48,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(draw_use_llvm, "DRAW_USE_LLVM", TRUE) #endif /* Overall we split things into: - * - frontend -- prepare fetch_elts, draw_elts - eg vcache + * - frontend -- prepare fetch_elts, draw_elts - eg vsplit * - middle -- fetch, shade, cliptest, viewport * - pipeline -- the prim pipeline: clipping, wide lines, etc * - backend -- the vbuf_render provided by the driver. @@ -106,15 +106,7 @@ draw_pt_arrays(struct draw_context *draw, middle = draw->pt.middle.general; } - - /* Pick the right frontend - */ - if (draw->pt.user.elts || (opt & PT_PIPELINE)) { - frontend = draw->pt.front.vcache; - } - else { - frontend = draw->pt.front.vsplit; - } + frontend = draw->pt.front.vsplit; frontend->prepare( frontend, prim, middle, opt ); @@ -131,10 +123,6 @@ boolean draw_pt_init( struct draw_context *draw ) draw->pt.test_fse = debug_get_option_draw_fse(); draw->pt.no_fse = debug_get_option_draw_no_fse(); - draw->pt.front.vcache = draw_pt_vcache( draw ); - if (!draw->pt.front.vcache) - return FALSE; - draw->pt.front.vsplit = draw_pt_vsplit(draw); if (!draw->pt.front.vsplit) return FALSE; @@ -182,11 +170,6 @@ void draw_pt_destroy( struct draw_context *draw ) draw->pt.middle.fetch_shade_emit = NULL; } - if (draw->pt.front.vcache) { - draw->pt.front.vcache->destroy( draw->pt.front.vcache ); - draw->pt.front.vcache = NULL; - } - if (draw->pt.front.vsplit) { draw->pt.front.vsplit->destroy( draw->pt.front.vsplit ); draw->pt.front.vsplit = NULL; -- cgit v1.2.3