i965: Use 3DSTATE_CLIP's User Clip Distance Enable bitmask on Gen8+.

Graphics / Mesa 3D Graphics Library / Mesa - Kenneth Graunke [whitecape.org] - 23 November 2016 18:57 UTC

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.

903056e i965: Use 3DSTATE_CLIP's User Clip Distance Enable bitmask on Gen8+.
src/mesa/drivers/dri/i965/brw_defines.h | 1 +
src/mesa/drivers/dri/i965/gen6_clip_state.c | 9 +++++++++
src/mesa/drivers/dri/i965/gen8_ds_state.c | 8 ++------
src/mesa/drivers/dri/i965/gen8_gs_state.c | 9 +++------
src/mesa/drivers/dri/i965/gen8_vs_state.c | 8 ++------
5 files changed, 17 insertions(+), 18 deletions(-)

Upstream: cgit.freedesktop.org


  • Share