diff --git a/type.cpp b/type.cpp index 9f1d7dbb..104dff69 100644 --- a/type.cpp +++ b/type.cpp @@ -1426,6 +1426,7 @@ ArrayType::GetCDeclaration(const std::string &name) const { } int soaWidth = base->GetSOAWidth(); + int vWidth = (base->IsVaryingType()) ? g->target->getNativeVectorWidth() : 0; base = base->GetAsUniformType(); std::string s = base->GetCDeclaration(name); @@ -1447,6 +1448,12 @@ ArrayType::GetCDeclaration(const std::string &name) const { s += buf; } + if (vWidth > 0) { + char buf[16]; + sprintf(buf, "[%d]", vWidth); + s += buf; + } + return s; }