From 1e03b5e5660b4deea16121e5da35d0d1a5aa755e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 26 Jan 2017 13:18:41 +0000 Subject: [PATCH] mesa: move variable declaration to where its used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable replacement was unused when building w/o ENABLE_SHADER_CACHE. Since we can mix variable declarations and code, move it to where its used. Fixes: 9f8dc3bf03e "utils: build sha1/disk cache only with Android/Autoconf" Signed-off-by: Emil Velikov Reviewed-by: Nicolai Hähnle (cherry picked from commit 6a5850b04a86c2287112047c6cad500136d18df5) --- src/mesa/main/shaderapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 4c67f9564ab..dcc08c7d5a7 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1741,8 +1741,6 @@ _mesa_ShaderSource(GLuint shaderObj, GLsizei count, GLcharARB *source; struct gl_shader *sh; - GLcharARB *replacement; - sh = _mesa_lookup_shader_err(ctx, shaderObj, "glShaderSourceARB"); if (!sh) return; @@ -1799,6 +1797,8 @@ _mesa_ShaderSource(GLuint shaderObj, GLsizei count, source[totalLength - 2] = '\0'; #ifdef ENABLE_SHADER_CACHE + GLcharARB *replacement; + /* Dump original shader source to MESA_SHADER_DUMP_PATH and replace * if corresponding entry found from MESA_SHADER_READ_PATH. */