summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r--src/mesa/main/shaderobj.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 14bbb2e4bc3..863d50fbe55 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -36,7 +36,7 @@
#include "program/program.h"
#include "program/prog_parameter.h"
#include "program/prog_uniform.h"
-
+#include "talloc.h"
/**********************************************************************/
/*** Shader object functions ***/
@@ -92,13 +92,13 @@ _mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr,
* Allocate a new gl_shader object, initialize it.
* Called via ctx->Driver.NewShader()
*/
-static struct gl_shader *
+struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
{
struct gl_shader *shader;
assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER ||
type == GL_GEOMETRY_SHADER_ARB);
- shader = CALLOC_STRUCT(gl_shader);
+ shader = talloc_zero(NULL, struct gl_shader);
if (shader) {
shader->Type = type;
shader->Name = name;
@@ -117,10 +117,8 @@ __mesa_delete_shader(GLcontext *ctx, struct gl_shader *sh)
{
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);
}
@@ -235,7 +233,7 @@ static struct gl_shader_program *
_mesa_new_shader_program(GLcontext *ctx, GLuint name)
{
struct gl_shader_program *shProg;
- shProg = CALLOC_STRUCT(gl_shader_program);
+ shProg = talloc_zero(NULL, struct gl_shader_program);
if (shProg) {
shProg->Type = GL_SHADER_PROGRAM_MESA;
shProg->Name = name;
@@ -305,7 +303,7 @@ _mesa_free_shader_program_data(GLcontext *ctx,
}
if (shProg->InfoLog) {
- free(shProg->InfoLog);
+ talloc_free(shProg->InfoLog);
shProg->InfoLog = NULL;
}
@@ -328,7 +326,7 @@ __mesa_delete_shader_program(GLcontext *ctx, struct gl_shader_program *shProg)
{
_mesa_free_shader_program_data(ctx, shProg);
- free(shProg);
+ talloc_free(shProg);
}
@@ -389,4 +387,6 @@ _mesa_init_shader_object_functions(struct dd_function_table *driver)
driver->DeleteShader = __mesa_delete_shader;
driver->NewShaderProgram = _mesa_new_shader_program;
driver->DeleteShaderProgram = __mesa_delete_shader_program;
+ driver->CompileShader = _mesa_ir_compile_shader;
+ driver->LinkShader = _mesa_ir_link_shader;
}