TString TOutputGLSLBase::getTypeName(const TType& type) { TInfoSinkBase out; if (type.isMatrix()) { out << "mat"; out << type.getNominalSize(); } else if (type.isVector()) { switch (type.getBasicType()) { case EbtFloat: out << "vec"; break; case EbtInt: out << "ivec"; break; case EbtBool: out << "bvec"; break; default: UNREACHABLE(); break; } out << type.getNominalSize(); } else { if (type.getBasicType() == EbtStruct) out << hashName(type.getTypeName()); else out << type.getBasicString(); } return TString(out.c_str()); }
bool TParseContext::parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type) { if ((qualifier == EvqOut || qualifier == EvqInOut) && type.getBasicType() != EbtStruct && IsSampler(type.getBasicType())) { error(line, "samplers cannot be output parameters", type.getBasicString(), ""); return true; } return false; }