From bd031eb2e8a348d0ef69034e1d8f0d09e2bde283 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 2 Dec 2018 14:51:52 -0800 Subject: [PATCH] iris: reject all clipping when we can't use streamout render disabled --- src/gallium/drivers/iris/iris_query.c | 4 ++-- src/gallium/drivers/iris/iris_state.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 68bdb4b1ff1..2a8c963b807 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -518,7 +518,7 @@ iris_begin_query(struct pipe_context *ctx, struct pipe_query *query) if (q->type == PIPE_QUERY_PRIMITIVES_GENERATED && q->index == 0) { ice->state.prims_generated_query_active = true; - ice->state.dirty |= IRIS_DIRTY_STREAMOUT; + ice->state.dirty |= IRIS_DIRTY_STREAMOUT | IRIS_DIRTY_CLIP; } if (q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE || @@ -544,7 +544,7 @@ iris_end_query(struct pipe_context *ctx, struct pipe_query *query) if (q->type == PIPE_QUERY_PRIMITIVES_GENERATED && q->index == 0) { ice->state.prims_generated_query_active = true; - ice->state.dirty |= IRIS_DIRTY_STREAMOUT; + ice->state.dirty |= IRIS_DIRTY_STREAMOUT | IRIS_DIRTY_CLIP; } if (q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE || diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index d29cc8b9229..399bdf8d9ca 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1155,7 +1155,6 @@ iris_create_rasterizer_state(struct pipe_context *ctx, cl.ForceUserClipDistanceClipTestEnableBitmask = true; cl.APIMode = state->clip_halfz ? APIMODE_D3D : APIMODE_OGL; cl.GuardbandClipTestEnable = true; - cl.ClipMode = CLIPMODE_NORMAL; cl.ClipEnable = true; cl.ViewportXYClipTestEnable = state->point_tri_clip; cl.MinimumPointWidth = 0.125; @@ -4234,10 +4233,13 @@ iris_upload_dirty_render_state(struct iris_context *ice, struct iris_rasterizer_state *cso_rast = ice->state.cso_rast; struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer; + bool reject = cso_rast->rasterizer_discard && + ice->state.prims_generated_query_active; + uint32_t dynamic_clip[GENX(3DSTATE_CLIP_length)]; iris_pack_command(GENX(3DSTATE_CLIP), &dynamic_clip, cl) { cl.StatisticsEnable = ice->state.statistics_counters_enabled; - + cl.ClipMode = reject ? CLIPMODE_REJECT_ALL : CLIPMODE_NORMAL; if (wm_prog_data->barycentric_interp_modes & BRW_BARYCENTRIC_NONPERSPECTIVE_BITS) cl.NonPerspectiveBarycentricEnable = true; -- 2.30.2