Mesa (8.0): svga: fix a crash happening before setting fragment shaders.

Brian Paul brianp at kemper.freedesktop.org
Fri Mar 9 07:45:11 PST 2012


Module: Mesa
Branch: 8.0
Commit: 1fae49b0f5e3a2124ce578df48c800313778a74e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fae49b0f5e3a2124ce578df48c800313778a74e

Author: Zack Rusin <zackr at vmware.com>
Date:   Tue Jan 31 23:12:22 2012 -0500

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 <jfonseca at vmware.com>
(cherry picked from commit cff0eac702e0070d4d7f0e2ae5f785ec10597d4d)

---

 src/gallium/drivers/svga/svga_state_need_swtnl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c
index 8c39a4b..32355d1 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)) {



More information about the mesa-commit mailing list