]> git.tdb.fi Git - libs/gl.git/commitdiff
Better handling of array flag for generated interfaces
authorMikko Rasa <tdb@tdb.fi>
Sat, 12 Nov 2016 16:41:32 +0000 (18:41 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 12 Nov 2016 16:41:32 +0000 (18:41 +0200)
source/programcompiler.cpp

index f7d231615618178cecbcaf68ecf49caa2ae5835b..096a5d84927a062904f92e45b28421a554a0c07e 100644 (file)
@@ -491,8 +491,12 @@ bool ProgramCompiler::InterfaceGenerator::generate_interface(VariableDeclaration
        iface_var->type = var.type;
        iface_var->type_declaration = var.type_declaration;
        iface_var->name = name;
-       iface_var->array = (var.array || (stage->type==GEOMETRY && iface=="in"));
-       iface_var->array_size = var.array_size;
+       if(stage->type==GEOMETRY)
+               iface_var->array = ((var.array && var.interface!="in") || iface=="in");
+       else
+               iface_var->array = var.array;
+       if(iface_var->array)
+               iface_var->array_size = var.array_size;
        if(iface=="in")
                iface_var->linked_declaration = &var;
        iface_declarations[name] = iface_var;