diff options
author | Pauli Nieminen <suokkos@gmail.com> | 2009-08-24 00:57:05 +0300 |
---|---|---|
committer | Pauli Nieminen <suokkos@gmail.com> | 2009-08-24 00:57:05 +0300 |
commit | 7bb0f880dbdee0c57693c3a1f331d7c0894e71e1 (patch) | |
tree | c46a42d33501c1a9d56596981f50ce98746aa040 /src/mesa/shader/prog_parameter.c | |
parent | effda2e2a7f8ef7406d698c6b31dbbff408ed112 (diff) | |
parent | 4484ce9c7b196a686a3928f7e29dc8d9b6f3cae3 (diff) |
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into r600_state_predict
Conflicts:
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/radeon/radeon_cmdbuf.h
Diffstat (limited to 'src/mesa/shader/prog_parameter.c')
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index bcd8c5d9dc..6b9e73b2cb 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 */ |