From 2d37e78e636e5e1e7d5d00230e50a00f7a71e868 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 23 Jan 2008 13:17:50 -0700 Subject: gallium: restore/rewrite vbuf code for softpipe Now based on the draw_vbuf code, instead being a custom one-off. Disabled by default, enable with SP_VBUF env var. --- src/mesa/pipe/draw/draw_vbuf.c | 5 +++++ src/mesa/pipe/draw/draw_vertex.c | 3 +++ src/mesa/pipe/draw/draw_vertex.h | 1 + 3 files changed, 9 insertions(+) (limited to 'src/mesa/pipe/draw') diff --git a/src/mesa/pipe/draw/draw_vbuf.c b/src/mesa/pipe/draw/draw_vbuf.c index a4b6247e18..c179b5e9dd 100644 --- a/src/mesa/pipe/draw/draw_vbuf.c +++ b/src/mesa/pipe/draw/draw_vbuf.c @@ -145,6 +145,11 @@ emit_vertex( struct vbuf_stage *vbuf, case FORMAT_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: *vbuf->vertex_ptr++ = fui(vertex->data[j][0]); count++; diff --git a/src/mesa/pipe/draw/draw_vertex.c b/src/mesa/pipe/draw/draw_vertex.c index 1ab004be10..37d8b04ef9 100644 --- a/src/mesa/pipe/draw/draw_vertex.c +++ b/src/mesa/pipe/draw/draw_vertex.c @@ -52,6 +52,9 @@ draw_compute_vertex_size(struct vertex_info *vinfo) switch (vinfo->format[i]) { case FORMAT_OMIT: break; + case FORMAT_HEADER: + vinfo->size += sizeof(struct vertex_header) / 4; + break; case FORMAT_4UB: /* fall-through */ case FORMAT_1F_PSIZE: diff --git a/src/mesa/pipe/draw/draw_vertex.h b/src/mesa/pipe/draw/draw_vertex.h index 28abd8ab91..e76a17c198 100644 --- a/src/mesa/pipe/draw/draw_vertex.h +++ b/src/mesa/pipe/draw/draw_vertex.h @@ -39,6 +39,7 @@ */ enum attrib_format { FORMAT_OMIT, /**< don't emit the attribute */ + FORMAT_HEADER, /**< The 5-byte vertex header */ FORMAT_1F, FORMAT_1F_PSIZE, /**< insert constant point size */ FORMAT_2F, -- cgit v1.2.3