summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_clear.c
diff options
context:
space:
mode:
authorJonathan Adamczewski <jadamcze@utas.edu.au>2009-01-12 16:24:49 -0700
committerBrian Paul <brianp@vmware.com>2009-01-12 16:25:28 -0700
commit402e6752b53d04af0bbfc5391547c2d127bce859 (patch)
tree18a284b4bf9a377c915a610797d3efc1dbb3159f /src/gallium/drivers/cell/ppu/cell_clear.c
parent45604ffac705a39e4cefa6b523e69535daf0db5b (diff)
cell: allocate batch buffers w/ 16-byte alignment
Replace cell_batch{align,alloc)*() with cell_batch_alloc16(), allocating multiples of 16 bytes that are 16 byte aligned. Opcodes are stored in preferred slot of SPU machine word. Various structures are explicitly padded to 16 byte multiples. Added STATIC_ASSERT().
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_clear.c')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_clear.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_clear.c b/src/gallium/drivers/cell/ppu/cell_clear.c
index 037635e466..c2e276988c 100644
--- a/src/gallium/drivers/cell/ppu/cell_clear.c
+++ b/src/gallium/drivers/cell/ppu/cell_clear.c
@@ -99,10 +99,11 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps,
/* Build a CLEAR command and place it in the current batch buffer */
{
+ STATIC_ASSERT(sizeof(struct cell_command_clear_surface) % 16 == 0);
struct cell_command_clear_surface *clr
= (struct cell_command_clear_surface *)
- cell_batch_alloc(cell, sizeof(*clr));
- clr->opcode = CELL_CMD_CLEAR_SURFACE;
+ cell_batch_alloc16(cell, sizeof(*clr));
+ clr->opcode[0] = CELL_CMD_CLEAR_SURFACE;
clr->surface = surfIndex;
clr->value = clearValue;
}