From 3e9d784013f39f2bec82e4bf28a9e110904b51e5 Mon Sep 17 00:00:00 2001 From: JCB Date: Tue, 20 Aug 2013 16:14:29 -0400 Subject: [PATCH] Support exported arrays of varyings --- type.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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; }