Mesa (master): anv,iris: Set 3DSTATE_SF::DerefBlockSize to per-poly on Gen12+

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 31 05:36:37 UTC 2020


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Jan 16 17:59:43 2020 -0600

anv,iris: Set 3DSTATE_SF::DerefBlockSize to per-poly on Gen12+

According to the BSpec, this should prevent hangs when using shaders
with large URB entries.  A more precise fix can be done but it requires
re-arranging URB setup.

Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3454>

---

 src/gallium/drivers/iris/iris_state.c | 4 ++++
 src/intel/blorp/blorp_genX_exec.h     | 6 +++++-
 src/intel/vulkan/genX_pipeline.c      | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 00baa4ba312..6f277f08961 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1706,6 +1706,10 @@ iris_create_rasterizer_state(struct pipe_context *ctx,
       sf.PointWidthSource = state->point_size_per_vertex ? Vertex : State;
       sf.PointWidth = state->point_size;
 
+#if GEN_GEN >= 12
+      sf.DerefBlockSize = PerPolyDerefMode;
+#endif
+
       if (state->flatshade_first) {
          sf.TriangleFanProvokingVertexSelect = 1;
       } else {
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
index 9db829c30f2..84b7cac7e67 100644
--- a/src/intel/blorp/blorp_genX_exec.h
+++ b/src/intel/blorp/blorp_genX_exec.h
@@ -671,7 +671,11 @@ blorp_emit_sf_config(struct blorp_batch *batch,
 
 #if GEN_GEN >= 8
 
-   blorp_emit(batch, GENX(3DSTATE_SF), sf);
+   blorp_emit(batch, GENX(3DSTATE_SF), sf) {
+#if GEN_GEN >= 12
+      sf.DerefBlockSize = PerPolyDerefMode;
+#endif
+   }
 
    blorp_emit(batch, GENX(3DSTATE_RASTER), raster) {
       raster.CullMode = CULLMODE_NONE;
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 0426acaf2b2..0a91e1d009c 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -591,6 +591,10 @@ emit_rs_state(struct anv_pipeline *pipeline,
    sf.LineStippleEnable = line_info && line_info->stippledLineEnable;
 #endif
 
+#if GEN_GEN >= 12
+   sf.DerefBlockSize = PerPolyDerefMode;
+#endif
+
    const struct brw_vue_prog_data *last_vue_prog_data =
       anv_pipeline_get_last_vue_prog_data(pipeline);
 



More information about the mesa-commit mailing list