diff --git a/.pick_status.json b/.pick_status.json index 96421f3157a..278898c833e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -724,7 +724,7 @@ "description": "freedreno: Add FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 9da86bf27d2..105f631f934 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -172,8 +172,9 @@ enum fd_dirty_3d_state { * from hw perspective: */ FD_DIRTY_RASTERIZER_DISCARD = BIT(24), - FD_DIRTY_BLEND_DUAL = BIT(25), -#define NUM_DIRTY_BITS 26 + FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE = BIT(25), + FD_DIRTY_BLEND_DUAL = BIT(26), +#define NUM_DIRTY_BITS 27 /* additional flag for state requires updated resource tracking: */ FD_DIRTY_RESOURCE = BIT(31), diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c index 5d5b942be39..7ce964320c2 100644 --- a/src/gallium/drivers/freedreno/freedreno_state.c +++ b/src/gallium/drivers/freedreno/freedreno_state.c @@ -38,6 +38,8 @@ #include "freedreno_texture.h" #include "freedreno_util.h" +#define get_safe(ptr, field) ((ptr) ? (ptr)->field : 0) + /* All the generic state handling.. In case of CSO's that are specific * to the GPU version, when the bind and the delete are common they can * go in here. @@ -434,7 +436,8 @@ fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso) in_dt { struct fd_context *ctx = fd_context(pctx); struct pipe_scissor_state *old_scissor = fd_context_get_scissor(ctx); - bool discard = ctx->rasterizer && ctx->rasterizer->rasterizer_discard; + bool discard = get_safe(ctx->rasterizer, rasterizer_discard); + unsigned clip_plane_enable = get_safe(ctx->rasterizer, clip_plane_enable); ctx->rasterizer = hwcso; fd_context_dirty(ctx, FD_DIRTY_RASTERIZER); @@ -453,8 +456,11 @@ fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso) in_dt if (old_scissor != fd_context_get_scissor(ctx)) fd_context_dirty(ctx, FD_DIRTY_SCISSOR); - if (ctx->rasterizer && (discard != ctx->rasterizer->rasterizer_discard)) + if (discard != get_safe(ctx->rasterizer, rasterizer_discard)) fd_context_dirty(ctx, FD_DIRTY_RASTERIZER_DISCARD); + + if (clip_plane_enable != get_safe(ctx->rasterizer, clip_plane_enable)) + fd_context_dirty(ctx, FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE); } static void