summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-10-18 16:01:49 -0700
committerIan Romanick <[email protected]>2011-11-07 13:33:16 -0800
commit719909698c67c287a393d2380278e7b7495ae018 (patch)
tree1a49879205ab93ea2d67db62cd8282b60302bdd7 /src/mesa/main/uniforms.c
parent143d20c16a33e2f08e834b28c23dbea772591ef9 (diff)
mesa: Rewrite the way uniforms are tracked and handled
Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*, glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the gl_uniform_storage structures in the gl_shader_program. A couple of notes: * Like most rewrite-the-world patches, this should be reviewed by applying the patch and examining the modified functions. * This leaves a lot of dead code around in linker.cpp and uniform_query.cpp. This will be deleted in the next patches. v2: Update the comment block (previously a FINISHME) in _mesa_uniform about generating GL_INVALID_VALUE when an out-of-range sampler index is specified. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r--src/mesa/main/uniforms.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 13574ce9af0..685c0f13fcf 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -41,6 +41,8 @@
#include "main/shaderapi.h"
#include "main/shaderobj.h"
#include "main/uniforms.h"
+#include "ir_uniform.h"
+#include "glsl_types.h"
/**
* Update the vertex/fragment program's TexturesUsed array.
@@ -422,7 +424,7 @@ _mesa_GetnUniformfvARB(GLhandleARB program, GLint location,
GLsizei bufSize, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniform(ctx, program, location, bufSize, GL_FLOAT, params);
+ _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_FLOAT, params);
}
void GLAPIENTRY
@@ -437,7 +439,7 @@ _mesa_GetnUniformivARB(GLhandleARB program, GLint location,
GLsizei bufSize, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniform(ctx, program, location, bufSize, GL_INT, params);
+ _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_INT, params);
}
void GLAPIENTRY
@@ -453,7 +455,7 @@ _mesa_GetnUniformuivARB(GLhandleARB program, GLint location,
GLsizei bufSize, GLuint *params)
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_get_uniform(ctx, program, location, bufSize, GL_UNSIGNED_INT, params);
+ _mesa_get_uniform(ctx, program, location, bufSize, GLSL_TYPE_UINT, params);
}
void GLAPIENTRY