anv/pipeline: Set FS URB space to zero if the FS is unused
authorJordan Justen <jordan.l.justen@intel.com>
Sun, 28 Feb 2016 18:47:35 +0000 (10:47 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 28 Feb 2016 18:51:38 +0000 (10:51 -0800)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/intel/vulkan/anv_pipeline.c

index f6e3aedda4013468adbb68ef2ea57fd0a0127f3e..81d0d9c9bd9e0e46648ac4eb8682dce1b54e73ff 100644 (file)
@@ -894,14 +894,17 @@ gen7_compute_urb_partition(struct anv_pipeline *pipeline)
    const unsigned stages =
       _mesa_bitcount(pipeline->active_stages & VK_SHADER_STAGE_ALL_GRAPHICS);
    const unsigned size_per_stage = push_constant_kb / stages;
+   unsigned used_kb = 0;
 
    for (int i = MESA_SHADER_VERTEX; i < MESA_SHADER_FRAGMENT; i++) {
       pipeline->urb.push_size[i] =
          (pipeline->active_stages & (1 << i)) ? size_per_stage : 0;
+      used_kb += pipeline->urb.push_size[i];
+      assert(used_kb <= push_constant_kb);
    }
 
    pipeline->urb.push_size[MESA_SHADER_FRAGMENT] =
-      push_constant_kb - size_per_stage * (stages - 1);
+      push_constant_kb - used_kb;
 }
 
 static void