st/glsl_to_nir: fix next_stage gathering
authorTimothy Arceri <tarceri@itsqueeze.com>
Sat, 20 Oct 2018 04:02:59 +0000 (15:02 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 30 Oct 2018 22:33:17 +0000 (09:33 +1100)
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 <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_nir.cpp

index fe85eeb458dd642c6fde7e8f3fc3f3e3c764fe4b..c58deadc957cfc05587e0f5f8a9d566a909f5990 100644 (file)
@@ -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;
    }