[Mesa-dev] [PATCH] radeonsi: add NULL checks to si_state

Thai, Thong Thong.Thai at amd.com
Wed Sep 4 16:46:52 UTC 2019


Adding back NULL checks that were removed as part of
b758eed9c373db14a5acc04d9522ec9d74e51f1b

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

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 ||
-- 
2.17.1



More information about the mesa-dev mailing list