progPos = shProg->Uniforms->Uniforms[index].FragPos;
if (progPos >= 0) {
prog = &shProg->FragmentProgram->Base;
+ } else {
+ progPos = shProg->Uniforms->Uniforms[index].GeomPos;
+ if (progPos >= 0) {
+ prog = &shProg->GeometryProgram->Base;
+ }
}
}
progPos = shProg->Uniforms->Uniforms[location].FragPos;
if (progPos >= 0) {
prog = &shProg->FragmentProgram->Base;
+ } else {
+ progPos = shProg->Uniforms->Uniforms[location].GeomPos;
+ if (progPos >= 0) {
+ prog = &shProg->GeometryProgram->Base;
+ }
}
}
}
}
}
+ if (shProg->GeometryProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->GeomPos;
+ if (index >= 0) {
+ set_program_uniform(ctx, &shProg->GeometryProgram->Base,
+ index, offset, type, count, elems, values);
+ }
+ }
+
uniform->Initialized = GL_TRUE;
}
}
}
+ if (shProg->GeometryProgram) {
+ /* convert uniform location to program parameter index */
+ GLint index = uniform->GeomPos;
+ if (index >= 0) {
+ set_program_uniform_matrix(ctx, &shProg->GeometryProgram->Base,
+ index, offset,
+ count, rows, cols, transpose, values);
+ }
+ }
+
uniform->Initialized = GL_TRUE;
}
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) {
uniform->Name = _mesa_strdup(name);
uniform->VertPos = -1;
uniform->FragPos = -1;
+ uniform->GeomPos = -1;
uniform->Initialized = GL_FALSE;
list->NumUniforms++;
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;
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);
}
}