diff options
author | Marek Olšák <[email protected]> | 2017-06-11 01:40:15 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-22 01:51:02 +0200 |
commit | 6f4ead6bfd75610de96fcf142596df3dbb93a648 (patch) | |
tree | 2563ca3ddc5d43ae5528415e63795ddca2414a7c /src/mesa | |
parent | 5766c18f593d494e95a3334a65f3d22debf83e6e (diff) |
st/mesa: clean up trivial dereferences in update_textures
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index d53bf4eb159..70c32e4e07d 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -107,9 +107,9 @@ update_textures(struct st_context *st, enum pipe_shader_type shader_stage, const struct gl_program *prog, struct pipe_sampler_view **sampler_views, - unsigned *num_textures) + unsigned *out_num_textures) { - const GLuint old_max = *num_textures; + const GLuint old_max = *out_num_textures; GLbitfield samplers_used = prog->SamplersUsed; GLbitfield free_slots = ~prog->SamplersUsed; GLbitfield external_samplers_used = prog->ExternalSamplersUsed; @@ -118,7 +118,7 @@ update_textures(struct st_context *st, if (samplers_used == 0x0 && old_max == 0) return; - *num_textures = 0; + unsigned num_textures = 0; /* loop over sampler units (aka tex image units) */ for (unit = 0; samplers_used || unit < old_max; @@ -136,7 +136,7 @@ update_textures(struct st_context *st, if (retval == GL_FALSE) continue; - *num_textures = unit + 1; + num_textures = unit + 1; } pipe_sampler_view_reference(&(sampler_views[unit]), sampler_view); @@ -186,13 +186,14 @@ update_textures(struct st_context *st, break; } - *num_textures = MAX2(*num_textures, extra + 1); + num_textures = MAX2(num_textures, extra + 1); } cso_set_sampler_views(st->cso_context, shader_stage, - *num_textures, + num_textures, sampler_views); + *out_num_textures = num_textures; } |