freedreno/a5xx: Fix clip_mask

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

Fixes: 99838513ae ("freedreno/a5xx: Add support for clip distances and use them for userclip.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
This commit is contained in:
Rob Clark 2022-01-20 15:46:49 -08:00 committed by Marge Bot
parent d26cdfac2c
commit 2dfebf3487
3 changed files with 6 additions and 3 deletions

View File

@ -658,7 +658,7 @@ fd5_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
OUT_RING(ring, A5XX_GRAS_CL_VPORT_ZSCALE_0(ctx->viewport.scale[2]));
}
if (dirty & FD_DIRTY_PROG)
if (dirty & (FD_DIRTY_PROG | FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE))
fd5_program_emit(ctx, ring, emit);
if (dirty & FD_DIRTY_RASTERIZER) {

View File

@ -250,9 +250,12 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
setup_stages(emit, s);
bool do_streamout = (s[VS].v->shader->stream_output.num_outputs > 0);
uint8_t clip_mask = s[VS].v->clip_mask, cull_mask = s[VS].v->cull_mask;
uint8_t clip_mask = s[VS].v->clip_mask,
cull_mask = s[VS].v->cull_mask;
uint8_t clip_cull_mask = clip_mask | cull_mask;
clip_mask &= ctx->rasterizer->clip_plane_enable;
fssz = (s[FS].i->double_threadsize) ? FOUR_QUADS : TWO_QUADS;
pos_regid = ir3_find_output_regid(s[VS].v, VARYING_SLOT_POS);

View File

@ -52,7 +52,7 @@ void fd5_emit_shader(struct fd_ringbuffer *ring,
const struct ir3_shader_variant *so);
void fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
struct fd5_emit *emit);
struct fd5_emit *emit) in_dt;
void fd5_prog_init(struct pipe_context *pctx);