summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2007-11-07 13:07:20 +0000
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2007-11-07 13:41:09 +0000
commit3e22180fc893bb09bf6b990bc4e858fd85f522ab (patch)
tree0583012286b0078106ddc0579552a81e0a5206cf /src/mesa/pipe/draw
parentc28fdf309607ec2994ef9a1109931a8389854300 (diff)
Reset temporary vertices ids.
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r--src/mesa/pipe/draw/draw_context.c27
-rw-r--r--src/mesa/pipe/draw/draw_private.h10
2 files changed, 37 insertions, 0 deletions
diff --git a/src/mesa/pipe/draw/draw_context.c b/src/mesa/pipe/draw/draw_context.c
index 80317dd6cf..0de8bed529 100644
--- a/src/mesa/pipe/draw/draw_context.c
+++ b/src/mesa/pipe/draw/draw_context.c
@@ -243,6 +243,18 @@ void draw_alloc_tmps( struct draw_stage *stage, unsigned nr )
}
}
+/**
+ * Reset the verticies ids of this and subsequent stages.
+ */
+void draw_reset_tmps( struct draw_stage *stage )
+{
+ unsigned i;
+
+ if (stage->tmp)
+ for (i = 0; i < stage->nr_tmps; i++)
+ stage->tmp[i]->vertex_id = UNDEFINED_VERTEX_ID;
+}
+
void draw_free_tmps( struct draw_stage *stage )
{
if (stage->tmp) {
@@ -251,9 +263,24 @@ void draw_free_tmps( struct draw_stage *stage )
}
}
+
boolean draw_use_sse(struct draw_context *draw)
{
return (boolean) draw->use_sse;
}
+void draw_reset_vertex_ids(struct draw_context *draw)
+{
+ struct draw_stage *stage = draw->pipeline.first;
+
+ while (stage) {
+ if (stage->reset_tmps)
+ stage->reset_tmps(stage);
+ else
+ draw_reset_tmps(stage);
+ stage = stage->next;
+ }
+
+ draw_vertex_cache_reset_vertex_ids(draw);
+}
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h
index bdc3a6b9e7..dc4057bff3 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/mesa/pipe/draw/draw_private.h
@@ -116,6 +116,13 @@ struct draw_stage
void (*end)( struct draw_stage * );
+ /**
+ * Reset temporary vertices ids in this stage
+ *
+ * draw_free_tmps will be called instead if null.
+ */
+ void (*reset_tmps)( struct draw_stage * );
+
void (*reset_stipple_counter)( struct draw_stage * );
};
@@ -254,8 +261,11 @@ extern struct draw_stage *draw_validate_stage( struct draw_context *context );
extern void draw_free_tmps( struct draw_stage *stage );
+extern void draw_reset_tmps( struct draw_stage *stage );
extern void draw_alloc_tmps( struct draw_stage *stage, unsigned nr );
+extern void draw_reset_vertex_ids( struct draw_context *draw );
+
extern int draw_vertex_cache_check_space( struct draw_context *draw,
unsigned nr_verts );