summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_vertex.h
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-30 16:49:24 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-30 16:49:24 -0600
commit898d68a3762f84f0d435cda2f6aafddd356d1788 (patch)
tree50da7df858f9c160fe6bcd33b617975315a07eda /src/mesa/pipe/draw/draw_vertex.h
parent963b8a74493a474560447080b23407bfe4c707c5 (diff)
Consolidate vertex-related code in new draw_vertex.c
A few functions which were basically duplicated between softpipe and the i915 driver are now re-used: draw_emit_vertex_attr() draw_compute_vertex_size()
Diffstat (limited to 'src/mesa/pipe/draw/draw_vertex.h')
-rw-r--r--src/mesa/pipe/draw/draw_vertex.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/pipe/draw/draw_vertex.h b/src/mesa/pipe/draw/draw_vertex.h
index 6778df30d1..f696475510 100644
--- a/src/mesa/pipe/draw/draw_vertex.h
+++ b/src/mesa/pipe/draw/draw_vertex.h
@@ -70,6 +70,25 @@ struct vertex_info
+/**
+ * Add another attribute to the given vertex_info object.
+ * \return slot in which the attribute was added
+ */
+static INLINE uint
+draw_emit_vertex_attr(struct vertex_info *vinfo, uint vfAttr, uint format,
+ uint interp)
+{
+ const uint n = vinfo->num_attribs;
+ vinfo->attr_mask |= (1 << vfAttr);
+ vinfo->slot_to_attrib[n] = vfAttr;
+ vinfo->format[n] = format;
+ vinfo->interp_mode[n] = interp;
+ vinfo->num_attribs++;
+ return n;
+}
+
+
+
struct draw_context;
extern int draw_vertex_cache_check_space( struct draw_context *draw,