From 67c7cabd7fa9e6babb423080d53a045980e295ef Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Wed, 11 Mar 2020 10:35:13 +0000 Subject: [PATCH] anv: use urb_setup_attribs in SBE Avoid looping over all VARYING_SLOT_MAX urb_setup arrray entries. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Juan A. Suarez Romero Reviewed-by: Jason Ekstrand Reviewed-by: Ivan Briano Part-of: --- src/intel/vulkan/genX_pipeline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index b02b9e96db5..59c66267be7 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -358,11 +358,11 @@ emit_3dstate_sbe(struct anv_graphics_pipeline *pipeline) /* Skip the VUE header and position slots by default */ unsigned urb_entry_read_offset = 1; int max_source_attr = 0; - for (int attr = 0; attr < VARYING_SLOT_MAX; attr++) { + for (uint8_t idx = 0; idx < wm_prog_data->urb_setup_attribs_count; idx++) { + uint8_t attr = wm_prog_data->urb_setup_attribs[idx]; int input_index = wm_prog_data->urb_setup[attr]; - if (input_index < 0) - continue; + assert(0 <= input_index); /* gl_Viewport and gl_Layer are stored in the VUE header */ if (attr == VARYING_SLOT_VIEWPORT || attr == VARYING_SLOT_LAYER) { -- 2.30.2