From ef06ddb08a066a72b9a98cd2fbef8a74c99b8b32 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sun, 28 Feb 2016 10:47:35 -0800 Subject: [PATCH] anv/pipeline: Set FS URB space to zero if the FS is unused Signed-off-by: Jordan Justen --- src/intel/vulkan/anv_pipeline.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index f6e3aedda40..81d0d9c9bd9 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -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 -- 2.30.2