aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2006-12-14 13:59:25 -0700
committerBrian <[email protected]>2006-12-14 13:59:25 -0700
commitcc0c8b224880c6d6d5bf09f1d37b4275da476afd (patch)
treefd23cd79f64d4b05578d8e1c314e034cfaa39920 /src/mesa
parentef264c2971b43717c8f565f1d39f4149be3aaa85 (diff)
Updates for new linker (merged varying/uniform vars).
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/shaderobjects.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mesa/shader/shaderobjects.c b/src/mesa/shader/shaderobjects.c
index f805e2cebd3..976fa0aa312 100644
--- a/src/mesa/shader/shaderobjects.c
+++ b/src/mesa/shader/shaderobjects.c
@@ -33,10 +33,12 @@
#include "context.h"
#include "hash.h"
#include "macros.h"
+#include "program.h"
#include "shaderobjects.h"
#include "shaderobjects_3dlabs.h"
#include "slang_link.h"
+#define NEW_SLANG 1
#if FEATURE_ARB_shader_objects
@@ -380,8 +382,8 @@ uniform(GLint location, GLsizei count, const GLvoid *values, GLenum type,
#if NEW_SLANG
if (ctx->ShaderObjects.Linked) {
struct gl_linked_program *linked = ctx->ShaderObjects.Linked;
- if (location >= 0 && location < linked->NumUniforms) {
- GLfloat *v = linked->Uniforms[location].Value;
+ if (location >= 0 && location < linked->Uniforms->NumParameters) {
+ GLfloat *v = linked->Uniforms->ParameterValues[location];
const GLfloat *fValues = (const GLfloat *) values; /* XXX */
GLint i;
if (type == GL_FLOAT_VEC4)
@@ -396,10 +398,10 @@ uniform(GLint location, GLsizei count, const GLvoid *values, GLenum type,
return;
}
}
-#endif
-
+#else
if (!(**pro).WriteUniform(pro, location, count, values, type))
_mesa_error(ctx, GL_INVALID_OPERATION, caller);
+#endif
}
@@ -850,10 +852,12 @@ _mesa_GetUniformLocationARB(GLhandleARB programObj, const GLcharARB * name)
GET_CURRENT_CONTEXT(ctx);
if (ctx->ShaderObjects.Linked) {
- struct gl_linked_program *linked = ctx->ShaderObjects.Linked;
+ const struct gl_linked_program *linked = ctx->ShaderObjects.Linked;
GLuint loc;
- for (loc = 0; loc < linked->NumUniforms; loc++) {
- if (!strcmp(linked->Uniforms[loc].Name, name)) {
+ for (loc = 0; loc < linked->Uniforms->NumParameters; loc++) {
+ const struct gl_program_parameter *u
+ = linked->Uniforms->Parameters + loc;
+ if (u->Type == PROGRAM_UNIFORM && !strcmp(u->Name, name)) {
return loc;
}
}