summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-26 18:37:34 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-26 18:37:34 +0100
commitd80c24a81a9a46c132fe877dde6919a57cacf8c0 (patch)
tree8056e077b7b03bd298a9876d6edc868b37e7db85 /src/gallium/auxiliary
parent529762d5df6d9427f9fa0927e38b9886e412a6bc (diff)
draw: defensively reset render primitive, which can get clobbered by clipping
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index e21af3d287..01396a749e 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);