本文整理汇总了C++中TType::getSecondarySize方法的典型用法代码示例。如果您正苦于以下问题:C++ TType::getSecondarySize方法的具体用法?C++ TType::getSecondarySize怎么用?C++ TType::getSecondarySize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TType
的用法示例。
在下文中一共展示了TType::getSecondarySize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
BuiltInFunctionEmulator::TBuiltInFunction
BuiltInFunctionEmulator::IdentifyFunction(
TOperator op, const TType& param1, const TType& param2)
{
// Right now for all the emulated functions with two parameters, the two
// parameters have the same type.
if (param1.getNominalSize() != param2.getNominalSize() ||
param1.getSecondarySize() != param2.getSecondarySize() ||
param1.getNominalSize() > 4 || param1.getSecondarySize() > 4)
return TFunctionUnknown;
unsigned int function = TFunctionUnknown;
switch (op) {
case EOpDistance:
function = TFunctionDistance1_1;
break;
case EOpDot:
function = TFunctionDot1_1;
break;
case EOpReflect:
function = TFunctionReflect1_1;
break;
default:
break;
}
if (function == TFunctionUnknown)
return TFunctionUnknown;
if (param1.isVector())
function += param1.getNominalSize() - 1;
return static_cast<TBuiltInFunction>(function);
}
示例2: getTypeName
TString TOutputGLSLBase::getTypeName(const TType &type)
{
TInfoSinkBase out;
if (type.isMatrix())
{
out << "mat";
out << type.getNominalSize();
if (type.getSecondarySize() != type.getNominalSize())
{
out << "x" << type.getSecondarySize();
}
}
else if (type.isVector())
{
switch (type.getBasicType())
{
case EbtFloat:
out << "vec";
break;
case EbtInt:
out << "ivec";
break;
case EbtBool:
out << "bvec";
break;
case EbtUInt:
out << "uvec";
break;
default:
UNREACHABLE();
}
out << type.getNominalSize();
}
else
{
if (type.getBasicType() == EbtStruct)
out << hashName(type.getStruct()->name());
else
out << type.getBasicString();
}
return TString(out.c_str());
}