summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/program.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-09-20 08:26:11 -0700
committerKeith Whitwell <[email protected]>2008-09-21 09:46:00 -0700
commit32ef6e75839d6be283e034436e5dd34eabb67958 (patch)
tree7d8ac6e9236a5822d31481936ae0963154efa377 /src/mesa/shader/program.c
parente019ead5d76fd4e6e7d47d23e0284058391e1e29 (diff)
mesa: move fixed function vertex program builder from tnl to core mesa
Also unify caching of fragment and vertex programs in shader/prog_cache.c` Brought across from gallium-0.2
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 9f9d5955eaf..2932c9ebc50 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