diff options
author | Alan Hourihane <alanh@tungstengraphics.com> | 2008-11-05 11:59:12 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@tungstengraphics.com> | 2008-11-05 11:59:12 +0000 |
commit | 2382dc8aff9983da9ef1be03de38d4ab82105b19 (patch) | |
tree | 9a468d991fa58d0bb41244ee343410fd7dabdcf8 /src | |
parent | 9e1f0e173e5619d2ce95a74158803d94b3d6ff8a (diff) | |
parent | aab429c8df228271786890691a43786baf091b37 (diff) |
Merge commit 'origin/master' into gallium-0.2
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index d8a92e23c0..e7b2bad8c2 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3811,6 +3811,8 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (dbg) printf("VARYING "); } else if (var->type.qualifier == SLANG_QUAL_ATTRIBUTE) { + GLuint swizzle; + GLint index; /* attributes must be float, vec or mat */ if (!_slang_type_is_float_vec_mat(var->type.specifier.type)) { slang_info_log_error(A->log, @@ -3822,20 +3824,18 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (prog) { /* user-defined vertex attribute */ const GLint attr = -1; /* unknown */ - GLint index = _mesa_add_attribute(prog->Attributes, varName, - size, datatype, attr); + swizzle = _slang_var_swizzle(size, 0); + index = _mesa_add_attribute(prog->Attributes, varName, + size, datatype, attr); assert(index >= 0); - store = _slang_new_ir_storage(PROGRAM_INPUT, - VERT_ATTRIB_GENERIC0 + index, size); + index = VERT_ATTRIB_GENERIC0 + index; } else { /* pre-defined vertex attrib */ - GLuint swizzle; - GLint index = _slang_input_index(varName, GL_VERTEX_PROGRAM_ARB, - &swizzle); + index = _slang_input_index(varName, GL_VERTEX_PROGRAM_ARB, &swizzle); assert(index >= 0); - store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle); } + store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle); if (dbg) printf("ATTRIB "); } else if (var->type.qualifier == SLANG_QUAL_FIXEDINPUT) { |