From 4b30d177b47953023b77494ef31fb1399beb7405 Mon Sep 17 00:00:00 2001 From: Brian <brian.paul@tungstengraphics.com> Date: Mon, 29 Oct 2007 16:00:08 -0600 Subject: added _mesa_combine_parameter_lists() --- src/mesa/shader/prog_parameter.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/mesa/shader/prog_parameter.c') 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 @@ -607,6 +607,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. */ -- cgit v1.2.3