diff options
author | Brian <[email protected]> | 2007-04-18 16:44:02 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-04-18 17:14:14 -0600 |
commit | 36a6a59972857676108c4ee72e677734848d3056 (patch) | |
tree | cf032ee8104a872426e449db5956462b138db706 /src/mesa/shader | |
parent | addd03da2e254d16088171012c9ca0d157b0d4c2 (diff) |
record proper datatypes for uniforms/samplers
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index d8c06f064d9..2f7002ceeb3 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2817,11 +2817,10 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, struct gl_program *prog = A->program; const char *varName = (char *) var->a_name; GLboolean success = GL_TRUE; - GLint texIndex; slang_ir_storage *store = NULL; int dbg = 0; - - texIndex = sampler_to_texture_index(var->type.specifier.type); + const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier); + const GLint texIndex = sampler_to_texture_index(var->type.specifier.type); if (texIndex != -1) { /* Texture sampler: @@ -2829,8 +2828,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) */ - GLenum datatype = GL_SAMPLER_2D; - GLint samplerUniform = _mesa_add_sampler(prog->Parameters, varName, datatype); + GLint samplerUniform + = _mesa_add_sampler(prog->Parameters, varName, datatype); store = _slang_new_ir_storage(PROGRAM_SAMPLER, samplerUniform, texIndex); if (dbg) printf("SAMPLER "); } @@ -2840,7 +2839,6 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * MAX2(var->array_len, 1); if (prog) { /* user-defined uniform */ - 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); |