diff options
author | Brian Paul <[email protected]> | 2008-05-14 12:53:03 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-05-14 12:53:03 -0600 |
commit | 6ca948a303e1af7ae66ea7082af741f6880887f2 (patch) | |
tree | a497895b6edac79d78853913ddd91080f05e18ac /src/mesa/shader/prog_parameter.c | |
parent | 19ad9cf7741c641bd83d20485b32d11fe27ca8df (diff) |
added _mesa_combine_parameter_lists()
cherry-picked from gallium-0.1
Diffstat (limited to 'src/mesa/shader/prog_parameter.c')
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 3ad7215755d..500cfbbd873 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -604,6 +604,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 |