anv,iris: Set 3DSTATE_SF::DerefBlockSize to per-poly on Gen12+
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 16 Jan 2020 23:59:43 +0000 (17:59 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 31 Jan 2020 00:45:52 +0000 (18:45 -0600)
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@lists.freedesktop.org
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3454>

src/gallium/drivers/iris/iris_state.c
src/intel/blorp/blorp_genX_exec.h
src/intel/vulkan/genX_pipeline.c

index 00baa4ba3123a3bddfc1c1114cd95a0169b32d8a..6f277f0896179d214cc7410c22025e39b388607b 100644 (file)
@@ -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 {
index 9db829c30f21775ee4a9c1e254cf2a8138816b0a..84b7cac7e679c4d3515d5f67b73891fa21915148 100644 (file)
@@ -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;
index 0426acaf2b29517a7a24616b8045cc3390ae49bc..0a91e1d009c0cdd79540681d6cd51e4fe5ae0423 100644 (file)
@@ -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);