From b6d3a435a0e0e53a9e8cc4c4249dc7c2f897a83d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 24 Jan 2011 02:11:59 +0100 Subject: draw: Only run prepare when state, prim and opt changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In bad applications like ipers which does a lot of draw calls with no state changes this helps to greatly reduce time spent in prepare. In ipers around 7% of CPU was spent in various prepare functions, after this commit no prepare function show on the profile. This commit also has the added benefit of now grouping all pipelined drawing into a single draw call if the driver uses vbuf_render. Reviewed-by: Stéphane Marchesin Tested-by: Stéphane Marchesin --- src/gallium/auxiliary/draw/draw_private.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gallium/auxiliary/draw/draw_private.h') diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index 1a0286de891..c3eca973e92 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -63,6 +63,7 @@ struct draw_stage; struct vbuf_render; struct tgsi_exec_machine; struct tgsi_sampler; +struct draw_pt_front_end; /** @@ -137,6 +138,12 @@ struct draw_context /* Support prototype passthrough path: */ struct { + /* Current active frontend */ + struct draw_pt_front_end *frontend; + unsigned prim; + unsigned opt; + unsigned eltSize; /* saved eltSize for flushing */ + struct { struct draw_pt_middle_end *fetch_emit; struct draw_pt_middle_end *fetch_shade_emit; @@ -391,6 +398,7 @@ void draw_remove_extra_vertex_attribs(struct draw_context *draw); boolean draw_pt_init( struct draw_context *draw ); void draw_pt_destroy( struct draw_context *draw ); void draw_pt_reset_vertex_ids( struct draw_context *draw ); +void draw_pt_flush( struct draw_context *draw, unsigned flags ); /******************************************************************************* -- cgit v1.2.3