freedreno/a6xx: Fix clip_mask

The clip_mask needs to also take into account rast->clip_plane_enable

Fixes: f2ae8d116a ("freedreno/a6xx: Implement user clip/cull distances")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit d26cdfac2c)
This commit is contained in:
Rob Clark 2022-01-20 15:32:34 -08:00 committed by Eric Engestrom
parent a6887c3c4f
commit ea7aac8a3a
6 changed files with 15 additions and 3 deletions

View file

@ -715,7 +715,7 @@
"description": "freedreno/a6xx: Fix clip_mask",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "f2ae8d116ab05419764be444f0615f0310ae9936"
},

View file

@ -91,6 +91,7 @@ fd5_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.vastc_srgb = fd5_ctx->vastc_srgb,
.fastc_srgb = fd5_ctx->fastc_srgb,
},
.clip_plane_enable = ctx->rasterizer->clip_plane_enable,
},
.rasterflat = ctx->rasterizer->flatshade,
.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,

View file

@ -151,7 +151,8 @@ setup_state_map(struct fd_context *ctx)
BIT(FD6_GROUP_ZSA));
fd_context_add_map(ctx, FD_DIRTY_ZSA | FD_DIRTY_BLEND | FD_DIRTY_PROG,
BIT(FD6_GROUP_LRZ) | BIT(FD6_GROUP_LRZ_BINNING));
fd_context_add_map(ctx, FD_DIRTY_PROG, BIT(FD6_GROUP_PROG));
fd_context_add_map(ctx, FD_DIRTY_PROG | FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE,
BIT(FD6_GROUP_PROG));
fd_context_add_map(ctx, FD_DIRTY_RASTERIZER, BIT(FD6_GROUP_RASTERIZER));
fd_context_add_map(ctx,
FD_DIRTY_FRAMEBUFFER | FD_DIRTY_RASTERIZER_DISCARD |

View file

@ -156,6 +156,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.sample_shading = (ctx->min_samples > 1),
.msaa = (ctx->framebuffer.samples > 1),
},
.clip_plane_enable = ctx->rasterizer->clip_plane_enable,
},
.rasterflat = ctx->rasterizer->flatshade,
.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,
@ -195,7 +196,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
ir3_fixup_shader_state(&ctx->base, &emit.key.key);
if (!(ctx->dirty & FD_DIRTY_PROG)) {
if (!(ctx->gen_dirty & BIT(FD6_GROUP_PROG))) {
emit.prog = fd6_ctx->prog;
} else {
fd6_ctx->prog = fd6_emit_get_prog(&emit);

View file

@ -538,6 +538,8 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_context *ctx,
cull_mask = last_shader->cull_mask;
uint8_t clip_cull_mask = clip_mask | cull_mask;
clip_mask &= cache_key->clip_plane_enable;
/* If we have streamout, link against the real FS, rather than the
* dummy FS used for binning pass state, to ensure the OUTLOC's
* match. Depending on whether we end up doing sysmem or gmem,

View file

@ -27,6 +27,8 @@
#ifndef IR3_CACHE_H_
#define IR3_CACHE_H_
#include "pipe/p_state.h"
#include "ir3/ir3_shader.h"
/*
@ -39,6 +41,11 @@
struct ir3_cache_key {
struct ir3_shader_state *vs, *hs, *ds, *gs, *fs; // 5 pointers
struct ir3_shader_key key; // 7 dwords
/* Additional state that effects the cached program state, but
* not the compiled shader:
*/
unsigned clip_plane_enable : PIPE_MAX_CLIP_PLANES;
};
/* per-gen backend program state object should subclass this for it's