From: Keith Whitwell Date: Mon, 26 May 2008 17:37:34 +0000 (+0100) Subject: draw: defensively reset render primitive, which can get clobbered by clipping X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d80c24a81a9a46c132fe877dde6919a57cacf8c0;p=mesa.git draw: defensively reset render primitive, which can get clobbered by clipping --- diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index e21af3d2877..01396a749ee 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -40,6 +40,7 @@ struct pt_emit { struct translate *translate; struct translate_cache *cache; + unsigned prim; }; void draw_pt_emit_prepare( struct pt_emit *emit, @@ -51,8 +52,14 @@ void draw_pt_emit_prepare( struct pt_emit *emit, struct translate_key hw_key; unsigned i; boolean ok; + - ok = draw->render->set_primitive(draw->render, prim); + /* XXX: may need to defensively reset this later on as clipping can + * clobber this state in the render backend. + */ + emit->prim = prim; + + ok = draw->render->set_primitive(draw->render, emit->prim); if (!ok) { assert(0); return; @@ -145,6 +152,14 @@ void draw_pt_emit( struct pt_emit *emit, */ draw_do_flush( draw, DRAW_FLUSH_BACKEND ); + /* XXX: and work out some way to coordinate the render primitive + * between vbuf.c and here... + */ + if (!draw->render->set_primitive(draw->render, emit->prim)) { + assert(0); + return; + } + hw_verts = render->allocate_vertices(render, (ushort)translate->key.output_stride, (ushort)vertex_count);