本文整理汇总了C++中TIntermConstantUnion::getVectorSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntermConstantUnion::getVectorSize方法的具体用法?C++ TIntermConstantUnion::getVectorSize怎么用?C++ TIntermConstantUnion::getVectorSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntermConstantUnion
的用法示例。
在下文中一共展示了TIntermConstantUnion::getVectorSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fold
//.........这里部分代码省略.........
break;
case EOpDiv:
newConstArray = new TConstUnion[objectSize];
for (int i = 0; i < objectSize; i++) {
switch (getType().getBasicType()) {
case EbtDouble:
case EbtFloat:
newConstArray[i].setDConst(unionArray[i].getDConst() / rightUnionArray[i].getDConst());
break;
case EbtInt:
if (rightUnionArray[i] == 0) {
newConstArray[i].setIConst(0xEFFFFFFF);
} else
newConstArray[i].setIConst(unionArray[i].getIConst() / rightUnionArray[i].getIConst());
break;
case EbtUint:
if (rightUnionArray[i] == 0) {
newConstArray[i].setUConst(0xFFFFFFFF);
} else
newConstArray[i].setUConst(unionArray[i].getUConst() / rightUnionArray[i].getUConst());
break;
default:
return 0;
}
}
break;
case EOpMatrixTimesVector:
newConstArray = new TConstUnion[getMatrixRows()];
for (int i = 0; i < getMatrixRows(); i++) {
double sum = 0.0f;
for (int j = 0; j < node->getVectorSize(); j++) {
sum += unionArray[j*getMatrixRows() + i].getDConst() * rightUnionArray[j].getDConst();
}
newConstArray[i].setDConst(sum);
}
returnType.shallowCopy(TType(getBasicType(), EvqConst, getMatrixRows()));
break;
case EOpVectorTimesMatrix:
newConstArray = new TConstUnion[node->getMatrixCols()];
for (int i = 0; i < node->getMatrixCols(); i++) {
double sum = 0.0f;
for (int j = 0; j < getVectorSize(); j++)
sum += unionArray[j].getDConst() * rightUnionArray[i*node->getMatrixRows() + j].getDConst();
newConstArray[i].setDConst(sum);
}
returnType.shallowCopy(TType(getBasicType(), EvqConst, node->getMatrixCols()));
break;
case EOpMod:
newConstArray = new TConstUnion[objectSize];
for (int i = 0; i < objectSize; i++)
newConstArray[i] = unionArray[i] % rightUnionArray[i];
break;
case EOpRightShift:
newConstArray = new TConstUnion[objectSize];
for (int i = 0; i < objectSize; i++)
newConstArray[i] = unionArray[i] >> rightUnionArray[i];
break;