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>
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;