summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2008-01-30 19:33:30 -0800
committerIan Romanick <idr@us.ibm.com>2008-01-30 20:14:52 -0800
commit10270fbe2d362fe8f27384b9a5423381e2882460 (patch)
treecd882a3c669545c7ba1d4ecf27603fa188fce4dc /src/mesa/pipe
parent193491cbd3ad2ad95243181c201da4640f3a29c2 (diff)
Correctly read / write vertex header from / to main memory
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/cell/spu/spu_vertex_shader.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/pipe/cell/spu/spu_vertex_shader.c b/src/mesa/pipe/cell/spu/spu_vertex_shader.c
index 125b2c3a43..ea5ffae6bc 100644
--- a/src/mesa/pipe/cell/spu/spu_vertex_shader.c
+++ b/src/mesa/pipe/cell/spu/spu_vertex_shader.c
@@ -112,11 +112,16 @@ run_vertex_program(struct spu_vs_context *draw,
unsigned slot;
float x, y, z, w;
unsigned char buffer[sizeof(struct vertex_header)
- + MAX_VERTEX_SIZE] ALIGN16_ATTRIB;
+ + MAX_VERTEX_SIZE] ALIGN16_ATTRIB;
struct vertex_header *const tmpOut =
- (struct vertex_header *) buffer;
- const unsigned vert_size = sizeof(struct vertex_header)
- + (sizeof(float) * 4 * draw->num_vs_outputs);
+ (struct vertex_header *) buffer;
+ const unsigned vert_size = ROUNDUP16(sizeof(struct vertex_header)
+ + (sizeof(float) * 4
+ * draw->num_vs_outputs));
+
+ mfc_get(tmpOut, vOut[j], vert_size, TAG_VERTEX_BUFFER, 0, 0);
+ wait_on_mask(1 << TAG_VERTEX_BUFFER);
+
/* Handle attr[0] (position) specially:
*
@@ -155,12 +160,8 @@ run_vertex_program(struct spu_vs_context *draw,
tmpOut->data[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
}
- wait_on_mask(1 << TAG_VERTEX_BUFFER);
mfc_put(tmpOut, vOut[j], vert_size, TAG_VERTEX_BUFFER, 0, 0);
-
} /* loop over vertices */
-
- wait_on_mask(1 << TAG_VERTEX_BUFFER);
}