Browse Source

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.
tags/mesa-7.9-rc1
Chia-I Wu 15 years ago
parent
commit
5a085c623f

+ 2
- 6
src/gallium/auxiliary/draw/draw_pipe.c View File

@@ -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)

+ 0
- 1
src/gallium/auxiliary/draw/draw_private.h View File

@@ -140,7 +140,6 @@ struct draw_context
} middle;

struct {
struct draw_pt_front_end *vcache;
struct draw_pt_front_end *vsplit;
} front;


+ 2
- 19
src/gallium/auxiliary/draw/draw_pt.c View File

@@ -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;

Loading…
Cancel
Save