summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-04-05 15:53:52 -0400
committerMarek Olšák <[email protected]>2018-04-05 15:53:52 -0400
commitc7dd59b06d93e6820189e2d1e087c0811707ee07 (patch)
tree2eb2cfdf7510ddd53cdce964a1e7331937bd11af
parentbe4250aa885a38a32ac6a8ad19e2655ec94be3a3 (diff)
radeonsi: fix a crash if ps_shader.cso is NULL in si_get_total_colormask
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index a794633d14b..9fb18a84d31 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1237,6 +1237,9 @@ static inline unsigned si_get_total_colormask(struct si_context *sctx)
return 0;
struct si_shader_selector *ps = sctx->ps_shader.cso;
+ if (!ps)
+ return 0;
+
unsigned colormask = sctx->framebuffer.colorbuf_enabled_4bit &
sctx->queued.named.blend->cb_target_mask;