summaryrefslogtreecommitdiff
path: root/src/mesa/shader/prog_parameter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/prog_parameter.c')
-rw-r--r--src/mesa/shader/prog_parameter.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index cdc8a20001..d09cc65937 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -223,6 +223,23 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList,
GLint
+_mesa_add_sampler(struct gl_program_parameter_list *paramList,
+ const char *name)
+{
+ GLint i = _mesa_lookup_parameter_index(paramList, -1, name);
+ if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_SAMPLER) {
+ /* already in list */
+ return i;
+ }
+ else {
+ const GLint size = 1;
+ i = _mesa_add_parameter(paramList, name, NULL, size, PROGRAM_SAMPLER);
+ return i;
+ }
+}
+
+
+GLint
_mesa_add_varying(struct gl_program_parameter_list *paramList,
const char *name, GLuint size)
{