draw: assert that we have non-null fragment shader
authorBrian Paul <brianp@vmware.com>
Thu, 3 Nov 2011 22:55:18 +0000 (16:55 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Nov 2011 22:56:11 +0000 (16:56 -0600)
Instead of just segfaulting.  Recently ran into this.

src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/draw/draw_pipe_wide_point.c

index fe3627be867e13d3d3fba3c08ea875c1f0abc71a..0401a45507b04d0c3875588b9dd82724c782a6fd 100644 (file)
@@ -361,6 +361,8 @@ generate_pstip_fs(struct pstip_stage *pstip)
    tgsi_dump(pstip_fs.tokens, 0);
 #endif
 
+   assert(pstip->fs);
+
    pstip->fs->sampler_unit = transform.freeSampler;
    assert(pstip->fs->sampler_unit < PIPE_MAX_SAMPLERS);
 
index 0b86ba1e928190cb699e355ce1108a57247dc799..8e0a117843e715ac63cefa38d4e7319f3ab14ef3 100644 (file)
@@ -229,6 +229,8 @@ widepoint_first_point(struct draw_stage *stage,
       const struct draw_fragment_shader *fs = draw->fs.fragment_shader;
       uint i;
 
+      assert(fs);
+
       wide->num_texcoord_gen = 0;
 
       /* Loop over fragment shader inputs looking for generic inputs