diff options
author | Timothy Arceri <tarceri@itsqueeze.com> | 2017-04-04 12:39:31 +1000 |
---|---|---|
committer | Timothy Arceri <tarceri@itsqueeze.com> | 2017-04-06 08:25:36 +1000 |
commit | d1c1544a49e98431a7cab3d5fe89ac2ddbe4008d (patch) | |
tree | 43c41bb5dea51bfbf45b8d881463f90c1e5f9fb8 | |
parent | 32141e53d15207888a0282d860c048a5fc815946 (diff) |
mesa: small texstate tidy up
Possibly more efficient, either way it makes the code easier to
follow.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r-- | src/mesa/main/texstate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index ada0dfdb66..aa99b0667c 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -704,13 +704,14 @@ _mesa_update_texture_state(struct gl_context *ctx) if (ctx->_Shader->CurrentProgram[i]) { prog[i] = ctx->_Shader->CurrentProgram[i]; } else { - if (i == MESA_SHADER_FRAGMENT && ctx->FragmentProgram._Enabled) - prog[i] = ctx->FragmentProgram.Current; - else - prog[i] = NULL; + prog[i] = NULL; } } + if (prog[MESA_SHADER_FRAGMENT] == NULL && ctx->FragmentProgram._Enabled) { + prog[MESA_SHADER_FRAGMENT] = ctx->FragmentProgram.Current; + } + /* TODO: only set this if there are actual changes */ ctx->NewState |= _NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE; |