summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r--src/mesa/main/uniforms.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index c869942d2eb..d68a7768df5 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -132,6 +132,11 @@ get_uniform_parameter(const struct gl_shader_program *shProg, GLuint index)
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;
+ }
}
}
@@ -315,6 +320,11 @@ lookup_uniform_parameter(GLcontext *ctx, GLuint program, GLint location,
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;
+ }
}
}
}
@@ -829,6 +839,15 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
}
}
+ 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;
}
@@ -962,6 +981,16 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
}
}
+ 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;
}