summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/prog_parameter.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2009-08-21 11:34:30 -0700
committerIan Romanick <[email protected]>2009-08-21 11:34:30 -0700
commit4cfb1b880b52d6bba32f4ebec78040ff6bf6737f (patch)
tree73c6892cf84ccff25a6d7b1e76363efc0bd4c2a2 /src/mesa/shader/prog_parameter.c
parentef98eed0a94f3b76399b19f9f65ca6977cd11b5d (diff)
parentac5551fbb97dd668f0c96c334d23b1fc48d16e18 (diff)
Merge branch 'asm-shader-rework-1'
Diffstat (limited to 'src/mesa/shader/prog_parameter.c')
-rw-r--r--src/mesa/shader/prog_parameter.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index bcd8c5d9dc0..6b9e73b2cbd 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -44,6 +44,34 @@ _mesa_new_parameter_list(void)
}
+struct gl_program_parameter_list *
+_mesa_new_parameter_list_sized(unsigned size)
+{
+ struct gl_program_parameter_list *p = _mesa_new_parameter_list();
+
+ if ((p != NULL) && (size != 0)) {
+ p->Size = size;
+
+ /* alloc arrays */
+ p->Parameters = (struct gl_program_parameter *)
+ _mesa_calloc(size * sizeof(struct gl_program_parameter));
+
+ p->ParameterValues = (GLfloat (*)[4])
+ _mesa_align_malloc(size * 4 *sizeof(GLfloat), 16);
+
+
+ if ((p->Parameters == NULL) || (p->ParameterValues == NULL)) {
+ _mesa_free(p->Parameters);
+ _mesa_align_free(p->ParameterValues);
+ _mesa_free(p);
+ p = NULL;
+ }
+ }
+
+ return p;
+}
+
+
/**
* Free a parameter list and all its parameters
*/