Fix exported varying bug & backwards compatibility.
This commit is contained in:
@@ -1204,8 +1204,13 @@ 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));
|
||||
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");
|
||||
}
|
||||
|
||||
8
type.cpp
8
type.cpp
@@ -1909,7 +1909,15 @@ StructType::StructType(const std::string &n, const llvm::SmallVector<const Type
|
||||
|
||||
const std::string
|
||||
StructType::GetCStructName() const {
|
||||
// only return mangled name for varying structs for backwards
|
||||
// compatibility...
|
||||
|
||||
if (variability == Variability::Varying) {
|
||||
return lMangleStructName(name, variability);
|
||||
}
|
||||
else {
|
||||
return GetStructName();
|
||||
}
|
||||
}
|
||||
|
||||
Variability
|
||||
|
||||
Reference in New Issue
Block a user