summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_vbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/draw/draw_vbuf.c')
-rw-r--r--src/mesa/pipe/draw/draw_vbuf.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/mesa/pipe/draw/draw_vbuf.c b/src/mesa/pipe/draw/draw_vbuf.c
index c179b5e9dd..82051d2e65 100644
--- a/src/mesa/pipe/draw/draw_vbuf.c
+++ b/src/mesa/pipe/draw/draw_vbuf.c
@@ -141,42 +141,43 @@ emit_vertex( struct vbuf_stage *vbuf,
for (i = 0; i < vinfo->num_attribs; i++) {
uint j = vinfo->src_index[i];
- switch (vinfo->format[i]) {
- case FORMAT_OMIT:
+ switch (vinfo->emit[i]) {
+ case EMIT_OMIT:
/* no-op */
break;
- case FORMAT_HEADER:
- memcpy(vbuf->vertex_ptr, vertex, sizeof(*vertex));
- vbuf->vertex_ptr += sizeof(*vertex) / 4;
- count += sizeof(*vertex) / 4;
- break;
- case FORMAT_1F:
+ case EMIT_ALL:
+ /* just copy the whole vertex as-is to the vbuf */
+ assert(i == 0);
+ memcpy(vbuf->vertex_ptr, vertex, vinfo->size * 4);
+ vbuf->vertex_ptr += vinfo->size;
+ return;
+ case EMIT_1F:
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
count++;
break;
- case FORMAT_1F_PSIZE:
+ case EMIT_1F_PSIZE:
*vbuf->vertex_ptr++ = fui(vbuf->stage.draw->rasterizer->point_size);
count++;
break;
- case FORMAT_2F:
+ case EMIT_2F:
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][1]);
count += 2;
break;
- case FORMAT_3F:
+ case EMIT_3F:
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][1]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][2]);
count += 3;
break;
- case FORMAT_4F:
+ case EMIT_4F:
*vbuf->vertex_ptr++ = fui(vertex->data[j][0]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][1]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][2]);
*vbuf->vertex_ptr++ = fui(vertex->data[j][3]);
count += 4;
break;
- case FORMAT_4UB:
+ case EMIT_4UB:
*vbuf->vertex_ptr++ = pack_ub4(float_to_ubyte( vertex->data[j][2] ),
float_to_ubyte( vertex->data[j][1] ),
float_to_ubyte( vertex->data[j][0] ),