From 630154e77b778ccb594be9e572988b05b0fc28e1 Mon Sep 17 00:00:00 2001 From: Mathias Fröhlich Date: Tue, 11 Dec 2018 18:45:43 +0100 Subject: i965: Move down genX_upload_sbe in profiles. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid looping over all VARYING_SLOT_MAX urb_setup array entries from genX_upload_sbe. Prepare an array indirection to the active entries of urb_setup already in the compile step. On upload only walk the active arrays. v2: Use uint8_t to store the attribute numbers. v3: Change loop to build up the array indirection. v4: Rebase. v5: Style fix. Reviewed-by: Matt Turner Reviewed-by: Ian Romanick Signed-off-by: Mathias Fröhlich Part-of: --- src/mesa/drivers/dri/i965/genX_state_upload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 635d314ef2b..0bd124011f4 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -1099,11 +1099,11 @@ genX(calculate_attr_overrides)(const struct brw_context *brw, */ bool drawing_points = brw_is_drawing_points(brw); - 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); /* _NEW_POINT */ bool point_sprite = false; -- cgit v1.2.3