diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2016-11-15 22:59:45 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2016-11-23 16:57:29 -0800 |
commit | 903056e016e3ea52c2f493f8b0938b519ee40894 (patch) | |
tree | 9013d9b41670c8b1a5d639a306dd361cbc1a6e6b /src/mesa/drivers/dri/i965/gen8_gs_state.c | |
parent | 3b6893b678b4f3594b37b0c709a2fce7f2852eca (diff) |
i965: Use 3DSTATE_CLIP's User Clip Distance Enable bitmask on Gen8+.
Gen6-7.5 specify the user clip distance enable bitmask in 3DSTATE_CLIP.
Gen8+ normally uses the new internal signalling mechanism to select the
one specified in the last enabled shader stage (3DSTATE_VS, DS, or GS).
This is a pretty good fit for Vulkan, or even newer GL, where the
bitmask comes entirely from the shader. But with glClipPlane(),
this is dynamic state, and we have to listen to _NEW_TRASNFORM.
Clip plane enables are the only reason the VS/DS/GS atoms need to
listen to _NEW_TRANSFORM. 3DSTATE_CLIP already has to listen to it
in order to support ARB_clip_control settings.
Setting the "Use the 3DSTATE_CLIP bitmask" force enable bit allows
us to drop _NEW_TRANSFORM from all the shader stage atoms, so we can
re-emit them less often.
Improves performance of OglBatch7 (version 6) by 2.70773% +/- 0.491257%
(n = 38) at 1024x768 on Cherryview.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen8_gs_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen8_gs_state.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/gen8_gs_state.c b/src/mesa/drivers/dri/i965/gen8_gs_state.c index c39dc61261f..2b74f1bd575 100644 --- a/src/mesa/drivers/dri/i965/gen8_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen8_gs_state.c @@ -30,7 +30,6 @@ static void gen8_upload_gs_state(struct brw_context *brw) { const struct gen_device_info *devinfo = &brw->screen->devinfo; - struct gl_context *ctx = &brw->ctx; const struct brw_stage_state *stage_state = &brw->gs.base; /* BRW_NEW_GEOMETRY_PROGRAM */ bool active = brw->geometry_program; @@ -112,10 +111,8 @@ gen8_upload_gs_state(struct brw_context *brw) /* DW8 */ OUT_BATCH(dw8); - /* DW9 / _NEW_TRANSFORM */ - OUT_BATCH((vue_prog_data->cull_distance_mask | - ctx->Transform.ClipPlanesEnabled << - GEN8_GS_USER_CLIP_DISTANCE_SHIFT) | + /* DW9 */ + OUT_BATCH(vue_prog_data->cull_distance_mask | (urb_entry_output_length << GEN8_GS_URB_OUTPUT_LENGTH_SHIFT) | (urb_entry_write_offset << GEN8_GS_URB_ENTRY_OUTPUT_OFFSET_SHIFT)); @@ -138,7 +135,7 @@ gen8_upload_gs_state(struct brw_context *brw) const struct brw_tracked_state gen8_gs_state = { .dirty = { - .mesa = _NEW_TRANSFORM, + .mesa = 0, .brw = BRW_NEW_BATCH | BRW_NEW_BLORP | BRW_NEW_CONTEXT | |