radeonsi: add NULL checks to si_state

Submitted by Thai, Thong on Sept. 4, 2019, 4:46 p.m.

Details

Message ID 20190904164644.19176-1-thong.thai@amd.com
State New
Headers show
Series "radeonsi: add NULL checks to si_state" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Thai, Thong Sept. 4, 2019, 4:46 p.m.
Adding back NULL checks that were removed as part of
b758eed9c373db14a5acc04d9522ec9d74e51f1b

Signed-off-by: Thong Thai <thong.thai@amd.com>
---
 src/gallium/drivers/radeonsi/si_state.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 0c14c1cc3f8..423f0e2ce78 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -683,14 +683,16 @@  static void si_bind_blend_state(struct pipe_context *ctx, void *state)
 
 	si_pm4_bind_state(sctx, blend, blend);
 
-	if (old_blend->cb_target_mask != blend->cb_target_mask ||
+	if (!old_blend ||
+	    old_blend->cb_target_mask != blend->cb_target_mask ||
 	    old_blend->dual_src_blend != blend->dual_src_blend ||
 	    (old_blend->blend_enable_4bit != blend->blend_enable_4bit &&
 	     sctx->framebuffer.nr_samples >= 2 &&
 	     sctx->screen->dcc_msaa_allowed))
 		si_mark_atom_dirty(sctx, &sctx->atoms.s.cb_render_state);
 
-	if (old_blend->cb_target_mask != blend->cb_target_mask ||
+	if (!old_blend ||
+	    old_blend->cb_target_mask != blend->cb_target_mask ||
 	    old_blend->alpha_to_coverage != blend->alpha_to_coverage ||
 	    old_blend->alpha_to_one != blend->alpha_to_one ||
 	    old_blend->dual_src_blend != blend->dual_src_blend ||
@@ -699,12 +701,14 @@  static void si_bind_blend_state(struct pipe_context *ctx, void *state)
 		sctx->do_update_shaders = true;
 
 	if (sctx->screen->dpbb_allowed &&
+	    !old_blend ||
 	    (old_blend->alpha_to_coverage != blend->alpha_to_coverage ||
 	     old_blend->blend_enable_4bit != blend->blend_enable_4bit ||
 	     old_blend->cb_target_enabled_4bit != blend->cb_target_enabled_4bit))
 		si_mark_atom_dirty(sctx, &sctx->atoms.s.dpbb_state);
 
 	if (sctx->screen->has_out_of_order_rast &&
+	    !old_blend ||
 	    ((old_blend->blend_enable_4bit != blend->blend_enable_4bit ||
 	      old_blend->cb_target_enabled_4bit != blend->cb_target_enabled_4bit ||
 	      old_blend->commutative_4bit != blend->commutative_4bit ||