[Mesa-dev] [PATCH 25/24] st/mesa: set st_context::...num_samplers to 0 when there are no samplers
Nicolai Hähnle
nhaehnle at gmail.com
Mon Jun 19 11:17:32 UTC 2017
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
On 14.06.2017 19:17, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This was missed during my st/mesa series.
> ---
> src/mesa/state_tracker/st_atom_sampler.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
> index a80bacb..776fdbd 100644
> --- a/src/mesa/state_tracker/st_atom_sampler.c
> +++ b/src/mesa/state_tracker/st_atom_sampler.c
> @@ -254,22 +254,24 @@ update_shader_samplers(struct st_context *st,
> const struct gl_program *prog,
> struct pipe_sampler_state *samplers,
> unsigned *out_num_samplers)
> {
> GLbitfield samplers_used = prog->SamplersUsed;
> GLbitfield free_slots = ~prog->SamplersUsed;
> GLbitfield external_samplers_used = prog->ExternalSamplersUsed;
> unsigned unit, num_samplers;
> const struct pipe_sampler_state *states[PIPE_MAX_SAMPLERS];
>
> - if (samplers_used == 0x0)
> + if (samplers_used == 0x0) {
> + *out_num_samplers = 0;
> return;
> + }
>
> num_samplers = util_last_bit(samplers_used);
>
> /* loop over sampler units (aka tex image units) */
> for (unit = 0; samplers_used; unit++, samplers_used >>= 1) {
> struct pipe_sampler_state *sampler = samplers + unit;
>
> if (samplers_used & 1) {
> st_convert_sampler_from_unit(st, sampler, prog->SamplerUnits[unit]);
> states[unit] = sampler;
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list