Cell: add a few null texture tests
authorBrian <brian.paul@tungstengraphics.com>
Tue, 29 Jan 2008 01:09:16 +0000 (18:09 -0700)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 15 Feb 2008 02:50:24 +0000 (13:50 +1100)
src/mesa/pipe/cell/ppu/cell_state_emit.c
src/mesa/pipe/cell/ppu/cell_texture.c

index 391ff454ac2a2367e21dafb4bdf213b45f92a466..702184416bfe5e7d7d1eccad6a7fa2b3ea533f06 100644 (file)
@@ -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));
index acbe4c79f0504380123f30a6e05711ef90a8595a..2cf60229394c3aa0f686161761cbbe1be04e5d4c 100644 (file)
@@ -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);