summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-04 16:27:14 -0600
committerBrian Paul <[email protected]>2008-08-04 17:14:49 -0600
commit2d8551b30f38d111b60511700c690db1e5b2ab16 (patch)
tree580bed7052682890e52f0f51e026f0994af9d147
parent793bab2a368be6bbe93ab7f04b887f95c839c36b (diff)
mesa: glsl: check struct types in _slang_assignment_compatible()
-rw-r--r--src/mesa/shader/slang/slang_codegen.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b69943022a7..1c87f568574 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2851,7 +2851,20 @@ _slang_assignment_compatible(const slang_typeinfo *t0,
const slang_typeinfo *t1)
{
-#if 01 /* not used just yet - causes problems elsewhere */
+#if 0
+ GLuint sz0 = _slang_sizeof_type_specifier(&t0->spec);
+ GLuint sz1 = _slang_sizeof_type_specifier(&t1->spec);
+
+ if (sz0 != sz1)
+ return GL_FALSE;
+#endif
+
+ if (t0->spec.type == SLANG_SPEC_STRUCT &&
+ t1->spec.type == SLANG_SPEC_STRUCT &&
+ t0->spec._struct->a_name != t1->spec._struct->a_name)
+ return GL_FALSE;
+
+#if 0 /* not used just yet - causes problems elsewhere */
if (t0->spec.type == SLANG_SPEC_INT &&
t1->spec.type == SLANG_SPEC_FLOAT)
return GL_FALSE;