glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.
This saves recompiling at link time. gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index a584f60..40b8286 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -44,7 +44,7 @@
#include "shader/prog_uniform.h"
#include "shader/shader_api.h"
#include "shader/uniforms.h"
-
+#include "talloc.h"
/**
* Allocate a new gl_shader_program object, initialize it.
@@ -253,7 +253,7 @@
{
struct gl_shader *shader;
assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
- shader = CALLOC_STRUCT(gl_shader);
+ shader = talloc_zero(NULL, struct gl_shader);
if (shader) {
shader->Type = type;
shader->Name = name;
@@ -268,10 +268,8 @@
{
if (sh->Source)
free((void *) sh->Source);
- if (sh->InfoLog)
- free(sh->InfoLog);
_mesa_reference_program(ctx, &sh->Program, NULL);
- free(sh);
+ talloc_free(sh);
}