[Mesa-dev] [PATCH 3/7] st/glsl_to_tgsi: make samplers_used an uint32_t

Brian Paul brianp at vmware.com
Wed Apr 6 23:30:46 UTC 2016


On 04/06/2016 04:46 PM, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> It is used as a bitfield, so it seems cleaner to keep it unsigned.
> ---
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index cd481c1..e658168 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -389,7 +389,7 @@ public:
>      unsigned num_output_arrays;
>
>      int num_address_regs;
> -   int samplers_used;
> +   uint32_t samplers_used;
>      glsl_base_type sampler_types[PIPE_MAX_SAMPLERS];
>      int sampler_targets[PIPE_MAX_SAMPLERS];   /**< One of TGSI_TEXTURE_* */
>      int buffers_used;
>

If/when the day comes that we have more than 32 samplers, it might be 
good to have an assertion something like:

assert(sizeof(foo->samplers_used) * 8 <= PIPE_MAX_SAMPLERS);

In any case, for patches 1-4:
Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list