diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-16 09:30:14 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-16 09:30:14 -0600 |
commit | 1f4997c2aaf424c8a12cc6fdb1dd994f66074a1d (patch) | |
tree | de14cfe88863d678bc618b54a7569f831fd7f590 /src/mesa/shader/slang/slang_typeinfo.c | |
parent | 1b39b92e6d7d3a7e6c39b985ffff32a79a510333 (diff) | |
download | external_mesa3d-1f4997c2aaf424c8a12cc6fdb1dd994f66074a1d.zip external_mesa3d-1f4997c2aaf424c8a12cc6fdb1dd994f66074a1d.tar.gz external_mesa3d-1f4997c2aaf424c8a12cc6fdb1dd994f66074a1d.tar.bz2 |
mesa: import latest GLSL code from gallium-0.1 branch
Diffstat (limited to 'src/mesa/shader/slang/slang_typeinfo.c')
-rw-r--r-- | src/mesa/shader/slang/slang_typeinfo.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 26f9f6c..b2f0f14 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -273,7 +273,7 @@ slang_type_specifier_compatible(const slang_type_specifier * x, GLboolean slang_typeinfo_construct(slang_typeinfo * ti) { - /*_mesa_bzero(ti, sizeof(*ti));*/ + _mesa_bzero(ti, sizeof(*ti)); slang_type_specifier_ctr(&ti->spec); ti->array_len = 0; return GL_TRUE; @@ -392,7 +392,6 @@ _slang_typeof_operation_(slang_operation * op, switch (op->type) { case SLANG_OPER_BLOCK_NO_NEW_SCOPE: case SLANG_OPER_BLOCK_NEW_SCOPE: - case SLANG_OPER_VARIABLE_DECL: case SLANG_OPER_ASM: case SLANG_OPER_BREAK: case SLANG_OPER_CONTINUE: @@ -477,6 +476,7 @@ _slang_typeof_operation_(slang_operation * op, } break; case SLANG_OPER_IDENTIFIER: + case SLANG_OPER_VARIABLE_DECL: { slang_variable *var; var = _slang_locate_variable(op->locals, op->a_id, GL_TRUE); @@ -875,6 +875,34 @@ _slang_type_is_vector(slang_type_specifier_type ty) /** + * Determine if a type is a float, float vector or float matrix. + * \return GL_TRUE if so, GL_FALSE otherwise + */ +GLboolean +_slang_type_is_float_vec_mat(slang_type_specifier_type ty) +{ + switch (ty) { + case SLANG_SPEC_FLOAT: + case SLANG_SPEC_VEC2: + case SLANG_SPEC_VEC3: + case SLANG_SPEC_VEC4: + case SLANG_SPEC_MAT2: + case SLANG_SPEC_MAT3: + case SLANG_SPEC_MAT4: + case SLANG_SPEC_MAT23: + case SLANG_SPEC_MAT32: + case SLANG_SPEC_MAT24: + case SLANG_SPEC_MAT42: + case SLANG_SPEC_MAT34: + case SLANG_SPEC_MAT43: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +/** * Given a vector type, return the type of the vector's elements. * For a matrix, return the type of the columns. */ |