Mesa (staging/20.0): iris: Plumb deref block size through to 3DSTATE_SF

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 31 17:47:41 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: f60209b935ae94e1d37768d2c16bbeec48010e8c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f60209b935ae94e1d37768d2c16bbeec48010e8c

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Jan 17 14:41:50 2020 -0600

iris: Plumb deref block size through to 3DSTATE_SF

Cc: "20.0" mesa-stable at lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3454>
(cherry picked from commit 2ccdf881aba7c8cd0c7175995e351e783e0fd11d)

---

 .pick_status.json                       |  2 +-
 src/gallium/drivers/iris/iris_context.h |  3 +++
 src/gallium/drivers/iris/iris_state.c   | 13 +++++++------
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 5729c1afa43..c3575727233 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -121,7 +121,7 @@
         "description": "iris: Plumb deref block size through to 3DSTATE_SF",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index ca1faae5f1d..5eacc769f76 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -28,6 +28,7 @@
 #include "util/u_debug.h"
 #include "intel/blorp/blorp.h"
 #include "intel/dev/gen_debug.h"
+#include "intel/common/gen_l3_config.h"
 #include "intel/compiler/brw_compiler.h"
 #include "iris_batch.h"
 #include "iris_binder.h"
@@ -731,6 +732,8 @@ struct iris_context {
        */
       enum isl_aux_usage draw_aux_usage[BRW_MAX_DRAW_BUFFERS];
 
+      enum gen_urb_deref_block_size urb_deref_block_size;
+
       /** Bitfield of whether color blending is enabled for RT[i] */
       uint8_t blend_enables;
 
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 721edca7026..7222e724ac6 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1694,10 +1694,6 @@ 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 {
@@ -5386,7 +5382,8 @@ iris_upload_dirty_render_state(struct iris_context *ice,
                          batch->screen->l3_config_3d,
                          ice->shaders.prog[MESA_SHADER_TESS_EVAL] != NULL,
                          ice->shaders.prog[MESA_SHADER_GEOMETRY] != NULL,
-                         size, entries, start, NULL);
+                         size, entries, start,
+                         &ice->state.urb_deref_block_size);
 
       for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) {
          iris_emit_cmd(batch, GENX(3DSTATE_URB_VS), urb) {
@@ -5768,13 +5765,17 @@ iris_upload_dirty_render_state(struct iris_context *ice,
                       ARRAY_SIZE(cso_rast->clip));
    }
 
-   if (dirty & IRIS_DIRTY_RASTER) {
+   if (dirty & (IRIS_DIRTY_RASTER | IRIS_DIRTY_URB)) {
       struct iris_rasterizer_state *cso = ice->state.cso_rast;
       iris_batch_emit(batch, cso->raster, sizeof(cso->raster));
 
       uint32_t dynamic_sf[GENX(3DSTATE_SF_length)];
       iris_pack_command(GENX(3DSTATE_SF), &dynamic_sf, sf) {
          sf.ViewportTransformEnable = !ice->state.window_space_position;
+
+#if GEN_GEN >= 12
+         sf.DerefBlockSize = ice->state.urb_deref_block_size;
+#endif
       }
       iris_emit_merge(batch, cso->sf, dynamic_sf,
                       ARRAY_SIZE(dynamic_sf));



More information about the mesa-commit mailing list