From: Timothy Arceri Date: Sat, 20 Oct 2018 04:02:59 +0000 (+1100) Subject: st/glsl_to_nir: fix next_stage gathering X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31596836fc22e1f5b4cf85abc012acd27366db87;p=mesa.git st/glsl_to_nir: fix next_stage gathering ffs() just returns the bit that is set, we need to know what stage that bit represents so use u_bit_scan() instead. Fixes: 2ca5d9548fc4 ("st/glsl_to_nir: gather next_stage in shader_info") Reviewed-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index fe85eeb458d..c58deadc957 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -373,7 +373,7 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog, ~prev_stages & shader_program->data->linked_stages; nir->info.next_stage = stages_mask ? - (gl_shader_stage) ffs(stages_mask) : MESA_SHADER_FRAGMENT; + (gl_shader_stage) u_bit_scan(&stages_mask) : MESA_SHADER_FRAGMENT; } else { nir->info.next_stage = MESA_SHADER_FRAGMENT; }