summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-23 13:17:50 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-23 13:17:50 -0700
commit2d37e78e636e5e1e7d5d00230e50a00f7a71e868 (patch)
tree8fae0ed858c04330908996bc2289e50b8467718f /src/mesa/pipe/draw
parentcd3643698eafa0869a8317b002e5b066de0172e7 (diff)
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.
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r--src/mesa/pipe/draw/draw_vbuf.c5
-rw-r--r--src/mesa/pipe/draw/draw_vertex.c3
-rw-r--r--src/mesa/pipe/draw/draw_vertex.h1
3 files changed, 9 insertions, 0 deletions
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,