[Mesa-dev] [PATCH 08/31] mesa: simplify a loop in _mesa_update_texture_state
Marek Olšák
maraeo at gmail.com
Mon Jun 12 16:55:33 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/main/texstate.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 132e231..3ad0da7 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -807,27 +807,21 @@ update_ff_texture_state(struct gl_context *ctx,
* \param ctx GL context.
*/
void
_mesa_update_texture_state(struct gl_context *ctx)
{
struct gl_program *prog[MESA_SHADER_STAGES];
int i;
int old_max_unit = ctx->Texture._MaxEnabledTexImageUnit;
BITSET_DECLARE(enabled_texture_units, MAX_COMBINED_TEXTURE_IMAGE_UNITS);
- for (i = 0; i < MESA_SHADER_STAGES; i++) {
- if (ctx->_Shader->CurrentProgram[i]) {
- prog[i] = ctx->_Shader->CurrentProgram[i];
- } else {
- prog[i] = NULL;
- }
- }
+ memcpy(prog, ctx->_Shader->CurrentProgram, sizeof(prog));
if (prog[MESA_SHADER_FRAGMENT] == NULL &&
_mesa_arb_fragment_program_enabled(ctx)) {
prog[MESA_SHADER_FRAGMENT] = ctx->FragmentProgram.Current;
}
/* TODO: only set this if there are actual changes */
ctx->NewState |= _NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE;
ctx->Texture._GenFlags = 0x0;
--
2.7.4
More information about the mesa-dev
mailing list