]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/output.cpp
Create array type declarations as necessary
[libs/gl.git] / source / glsl / output.cpp
index f440fa8c01cb34ea31cbd9742020165f4b61546e..d44dbff99de3f1c0e6b59f244169ff18072f61d9 100644 (file)
@@ -243,7 +243,10 @@ void Formatter::visit(VariableDeclaration &var)
        }
        if(!var.precision.empty())
                append(format("%s ", var.precision));
-       append(format("%s %s", var.type_declaration->name, var.name));
+       string type_name = var.type_declaration->name;
+       if(var.array)
+               type_name = type_name.substr(0, type_name.find('['));
+       append(format("%s %s", type_name, var.name));
        if(var.array)
        {
                append('[');