nir/glsl_to_nir: use _mesa_fls() to compute num_textures
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Fri, 6 Nov 2015 12:23:17 +0000 (12:23 +0000)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Mon, 16 Nov 2015 08:24:28 +0000 (09:24 +0100)
commit40c2acef5cfe28f4ac371203bd70bfc7a222ba26
treee2d448f597a28fbd419d5326b419ac7e02da5967
parent3f34afa0aad2a9bcfc0e5469a9675eca11ea7649
nir/glsl_to_nir: use _mesa_fls() to compute num_textures

Replace the current loop by a direct call to _mesa_fls() function.

It also fixes an implicit bug in the current code where num_textures
seems to be one value less than it should be when sh->Program->SamplersUsed > 0.

For instance, num_textures is 0 instead of 1 when
sh->Program->SamplersUsed is 1.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/nir/glsl_to_nir.cpp