summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu/cell_state_emit.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-28 17:23:44 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-28 18:18:46 -0700
commit425f270fcbfdbfce98adaf9da4b8eb7360f34447 (patch)
treeaeb424c4598456849ca32ac2b2ae90874edff9f7 /src/mesa/pipe/cell/ppu/cell_state_emit.c
parentc2372cc7481bf3985a6a3126952ab9d5dab4bf77 (diff)
Cell: basic texture mapping
Texture images are tiled in PPU code. SPUs use a texture cache for getting texels from textures. This is very rough code, but demos/texcyl.c works.
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_state_emit.c')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_emit.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.c b/src/mesa/pipe/cell/ppu/cell_state_emit.c
index 6776ec88c7..391ff454ac 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_emit.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_emit.c
@@ -30,7 +30,7 @@
#include "cell_state.h"
#include "cell_state_emit.h"
#include "cell_batch.h"
-
+#include "cell_texture.h"
static void
@@ -72,6 +72,16 @@ cell_emit_state(struct cell_context *cell)
cell->sampler[0], sizeof(struct pipe_sampler_state));
}
+ if (cell->dirty & CELL_NEW_TEXTURE) {
+ struct cell_command_texture texture;
+ texture.start = cell->texture[0]->tiled_data;
+ texture.width = cell->texture[0]->base.width[0];
+ texture.height = cell->texture[0]->base.height[0];
+
+ emit_state_cmd(cell, CELL_CMD_STATE_TEXTURE,
+ &texture, sizeof(struct cell_command_texture));
+ }
+
if (cell->dirty & CELL_NEW_VERTEX_INFO) {
emit_state_cmd(cell, CELL_CMD_STATE_VERTEX_INFO,
&cell->vertex_info, sizeof(struct vertex_info));