From cff0eac702e0070d4d7f0e2ae5f785ec10597d4d Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 31 Jan 2012 23:12:22 -0500 Subject: svga: fix a crash happening before setting fragment shaders. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gallium/drivers/svga/svga_state_need_swtnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/svga') 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)) { -- cgit v1.2.3