Mesa (master): iris: Explicitly emit 3DSTATE_BTP_XS on Gen9 with DIRTY_CONSTANTS_XS

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 18 22:45:06 UTC 2019


Module: Mesa
Branch: master
Commit: e7db3577f87d64a7f878d8dad6793afa40b3ae2a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7db3577f87d64a7f878d8dad6793afa40b3ae2a

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 10 03:08:46 2019 -0700

iris: Explicitly emit 3DSTATE_BTP_XS on Gen9 with DIRTY_CONSTANTS_XS

Right now, we usually flag both IRIS_DIRTY_{CONSTANTS,BINDINGS}_XS,
because we have SURFACE_STATE for constant buffers in case the shaders
access them via pull mode.

But this flagging is overkill in many cases.  Gen8 and Gen11 don't need
it at all.  Gen9 doesn't need that large of a hammer in all cases.

Just handle it explicitly so the right thing happens.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>

---

 src/gallium/drivers/iris/iris_state.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index ed669f7ecb9..99e4a84c414 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -4913,7 +4913,12 @@ iris_upload_dirty_render_state(struct iris_context *ice,
    }
 
    for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
-      if (dirty & (IRIS_DIRTY_BINDINGS_VS << stage)) {
+      /* Gen9 requires 3DSTATE_BINDING_TABLE_POINTERS_XS to be re-emitted
+       * in order to commit constants.  TODO: Investigate "Disable Gather
+       * at Set Shader" to go back to legacy mode...
+       */
+      if (dirty & ((IRIS_DIRTY_BINDINGS_VS |
+                    (GEN_GEN == 9 ? IRIS_DIRTY_CONSTANTS_VS : 0)) << stage)) {
          iris_emit_cmd(batch, GENX(3DSTATE_BINDING_TABLE_POINTERS_VS), ptr) {
             ptr._3DCommandSubOpcode = 38 + stage;
             ptr.PointertoVSBindingTable = binder->bt_offset[stage];




More information about the mesa-commit mailing list