diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-01-23 23:27:31 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-01-23 23:27:31 -0700 |
commit | 2549d79ae5342a2b97c06e3b0db9da6eb7821d2e (patch) | |
tree | cdd4e62ff8287042157b0ed845bde1e54f251800 /src/mesa/pipe/draw/draw_vbuf.c | |
parent | 6000dcc973cdc1bd61621b432aed27d21059ae5d (diff) |
gallium: rename FORMAT_x to EMIT_x and use EMIT_ALL to emit whole vertex as-is in vbuf code
Diffstat (limited to 'src/mesa/pipe/draw/draw_vbuf.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_vbuf.c | 27 |
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] ), |