diff options
author | Brian <[email protected]> | 2007-10-29 16:00:08 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-30 11:32:52 -0600 |
commit | 4b30d177b47953023b77494ef31fb1399beb7405 (patch) | |
tree | c2a7aad0efa46e3efbddf0835c134663ae0438f7 /src | |
parent | 449562cde0008c755d20b3de83cbd3266bc001ac (diff) |
added _mesa_combine_parameter_lists()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 33 | ||||
-rw-r--r-- | src/mesa/shader/prog_parameter.h | 10 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index b4008abbd95..bb964274b95 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -608,6 +608,39 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) /** + * Return a new parameter list which is listA + listB. + */ +struct gl_program_parameter_list * +_mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA, + const struct gl_program_parameter_list *listB) +{ + struct gl_program_parameter_list *list; + + if (listA) { + list = _mesa_clone_parameter_list(listA); + if (list && listB) { + GLuint i; + for (i = 0; i < listB->NumParameters; i++) { + struct gl_program_parameter *param = listB->Parameters + i; + _mesa_add_parameter(list, param->Type, param->Name, param->Size, + param->DataType, + listB->ParameterValues[i], + param->StateIndexes); + } + } + } + else if (listB) { + list = _mesa_clone_parameter_list(listB); + } + else { + list = NULL; + } + return list; +} + + + +/** * Find longest name of all uniform parameters in list. */ GLuint diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 40c8c09e09b..d6cc03448c8 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -78,6 +78,16 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList); extern struct gl_program_parameter_list * _mesa_clone_parameter_list(const struct gl_program_parameter_list *list); +extern struct gl_program_parameter_list * +_mesa_combine_parameter_lists(const struct gl_program_parameter_list *a, + const struct gl_program_parameter_list *b); + +static INLINE GLuint +_mesa_num_parameters(const struct gl_program_parameter_list *list) +{ + return list ? list->NumParameters : 0; +} + extern GLint _mesa_add_parameter(struct gl_program_parameter_list *paramList, enum register_file type, const char *name, |