summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-04-18 16:27:35 -0600
committerBrian <[email protected]>2007-04-18 17:14:13 -0600
commitc93e883b205a679aa80f6228459890f9118ad909 (patch)
treef9e8290d6c013e7e3086a8c53bf436fe33c57824 /src/mesa/shader/slang
parent274ac7a801766a0ae766219ec6a40ed52e479d07 (diff)
Start fixing some issues with uniform variables and their types.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c7
-rw-r--r--src/mesa/shader/slang/slang_link.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 06bceea7d0f..d8c06f064d9 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2829,7 +2829,8 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
* store->Index = sampler uniform location
* store->Size = texture type index (1D, 2D, 3D, cube, etc)
*/
- GLint samplerUniform = _mesa_add_sampler(prog->Parameters, varName);
+ GLenum datatype = GL_SAMPLER_2D;
+ GLint samplerUniform = _mesa_add_sampler(prog->Parameters, varName, datatype);
store = _slang_new_ir_storage(PROGRAM_SAMPLER, samplerUniform, texIndex);
if (dbg) printf("SAMPLER ");
}
@@ -2839,7 +2840,9 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
* MAX2(var->array_len, 1);
if (prog) {
/* user-defined uniform */
- GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, size);
+ GLenum datatype = GL_FLOAT_VEC4; /* XXX */
+ GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName,
+ size, datatype);
store = _slang_new_ir_storage(PROGRAM_UNIFORM, uniformLoc, size);
}
else {
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 360af0922fa..48c0d68375e 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -202,10 +202,10 @@ link_uniform_vars(struct gl_shader_program *shProg, struct gl_program *prog)
j = _mesa_add_state_reference(shProg->Uniforms, p->StateIndexes);
break;
case PROGRAM_UNIFORM:
- j = _mesa_add_uniform(shProg->Uniforms, p->Name, p->Size);
+ j = _mesa_add_uniform(shProg->Uniforms, p->Name, p->Size, p->DataType);
break;
case PROGRAM_SAMPLER:
- j = _mesa_add_sampler(shProg->Uniforms, p->Name);
+ j = _mesa_add_sampler(shProg->Uniforms, p->Name, p->DataType);
break;
default:
_mesa_problem(NULL, "bad parameter type in link_uniform_vars()");