aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/uniforms.c')
-rw-r--r--mesalib/src/mesa/main/uniforms.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c
index 2323819aa..7252c099a 100644
--- a/mesalib/src/mesa/main/uniforms.c
+++ b/mesalib/src/mesa/main/uniforms.c
@@ -180,17 +180,17 @@ find_uniform_parameter_pos(struct gl_shader_program *shProg, GLint index,
pos = shProg->Uniforms->Uniforms[index].VertPos;
if (pos >= 0) {
- prog = &shProg->VertexProgram->Base;
+ prog = shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
}
else {
pos = shProg->Uniforms->Uniforms[index].FragPos;
if (pos >= 0) {
- prog = &shProg->FragmentProgram->Base;
+ prog = shProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
}
else {
pos = shProg->Uniforms->Uniforms[index].GeomPos;
if (pos >= 0) {
- prog = &shProg->GeometryProgram->Base;
+ prog = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program;
}
}
}
@@ -911,29 +911,32 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg,
/* A uniform var may be used by both a vertex shader and a fragment
* shader. We may need to update one or both shader's uniform here:
*/
- if (shProg->VertexProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_VERTEX]) {
/* convert uniform location to program parameter index */
GLint index = uniform->VertPos;
if (index >= 0) {
- set_program_uniform(ctx, &shProg->VertexProgram->Base,
+ set_program_uniform(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program,
index, offset, type, count, elems, values);
}
}
- if (shProg->FragmentProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_FRAGMENT]) {
/* convert uniform location to program parameter index */
GLint index = uniform->FragPos;
if (index >= 0) {
- set_program_uniform(ctx, &shProg->FragmentProgram->Base,
+ set_program_uniform(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program,
index, offset, type, count, elems, values);
}
}
- if (shProg->GeometryProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]) {
/* convert uniform location to program parameter index */
GLint index = uniform->GeomPos;
if (index >= 0) {
- set_program_uniform(ctx, &shProg->GeometryProgram->Base,
+ set_program_uniform(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
index, offset, type, count, elems, values);
}
}
@@ -1056,31 +1059,34 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
uniform = &shProg->Uniforms->Uniforms[location];
- if (shProg->VertexProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_VERTEX]) {
/* convert uniform location to program parameter index */
GLint index = uniform->VertPos;
if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->VertexProgram->Base,
+ set_program_uniform_matrix(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program,
index, offset,
count, rows, cols, transpose, values);
}
}
- if (shProg->FragmentProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_FRAGMENT]) {
/* convert uniform location to program parameter index */
GLint index = uniform->FragPos;
if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->FragmentProgram->Base,
+ set_program_uniform_matrix(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program,
index, offset,
count, rows, cols, transpose, values);
}
}
- if (shProg->GeometryProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]) {
/* convert uniform location to program parameter index */
GLint index = uniform->GeomPos;
if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->GeometryProgram->Base,
+ set_program_uniform_matrix(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
index, offset,
count, rows, cols, transpose, values);
}
@@ -1437,6 +1443,12 @@ _mesa_GetnUniformdvARB(GLhandleARB program, GLint location,
GLsizei bufSize, GLdouble *params)
{
GET_CURRENT_CONTEXT(ctx);
+
+ (void) program;
+ (void) location;
+ (void) bufSize;
+ (void) params;
+
/*
get_uniform(ctx, program, location, bufSize, GL_DOUBLE, params);
*/