intel/aux-map: Factor out some useful helpers
[mesa.git] / src / intel / common / gen_urb_config.c
index 0b632149cd972c92f41c1b5ba3de58624efe6e49..1440dd713e92866a628ea4a58075bae4332d8580 100644 (file)
@@ -195,8 +195,14 @@ gen_get_urb_config(const struct gen_device_info *devinfo,
    }
 
    /* Lay out the URB in pipeline order: push constants, VS, HS, DS, GS. */
-   start[0] = push_constant_chunks;
-   for (int i = MESA_SHADER_TESS_CTRL; i <= MESA_SHADER_GEOMETRY; i++) {
-      start[i] = start[i - 1] + chunks[i - 1];
+   int next = push_constant_chunks;
+   for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) {
+      if (entries[i]) {
+         start[i] = next;
+         next += chunks[i];
+      } else {
+         /* Just put disabled stages at the beginning. */
+         start[i] = 0;
+      }
    }
 }