From: Zack Rusin Date: Wed, 1 Feb 2012 04:12:22 +0000 (-0500) Subject: svga: fix a crash happening before setting fragment shaders. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cff0eac702e0070d4d7f0e2ae5f785ec10597d4d;p=mesa.git svga: fix a crash happening before setting fragment shaders. In certain situations API's will call pipe->clear which doesn't require fragment shader, but then we'd try to verify the pipeline and assume fragment shader was always set. This was leading to crash when API would just call simple clear's before anything else. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca --- diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index 8c39a4b76f0..32355d136cd 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -145,7 +145,8 @@ update_need_pipeline( struct svga_context *svga, */ if (svga->curr.reduced_prim == PIPE_PRIM_POINTS) { unsigned sprite_coord_gen = svga->curr.rast->templ.sprite_coord_enable; - unsigned generic_inputs = svga->curr.fs->generic_inputs; + unsigned generic_inputs = + svga->curr.fs ? svga->curr.fs->generic_inputs : 0; if (sprite_coord_gen && (generic_inputs & ~sprite_coord_gen)) {