summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/arbprogram.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/arbprogram.c')
-rw-r--r--src/mesa/main/arbprogram.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 51a299370e9..8bd3f0bd06f 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -265,6 +265,12 @@ get_local_param_pointer(struct gl_context *ctx, const char *func,
return GL_FALSE;
}
+ if (!prog->LocalParams) {
+ prog->LocalParams = calloc(maxParams, sizeof(float[4]));
+ if (!prog->LocalParams)
+ return GL_FALSE;
+ }
+
*param = prog->LocalParams[index];
return GL_TRUE;
}