summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-03-31 21:09:02 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-03-31 21:16:48 -0600
commite6c981f22c0b6469ef44e9d7a34113db34647fef (patch)
tree2abc42fe50bb2aa167667734c4558ffbb667841f /src/gallium/drivers/cell/ppu
parent5553a3b6757f0baaabbd67dd2f86d834d2f291ca (diff)
cell: more work for multi-texture support
Diffstat (limited to 'src/gallium/drivers/cell/ppu')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_emit.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c
index 4fbe1a21b8..9cae67f091 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_emit.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c
@@ -121,25 +121,36 @@ cell_emit_state(struct cell_context *cell)
}
if (cell->dirty & CELL_NEW_SAMPLER) {
- if (cell->sampler[0]) {
- emit_state_cmd(cell, CELL_CMD_STATE_SAMPLER,
- cell->sampler[0], sizeof(struct pipe_sampler_state));
+ uint i;
+ for (i = 0; i < CELL_MAX_SAMPLERS; i++) {
+ if (cell->sampler[i]) {
+ struct cell_command_sampler *sampler
+ = cell_batch_alloc(cell, sizeof(*sampler));
+ sampler->opcode = CELL_CMD_STATE_SAMPLER;
+ sampler->unit = i;
+ sampler->state = *cell->sampler[i];
+ }
}
}
if (cell->dirty & CELL_NEW_TEXTURE) {
- struct cell_command_texture texture;
uint i;
- memset(&texture, 0, sizeof(texture));
for (i = 0;i < CELL_MAX_SAMPLERS; i++) {
+ struct cell_command_texture *texture
+ = cell_batch_alloc(cell, sizeof(*texture));
+ texture->opcode = CELL_CMD_STATE_TEXTURE;
+ texture->unit = i;
if (cell->texture[i]) {
- texture.texture[i].start = cell->texture[i]->tiled_data;
- texture.texture[i].width = cell->texture[i]->base.width[0];
- texture.texture[i].height = cell->texture[i]->base.height[0];
+ texture->start = cell->texture[i]->tiled_data;
+ texture->width = cell->texture[i]->base.width[0];
+ texture->height = cell->texture[i]->base.height[0];
+ }
+ else {
+ texture->start = NULL;
+ texture->width = 1;
+ texture->height = 1;
}
}
- emit_state_cmd(cell, CELL_CMD_STATE_TEXTURE,
- &texture, sizeof(struct cell_command_texture));
}
if (cell->dirty & CELL_NEW_VERTEX_INFO) {