glsl: Initialize gl_shader_program::EmptyUniformLocations.
authorMatt Turner <mattst88@gmail.com>
Sun, 28 Feb 2016 00:38:26 +0000 (16:38 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 1 Mar 2016 19:41:29 +0000 (11:41 -0800)
Commit 65dfb30 added exec_list EmptyUniformLocations, but only
initialized the list if ARB_explicit_uniform_location was enabled,
leading to crashes if the extension was not available.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/compiler/glsl/linker.cpp
src/mesa/main/shaderobj.c

index 5326bfd4d68bed1c318871ce21786506c63883ca..3039232162aede7b29f26eb6dd77703fa0eb119f 100644 (file)
@@ -3180,7 +3180,6 @@ check_explicit_uniform_locations(struct gl_context *ctx,
       }
    }
 
-   exec_list_make_empty(&prog->EmptyUniformLocations);
    struct empty_uniform_block *current_block = NULL;
 
    for (unsigned i = 0; i < prog->NumUniformRemapTable; i++) {
index 203ccef7fc400ff09f336d8672168179812b9c32..9a4eb6b56fddb5450449b7d62c26f28eb34a68e6 100644 (file)
@@ -240,6 +240,8 @@ init_shader_program(struct gl_shader_program *prog)
 
    prog->TransformFeedback.BufferMode = GL_INTERLEAVED_ATTRIBS;
 
+   exec_list_make_empty(&prog->EmptyUniformLocations);
+
    prog->InfoLog = ralloc_strdup(prog, "");
 }