Fix exported varying bug & backwards compatibility.

This commit is contained in:
jbrodman
2014-03-24 00:01:37 -07:00
parent 792f04881c
commit 2c0a6d7f69
2 changed files with 15 additions and 2 deletions

View File

@@ -1204,7 +1204,12 @@ lEmitStructDecl(const StructType *st, std::vector<const StructType *> *emittedSt
for (int i = 0; i < st->GetElementCount(); ++i) {
const Type *type = st->GetElementType(i)->GetAsNonConstType();
std::string d = type->GetCDeclaration(st->GetElementName(i));
fprintf(file, " %s;\n", d.c_str());
if (type->IsVaryingType()) {
fprintf(file, " %s[%d];\n", d.c_str(), g->target->getVectorWidth());
}
else {
fprintf(file, " %s;\n", d.c_str());
}
}
fprintf(file, "};\n");
fprintf(file, "#endif\n\n");