summaryrefslogtreecommitdiff
path: root/src/mesa/shader/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r--src/mesa/shader/program.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 9f9d5955ea..2932c9ebc5 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -33,6 +33,7 @@
#include "main/context.h"
#include "main/hash.h"
#include "program.h"
+#include "prog_cache.h"
#include "prog_parameter.h"
#include "prog_instruction.h"
@@ -66,6 +67,7 @@ _mesa_init_program(GLcontext *ctx)
ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
}
+ ctx->VertexProgram.Cache = _mesa_new_program_cache();
#endif
#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
@@ -73,8 +75,10 @@ _mesa_init_program(GLcontext *ctx)
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
ctx->Shared->DefaultFragmentProgram);
assert(ctx->FragmentProgram.Current);
+ ctx->FragmentProgram.Cache = _mesa_new_program_cache();
#endif
+
/* XXX probably move this stuff */
#if FEATURE_ATI_fragment_shader
ctx->ATIFragmentShader.Enabled = GL_FALSE;
@@ -93,9 +97,11 @@ _mesa_free_program_data(GLcontext *ctx)
{
#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
+ _mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache);
#endif
#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
+ _mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache);
#endif
/* XXX probably move this stuff */
#if FEATURE_ATI_fragment_shader