Mesa (master): nvc0: fragprog may not be set when e.g. clearing

Ilia Mirkin imirkin at kemper.freedesktop.org
Sun Apr 2 15:14:37 UTC 2017


Module: Mesa
Branch: master
Commit: 1184fba86ef82831896f8550546b888f0cd0f60e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1184fba86ef82831896f8550546b888f0cd0f60e

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sun Apr  2 10:48:11 2017 -0400

nvc0: fragprog may not be set when e.g. clearing

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
index d4931cbc67..68fd73064c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
@@ -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;
    }




More information about the mesa-commit mailing list