From: Roland Scheidegger Date: Wed, 10 Mar 2010 15:53:07 +0000 (+0100) Subject: cell: handle NULL cso vertex_elements state object on bind X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c34437deda2ff8659fecdf3ea687820c9e57261;p=mesa.git cell: handle NULL cso vertex_elements state object on bind drivers need to handle NULL cso vertex elements (and others) objects. It is possible the cso code saves/restores NULL objects (if no normal cso object was bound before this was invoked). This led to segfaults (for example demos/cubemap) for apps which were using things like creating mipmaps before drawing anything. --- diff --git a/src/gallium/drivers/cell/ppu/cell_state_vertex.c b/src/gallium/drivers/cell/ppu/cell_state_vertex.c index d3efb8ecea2..9510ea9ac2b 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_vertex.c +++ b/src/gallium/drivers/cell/ppu/cell_state_vertex.c @@ -62,7 +62,8 @@ cell_bind_vertex_elements_state(struct pipe_context *pipe, cell->dirty |= CELL_NEW_VERTEX; - draw_set_vertex_elements(cell->draw, cell_velems->count, cell_velems->velem); + if (cell_velems) + draw_set_vertex_elements(cell->draw, cell_velems->count, cell_velems->velem); } void