summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw/draw_vertex.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-11-21 15:40:20 -0700
committerBrian <[email protected]>2007-11-21 15:40:20 -0700
commitfbe68bf6b286056bb03f44907a078918d04cbdfd (patch)
tree40535ef7aab0350bce053e3f3b432f2c454461d6 /src/mesa/pipe/draw/draw_vertex.c
parent5a6017d496ccce94d7e3cf9a6cfe1db886dcc767 (diff)
Simplify draw module's vertex_info.
No longer store the vertex header and clip pos info in the draw module's vertex_info. The vertex_info just describes the data[] elements. This simplifies the code in several places.
Diffstat (limited to 'src/mesa/pipe/draw/draw_vertex.c')
-rw-r--r--src/mesa/pipe/draw/draw_vertex.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/mesa/pipe/draw/draw_vertex.c b/src/mesa/pipe/draw/draw_vertex.c
index dea26a3d0a1..983ed71ec0f 100644
--- a/src/mesa/pipe/draw/draw_vertex.c
+++ b/src/mesa/pipe/draw/draw_vertex.c
@@ -75,7 +75,6 @@ draw_compute_vertex_size(struct vertex_info *vinfo)
vinfo->size += 3;
break;
case FORMAT_4F:
- case FORMAT_4F_VIEWPORT:
vinfo->size += 4;
break;
default:
@@ -99,27 +98,26 @@ draw_set_vertex_attributes( struct draw_context *draw,
struct vertex_info *vinfo = &draw->vertex_info;
unsigned i;
-#if 0
- assert(slot_to_vf_attr[0] == TGSI_ATTRIB_POS);
-#endif
+ assert(interps[0] == INTERP_LINEAR); /* should be vert pos */
- memset(vinfo, 0, sizeof(*vinfo));
+ assert(nr_attrs <= PIPE_MAX_SHADER_OUTPUTS);
- /*
- * First three attribs are always the same: header, clip pos, winpos
+ /* Note that draw-module vertices will consist of the attributes passed
+ * to this function, plus a header/prefix containing the vertex header
+ * flags and GLfloat[4] clip pos.
*/
- emit_vertex_attr(vinfo, FORMAT_1F, INTERP_NONE);
- emit_vertex_attr(vinfo, FORMAT_4F, INTERP_LINEAR);
- emit_vertex_attr(vinfo, FORMAT_4F_VIEWPORT, INTERP_LINEAR);
- /*
- * Remaining attribs (color, texcoords, etc)
- */
- for (i = 1; i < nr_attrs; i++) {
+ memset(vinfo, 0, sizeof(*vinfo));
+
+ /* copy attrib info */
+ for (i = 0; i < nr_attrs; i++) {
emit_vertex_attr(vinfo, FORMAT_4F, interps[i]);
}
draw_compute_vertex_size(vinfo);
+
+ /* add extra words for vertex header (uint), clip pos (float[4]) */
+ vinfo->size += 5;
}