summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-28 18:09:16 -0700
committerBen Skeggs <[email protected]>2008-02-15 13:50:24 +1100
commitc474e0d6ed7b654ef750d088df2b26d8215f20ec (patch)
tree64d617a6429a7939d266e8c54f27d780138e34b4 /src
parent7012dd9b76328b4b1f54404df1948e50f23c1fe3 (diff)
Cell: add a few null texture tests
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_emit.c13
-rw-r--r--src/mesa/pipe/cell/ppu/cell_texture.c3
2 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.c b/src/mesa/pipe/cell/ppu/cell_state_emit.c
index 391ff454ac2..702184416bf 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_emit.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_emit.c
@@ -74,9 +74,16 @@ cell_emit_state(struct cell_context *cell)
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];
+ if (cell->texture[0]) {
+ texture.start = cell->texture[0]->tiled_data;
+ texture.width = cell->texture[0]->base.width[0];
+ texture.height = cell->texture[0]->base.height[0];
+ }
+ else {
+ texture.start = NULL;
+ texture.width = 0;
+ texture.height = 0;
+ }
emit_state_cmd(cell, CELL_CMD_STATE_TEXTURE,
&texture, sizeof(struct cell_command_texture));
diff --git a/src/mesa/pipe/cell/ppu/cell_texture.c b/src/mesa/pipe/cell/ppu/cell_texture.c
index acbe4c79f05..2cf60229394 100644
--- a/src/mesa/pipe/cell/ppu/cell_texture.c
+++ b/src/mesa/pipe/cell/ppu/cell_texture.c
@@ -234,7 +234,8 @@ cell_update_texture_mapping(struct cell_context *cell)
{
uint face = 0, level = 0, zslice = 0;
- cell_tile_texture(cell, cell->texture[0]);
+ if (cell->texture[0])
+ cell_tile_texture(cell, cell->texture[0]);
#if 0
if (cell->tex_surf && cell->tex_map) {
pipe_surface_unmap(cell->tex_surf);