summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_batch.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-09-04 19:10:05 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-09-04 19:10:05 -0600
commit2b53512073c0ecad66cfe1415cd19079ef2d4634 (patch)
treea7442c1f57e3da6d40cfd53a6d4d7a7f0402b399 /src/gallium/drivers/cell/ppu/cell_batch.c
parentc9cd0f46282fb2b42b238aa0c267ad0585783040 (diff)
cell: move batch buffer init code
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_batch.c')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_batch.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_batch.c b/src/gallium/drivers/cell/ppu/cell_batch.c
index a32a8c5633..16882c0129 100644
--- a/src/gallium/drivers/cell/ppu/cell_batch.c
+++ b/src/gallium/drivers/cell/ppu/cell_batch.c
@@ -240,3 +240,28 @@ cell_batch_alloc_aligned(struct cell_context *cell, uint bytes,
return pos;
}
+
+
+/**
+ * One-time init of batch buffers.
+ */
+void
+cell_init_batch_buffers(struct cell_context *cell)
+{
+ uint spu, buf;
+
+ /* init command, vertex/index buffer info */
+ for (buf = 0; buf < CELL_NUM_BUFFERS; buf++) {
+ cell->buffer_size[buf] = 0;
+
+ /* init batch buffer status values,
+ * mark 0th buffer as used, rest as free.
+ */
+ for (spu = 0; spu < cell->num_spus; spu++) {
+ if (buf == 0)
+ cell->buffer_status[spu][buf][0] = CELL_BUFFER_STATUS_USED;
+ else
+ cell->buffer_status[spu][buf][0] = CELL_BUFFER_STATUS_FREE;
+ }
+ }
+}