From bc4e914f959efe61edc47f2b159bed527808475b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 9 Jun 2017 23:54:16 +0200 Subject: [PATCH] mesa: simplify a loop in _mesa_update_texture_state MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Reviewed-by: Brian Paul Reviewed-by: Timothy Arceri --- 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 1e90bf8..0a2883f 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -840,13 +840,7 @@ _mesa_update_texture_state(struct gl_context *ctx) 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)) { -- 2.7.4