nvc0: fragprog may not be set when e.g. clearing
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 2 Apr 2017 14:48:11 +0000 (10:48 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 2 Apr 2017 14:58:32 +0000 (10:58 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c

index d4931cb..68fd730 100644 (file)
@@ -605,8 +605,9 @@ nvc0_validate_min_samples(struct nvc0_context *nvc0)
       // have to do sample shading "to the max", otherwise there's no way to
       // tell which sets of samples are covered by the current invocation.
       // Similarly for reading the framebuffer.
-      if (nvc0->fragprog->fp.sample_mask_in ||
-          nvc0->fragprog->fp.reads_framebuffer)
+      if (nvc0->fragprog && (
+                nvc0->fragprog->fp.sample_mask_in ||
+                nvc0->fragprog->fp.reads_framebuffer))
          samples = util_framebuffer_get_num_samples(&nvc0->framebuffer);
       samples |= NVC0_3D_SAMPLE_SHADING_ENABLE;
    }