summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-07-30 22:38:43 -0700
committerPaul Berry <[email protected]>2013-08-01 20:20:41 -0700
commit844bd71736dd59808e1ea4319800db042a7c4267 (patch)
tree0233e79e28643773e59ee030ed4d01827e74f955 /src/glsl
parentff523771833cf2cfb6d69d61e86a28c26b8400be (diff)
glsl/linker: Make separate allocations to track vertex and fragment shaders.
There's no reason to be clever about this. By making separate allocations for vertex and fragment shaders, we'll allow geometry shaders to be added without introducing any complication. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/linker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 7fae0b8c47d..d7ea740dbf0 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1615,8 +1615,9 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
unsigned num_frag_shaders = 0;
vert_shader_list = (struct gl_shader **)
- calloc(2 * prog->NumShaders, sizeof(struct gl_shader *));
- frag_shader_list = &vert_shader_list[prog->NumShaders];
+ calloc(prog->NumShaders, sizeof(struct gl_shader *));
+ frag_shader_list = (struct gl_shader **)
+ calloc(prog->NumShaders, sizeof(struct gl_shader *));
unsigned min_version = UINT_MAX;
unsigned max_version = 0;
@@ -1948,6 +1949,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
done:
free(vert_shader_list);
+ free(frag_shader_list);
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
if (prog->_LinkedShaders[i] == NULL)