iris: Consolodate URB emit
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 17 Jan 2020 19:38:52 +0000 (13:38 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 31 Jan 2020 00:46:22 +0000 (18:46 -0600)
Now that we don't have to carry a URB state emit function for BLORP we
can roll some stuff together and drop a genX helper.

Cc: "20.0" mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3454>

src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_genx_protos.h
src/gallium/drivers/iris/iris_state.c

index b5c3f78da2847c114e54602292e330e17f60e7fc..ca1faae5f1d56568d0d9b379875239c7602b51ea 100644 (file)
@@ -670,9 +670,6 @@ struct iris_context {
       /** Is a GS or TES outputting points or lines? */
       bool output_topology_is_points_or_lines;
 
-      /* Track last VS URB entry size */
-      unsigned last_vs_entry_size;
-
       /**
        * Scratch buffers for various sizes and stages.
        *
index 6e9a7ba5f8e1e6800c0ef287223dc3bac57c69a5..6d59f936e3749ec18a520d6360591dfac65ff6f6 100644 (file)
 
 /* iris_state.c */
 void genX(init_state)(struct iris_context *ice);
-void genX(emit_urb_setup)(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          const unsigned size[4],
-                          bool tess_present, bool gs_present);
 void genX(emit_hashing_mode)(struct iris_context *ice,
                              struct iris_batch *batch,
                              unsigned width, unsigned height,
index 2593bf45b2a6051149313570444f95aebdea82f9..f5bcc681ab1cf53d17059722f765c358b83d6ae1 100644 (file)
@@ -5381,9 +5381,21 @@ iris_upload_dirty_render_state(struct iris_context *ice,
          assert(size[i] != 0);
       }
 
-      genX(emit_urb_setup)(ice, batch, size,
-                           ice->shaders.prog[MESA_SHADER_TESS_EVAL] != NULL,
-                           ice->shaders.prog[MESA_SHADER_GEOMETRY] != NULL);
+      unsigned entries[4], start[4];
+      gen_get_urb_config(&batch->screen->devinfo,
+                         batch->screen->l3_config_3d,
+                         ice->shaders.prog[MESA_SHADER_TESS_EVAL] != NULL,
+                         ice->shaders.prog[MESA_SHADER_GEOMETRY] != NULL,
+                         size, entries, start);
+
+      for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) {
+         iris_emit_cmd(batch, GENX(3DSTATE_URB_VS), urb) {
+            urb._3DCommandSubOpcode += i;
+            urb.VSURBStartingAddress     = start[i];
+            urb.VSURBEntryAllocationSize = size[i] - 1;
+            urb.VSNumberofURBEntries     = entries[i];
+         }
+      }
    }
 
    if (dirty & IRIS_DIRTY_BLEND_STATE) {
@@ -7218,32 +7230,6 @@ iris_emit_raw_pipe_control(struct iris_batch *batch,
    }
 }
 
-void
-genX(emit_urb_setup)(struct iris_context *ice,
-                     struct iris_batch *batch,
-                     const unsigned size[4],
-                     bool tess_present, bool gs_present)
-{
-   const struct gen_device_info *devinfo = &batch->screen->devinfo;
-   unsigned entries[4];
-   unsigned start[4];
-
-   ice->shaders.last_vs_entry_size = size[MESA_SHADER_VERTEX];
-
-   gen_get_urb_config(devinfo, batch->screen->l3_config_3d,
-                      tess_present, gs_present,
-                      size, entries, start);
-
-   for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) {
-      iris_emit_cmd(batch, GENX(3DSTATE_URB_VS), urb) {
-         urb._3DCommandSubOpcode += i;
-         urb.VSURBStartingAddress     = start[i];
-         urb.VSURBEntryAllocationSize = size[i] - 1;
-         urb.VSNumberofURBEntries     = entries[i];
-      }
-   }
-}
-
 #if GEN_GEN == 9
 /**
  * Preemption on Gen9 has to be enabled or disabled in various cases.