From 31596836fc22e1f5b4cf85abc012acd27366db87 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 20 Oct 2018 15:02:59 +1100 Subject: [PATCH] st/glsl_to_nir: fix next_stage gathering MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.30.2