Fix exported varying bug & backwards compatibility.
This commit is contained in:
@@ -1204,7 +1204,12 @@ lEmitStructDecl(const StructType *st, std::vector<const StructType *> *emittedSt
|
|||||||
for (int i = 0; i < st->GetElementCount(); ++i) {
|
for (int i = 0; i < st->GetElementCount(); ++i) {
|
||||||
const Type *type = st->GetElementType(i)->GetAsNonConstType();
|
const Type *type = st->GetElementType(i)->GetAsNonConstType();
|
||||||
std::string d = type->GetCDeclaration(st->GetElementName(i));
|
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, "};\n");
|
||||||
fprintf(file, "#endif\n\n");
|
fprintf(file, "#endif\n\n");
|
||||||
|
|||||||
10
type.cpp
10
type.cpp
@@ -1909,7 +1909,15 @@ StructType::StructType(const std::string &n, const llvm::SmallVector<const Type
|
|||||||
|
|
||||||
const std::string
|
const std::string
|
||||||
StructType::GetCStructName() const {
|
StructType::GetCStructName() const {
|
||||||
return lMangleStructName(name, variability);
|
// only return mangled name for varying structs for backwards
|
||||||
|
// compatibility...
|
||||||
|
|
||||||
|
if (variability == Variability::Varying) {
|
||||||
|
return lMangleStructName(name, variability);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return GetStructName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Variability
|
Variability
|
||||||
|
|||||||
Reference in New Issue
Block a user