diff options
author | Brian Paul <brianp@vmware.com> | 2010-02-13 13:52:37 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-02-13 13:52:39 -0700 |
commit | 26661ac0e10aba63de093e871e40d336696f4827 (patch) | |
tree | 0ad94855b9a89a01baf66a9495ab2c2eefdbea47 /src/mesa/shader/slang/slang_typeinfo.c | |
parent | b947b1d433ec5a847a3071c0daac7918924f3f49 (diff) |
glsl: added type layout field and new type compare func
Note: because of a weird dependency checking bug, a 'make clean' may be
needed before recompiling.
Diffstat (limited to 'src/mesa/shader/slang/slang_typeinfo.c')
-rw-r--r-- | src/mesa/shader/slang/slang_typeinfo.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 4a48bc8b8e..a96f2fb4c2 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -258,6 +258,7 @@ slang_fully_specified_type_copy(slang_fully_specified_type * x, z.precision = y->precision; z.variant = y->variant; z.centroid = y->centroid; + z.layout = y->layout; z.array_len = y->array_len; if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) { slang_fully_specified_type_destruct(&z); @@ -269,6 +270,32 @@ slang_fully_specified_type_copy(slang_fully_specified_type * x, } +/** + * Test if two fully specified types are compatible. This is a bit + * looser than testing for equality. We don't check the precision, + * variant, centroid, etc. information. + * XXX this may need some tweaking. + */ +GLboolean +slang_fully_specified_types_compatible(const slang_fully_specified_type * x, + const slang_fully_specified_type * y) +{ + if (!slang_type_specifier_equal(&x->specifier, &y->specifier)) + return GL_FALSE; + + if (x->qualifier == SLANG_QUAL_FIXEDINPUT && + y->qualifier == SLANG_QUAL_VARYING) + ; /* ok */ + else if (x->qualifier != y->qualifier) + return GL_FALSE; + + /* Note: don't compare precision, variant, centroid */ + + /* XXX array length? */ + + return GL_TRUE; +} + GLvoid slang_type_specifier_ctr(slang_type_specifier * self) |