freedreno: Add FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE

Add a dirty bit for clip_plane_enable changes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit 5e2bd30ea4)
This commit is contained in:
Rob Clark 2022-01-20 18:11:46 -08:00 committed by Eric Engestrom
parent 9c98620378
commit a6887c3c4f
3 changed files with 12 additions and 5 deletions

View file

@ -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
},

View file

@ -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),

View file

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