summaryrefslogtreecommitdiff
path: root/src/mesa/program/prog_uniform.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-07-10 19:21:42 -0400
committerZack Rusin <zackr@vmware.com>2010-07-10 19:21:42 -0400
commit79b643dd02ac4e19f24c9cd88843719746f8ec69 (patch)
treea70b7372721e459709a940cf55b4455501958f78 /src/mesa/program/prog_uniform.c
parent748d8d46134a835f61675ae0206d52869eb03240 (diff)
mesa: make uniform work with geometry shaders
Diffstat (limited to 'src/mesa/program/prog_uniform.c')
-rw-r--r--src/mesa/program/prog_uniform.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/program/prog_uniform.c b/src/mesa/program/prog_uniform.c
index c408a8492c..5aa9878d43 100644
--- a/src/mesa/program/prog_uniform.c
+++ b/src/mesa/program/prog_uniform.c
@@ -61,7 +61,8 @@ _mesa_append_uniform(struct gl_uniform_list *list,
GLint index;
assert(target == GL_VERTEX_PROGRAM_ARB ||
- target == GL_FRAGMENT_PROGRAM_ARB);
+ target == GL_FRAGMENT_PROGRAM_ARB ||
+ target == MESA_GEOMETRY_PROGRAM);
index = _mesa_lookup_uniform(list, name);
if (index < 0) {
@@ -90,6 +91,7 @@ _mesa_append_uniform(struct gl_uniform_list *list,
uniform->Name = _mesa_strdup(name);
uniform->VertPos = -1;
uniform->FragPos = -1;
+ uniform->GeomPos = -1;
uniform->Initialized = GL_FALSE;
list->NumUniforms++;
@@ -106,13 +108,18 @@ _mesa_append_uniform(struct gl_uniform_list *list,
return GL_FALSE;
}
uniform->VertPos = progPos;
- }
- else {
+ } else if (target == GL_FRAGMENT_PROGRAM_ARB) {
if (uniform->FragPos != -1) {
/* this uniform is already in the list - that shouldn't happen */
return GL_FALSE;
}
uniform->FragPos = progPos;
+ } else {
+ if (uniform->GeomPos != -1) {
+ /* this uniform is already in the list - that shouldn't happen */
+ return GL_FALSE;
+ }
+ uniform->GeomPos = progPos;
}
return uniform;
@@ -156,10 +163,11 @@ _mesa_print_uniforms(const struct gl_uniform_list *list)
GLuint i;
printf("Uniform list %p:\n", (void *) list);
for (i = 0; i < list->NumUniforms; i++) {
- printf("%d: %s %d %d\n",
+ printf("%d: %s %d %d %d\n",
i,
list->Uniforms[i].Name,
list->Uniforms[i].VertPos,
- list->Uniforms[i].FragPos);
+ list->Uniforms[i].FragPos,
+ list->Uniforms[i].GeomPos);
}
}