gallium: rename pipe_buffer_handle to pipe_buffer, rework pipebuffer/ code
[mesa.git] / src / mesa / pipe / draw / draw_vbuf.c
index a4b6247e18dec73bb40483b48799441b17595df2..82051d2e65bf010f32842e1ad82cb165ce638260 100644 (file)
@@ -141,37 +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_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] ),