diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-04-04 16:44:09 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-04-04 16:45:05 -0600 |
commit | 74a6a46b749668032c17f8fb2312e927f214768c (patch) | |
tree | a5efe2d1d5f6597eb308e3a5c48394eeeda7deb5 /src | |
parent | fe1c9c05855e364f7d9e0e2d1f5781440ae16034 (diff) |
gallium: adjust the code in update_textures() to look more like update_samplers()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index e1528c4d7b..01c07dc26d 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -47,19 +47,18 @@ static void update_textures(struct st_context *st) { - /* ST_NEW_FRAGMENT_PROGRAM - */ struct gl_fragment_program *fprog = st->ctx->FragmentProgram._Current; - GLuint unit; + GLuint su; st->state.num_textures = 0; - for (unit = 0; unit < st->ctx->Const.MaxTextureCoordUnits; unit++) { - const GLuint su = fprog->Base.SamplerUnits[unit]; + for (su = 0; su < st->ctx->Const.MaxTextureCoordUnits; su++) { struct pipe_texture *pt = NULL; if (fprog->Base.SamplersUsed & (1 << su)) { - struct gl_texture_object *texObj = st->ctx->Texture.Unit[su]._Current; + const GLuint texUnit = fprog->Base.SamplerUnits[su]; + struct gl_texture_object *texObj + = st->ctx->Texture.Unit[texUnit]._Current; struct st_texture_object *stObj = st_texture_object(texObj); if (texObj) { @@ -71,13 +70,13 @@ update_textures(struct st_context *st) continue; } - st->state.num_textures = unit + 1; + st->state.num_textures = su + 1; } pt = st_get_stobj_texture(stObj); } - pipe_texture_reference(&st->state.sampler_texture[unit], pt); + pipe_texture_reference(&st->state.sampler_texture[su], pt); } st->pipe->set_sampler_textures(st->pipe, st->state.num_textures, |