From a2c1e48f15995a826dc759e064c2603882a37e0c Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 3 Nov 2017 10:36:32 -0700 Subject: [PATCH] i965: Only emit 3DSTATE_DRAWING_RECTANGLE once on gen8+ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Iglesias Gonsálvez Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_misc_state.c | 9 +++++++++ src/mesa/drivers/dri/i965/genX_blorp_exec.c | 2 ++ src/mesa/drivers/dri/i965/genX_state_upload.c | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index c4ef6812bff..2d2517d2bdf 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -573,6 +573,15 @@ brw_upload_invariant_state(struct brw_context *brw) BEGIN_BATCH(1); OUT_BATCH(_3DSTATE_VF_STATISTICS << 16 | 1); ADVANCE_BATCH(); + + if (devinfo->gen >= 8) { + BEGIN_BATCH(4); + OUT_BATCH(_3DSTATE_DRAWING_RECTANGLE << 16 | 1); + OUT_BATCH(0); + OUT_BATCH(~0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } } /** diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c index 062171af600..aa97981dd1f 100644 --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c @@ -276,10 +276,12 @@ retry: gen8_write_pma_stall_bits(brw, 0); #endif +#if GEN_GEN < 8 blorp_emit(batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) { rect.ClippedDrawingRectangleXMax = MAX2(params->x1, params->x0) - 1; rect.ClippedDrawingRectangleYMax = MAX2(params->y1, params->y0) - 1; } +#endif blorp_exec(batch, params); diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index b38b61a874c..eda812868bd 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -280,6 +280,7 @@ static const struct brw_tracked_state genX(line_stipple) = { .emit = genX(upload_line_stipple), }; +#if GEN_GEN < 8 /* Constant single cliprect for framebuffer object or DRI2 drawing */ static void genX(upload_drawing_rect)(struct brw_context *brw) @@ -303,6 +304,7 @@ static const struct brw_tracked_state genX(drawing_rect) = { }, .emit = genX(upload_drawing_rect), }; +#endif static uint32_t * genX(emit_vertex_buffer_state)(struct brw_context *brw, @@ -5656,8 +5658,6 @@ genX(init_atoms)(struct brw_context *brw) &genX(line_stipple), - &genX(drawing_rect), - &genX(vf_topology), &brw_indices, -- 2.30.2