Lines Matching refs:TIntermTyped
220 bool HlslParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node)
226 TIntermTyped* object = lhsAsAggregate->getSequence()[0]->getAsTyped();
253 TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* op, TIntermTyped*& node)
262 TIntermTyped* lhs = nodeAsUnary ? nodeAsUnary->getOperand() :
277 const auto makeLoad = [&](TIntermSymbol* rhsTmp, TIntermTyped* object, TIntermTyped* coord, const TType& derefType) {
290 const auto makeStore = [&](TIntermTyped* object, TIntermTyped* coord, TIntermSymbol* rhsTmp) {
302 const auto makeBinary = [&](TOperator op, TIntermTyped* lhs, TIntermTyped* rhs) {
356 const auto addSwizzle = [&](TIntermSymbol* var, TIntermBinary* swizzle) -> TIntermTyped* {
373 TIntermTyped* object = lhsAsAggregate->getSequence()[0]->getAsTyped();
374 TIntermTyped* coord = lhsAsAggregate->getSequence()[1]->getAsTyped();
382 TIntermTyped* rhs = nodeAsBinary->getRight();
431 TIntermTyped* coordTmp = coord;
478 TIntermTyped* coordTmp = makeInternalVariableNode(loc, "coordTemp", coord->getType());
500 TIntermTyped* coordTmp = makeInternalVariableNode(loc, "coordTemp", coord->getType());
647 TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, const TString* string)
662 TIntermTyped* node = nullptr;
675 TIntermTyped* container = intermediate.addSymbol(*variable, loc);
676 TIntermTyped* constNode = intermediate.addConstantUnion(anon->getMemberNumber(), loc);
722 TIntermTyped* HlslParseContext::handleBracketOperator(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
760 TIntermTyped* sbArray = indexStructBufferContent(loc, base);
768 TIntermTyped* element = intermediate.addIndex(idxOp, sbArray, index, loc);
779 TIntermTyped* HlslParseContext::makeIntegerIndex(TIntermTyped* index)
796 TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
805 TIntermTyped* result = handleBracketOperator(loc, base, index);
874 TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op,
875 TIntermTyped* left, TIntermTyped* right)
877 TIntermTyped* result = intermediate.addBinaryMath(op, left, right, loc);
885 TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const char* str, TOperator op,
886 TIntermTyped* childNode)
888 TIntermTyped* result = intermediate.addUnaryMath(op, childNode, loc);
931 TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TIntermTyped* base, const TString& field)
940 TIntermTyped* result = base;
983 TIntermTyped* index = intermediate.addConstantUnion(selectors[0], loc);
987 TIntermTyped* index = intermediate.addSwizzle(selectors, loc);
1029 TIntermTyped* index = intermediate.addSwizzle(selectors, loc);
1052 TIntermTyped* index = intermediate.addConstantUnion(member, loc);
1069 bool HlslParseContext::isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field)
1347 bool HlslParseContext::wasFlattened(const TIntermTyped* node) const
1354 bool HlslParseContext::wasSplit(const TIntermTyped* node) const
1363 TIntermTyped* HlslParseContext::flattenAccess(TIntermTyped* base, int member)
1367 TIntermTyped* flattened = flattenAccess(symbolNode.getId(), member, base->getQualifier().storage,
1372 TIntermTyped* HlslParseContext::flattenAccess(int uniqueId, int member, TStorageQualifier outerStorage,
2074 TIntermTyped* callingArgs = nullptr;
2096 TIntermTyped* callReturn = handleFunctionCall(loc, &callee, callingArgs);
2101 TIntermTyped* returnAssign;
2123 TIntermTyped* element = intermediate.addIndex(EOpIndexIndirect, intermediate.addSymbol(*entryPointOutput),
2329 TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermTyped* value)
2350 TIntermTyped*& arguments, TIntermTyped* newArg)
2365 TIntermTyped* HlslParseContext::assignPosition(const TSourceLoc& loc, TOperator op,
2366 TIntermTyped* left, TIntermTyped* right)
2381 TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc);
2390 TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc);
2391 TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc);
2392 TIntermTyped* index = intermediate.addConstantUnion(Y, loc);
2394 TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc);
2395 TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc);
2402 TIntermTyped* yNeg = intermediate.addUnaryMath(EOpNegative, rhsElement, loc);
2409 TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc);
2427 TIntermTyped* left, TIntermTyped* right)
2445 TIntermTyped* clipCullNode = isOutput ? left : right;
2447 TIntermTyped* internalNode = isOutput ? right : left;
2567 TIntermTyped* clipCullAssign = nullptr;
2594 const auto addIndex = [this, &loc](TIntermTyped* node, int pos) -> TIntermTyped* {
2606 TIntermTyped* clipCullMember = clipCullSym;
2622 TIntermTyped* internalMember = internalNode;
2660 TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op, TIntermTyped* left,
2661 TIntermTyped* right)
2674 const auto indexesSplit = [this](const TIntermTyped* node) -> bool {
2685 const auto assignsClipPos = [this](const TIntermTyped* node) -> bool {
2762 TIntermTyped* noFlattenRHS = intermediate.addSymbol(*rhsTempVar, loc);
2782 const auto getMember = [&](bool isLeft, const TType& type, int member, TIntermTyped* splitNode, int splitMember,
2784 -> TIntermTyped * {
2787 TIntermTyped* subTree;
2850 const std::function<void(TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight,
2852 traverse = [&](TIntermTyped* left, TIntermTyped* right, TIntermTyped* splitLeft, TIntermTyped* splitRight,
2875 TIntermTyped* subLeft = getMember(true, left->getType(), element, left, element,
2877 TIntermTyped* subRight = getMember(false, right->getType(), element, right, element,
2880 TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left->getType(), element, splitLeft,
2883 TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right->getType(), element, splitRight,
2910 TIntermTyped* subLeft = getMember(true, left->getType(), member, left, member,
2912 TIntermTyped* subRight = getMember(false, right->getType(), member, right, member,
2916 TIntermTyped* subSplitLeft = isSplitLeft ? getMember(true, left->getType(), member, splitLeft,
2919 TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right->getType(), member, splitRight,
2940 TIntermTyped* positionAssign = assignPosition(loc, op, subSplitLeft, subSplitRight);
2969 TIntermTyped* splitLeft = left;
2970 TIntermTyped* splitRight = right;
2980 TIntermTyped* splitLeftNonIo = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc);
3009 TIntermTyped* HlslParseContext::handleAssignToMatrixSwizzle(const TSourceLoc& loc, TOperator op, TIntermTyped* left,
3010 TIntermTyped* right)
3018 TIntermTyped* matrix = left->getAsBinaryNode()->getLeft()->getAsTyped();
3023 TIntermTyped* vectorAssign = nullptr;
3042 TIntermTyped* rightComp = intermediate.addIndex(EOpIndexDirect, vector,
3046 TIntermTyped* leftComp = intermediate.addIndex(EOpIndexDirect, matrix,
3092 TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc& loc, TIntermTyped* argTex,
3093 TIntermTyped* argSampler)
3221 TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TIntermTyped* buffer)
3232 TIntermTyped* counterVar = handleVariable(loc, &counterBlockName); // find the block structure
3233 TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct
3235 TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc);
3243 void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
3252 TIntermTyped* bufferObj = nullptr;
3268 const auto incDecCounter = [&](int incval) -> TIntermTyped* {
3269 TIntermTyped* incrementValue = intermediate.addConstantUnion(static_cast<unsigned int>(incval), loc, true);
3270 TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member
3285 TIntermTyped* argArray = indexStructBufferContent(loc, bufferObj);
3292 TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped()); // index
3324 TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped()); // index
3336 TIntermTyped* body = nullptr;
3340 TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex,
3345 TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc);
3349 TIntermTyped* vec = nullptr;
3354 TIntermTyped* offsetIdx = byteAddrIdxVar;
3365 TIntermTyped
3391 TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped()); // index
3392 TIntermTyped* argValue = argAggregate->getSequence()[2]->getAsTyped(); // value
3412 TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex,
3416 TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc);
3421 TIntermTyped* offsetIdx = byteAddrIdxVar;
3422 TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true);
3431 TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc);
3435 TIntermTyped* rValue;
3444 TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc);
3458 TIntermTyped* argNumItems = argAggregate->getSequence()[1]->getAsTyped(); // out num items
3459 TIntermTyped* argStride = numArgs > 2 ? argAggregate->getSequence()[2]->getAsTyped() : nullptr; // out stride
3466 TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems,
3470 TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray,
3472 TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc);
3483 TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride,
3510 TIntermTyped* argIndex = makeIntegerIndex(sequence[1]->getAsTyped()); // index
3515 TIntermTyped* element = intermediate.addIndex(idxOp, argArray, argIndex, loc);
3534 TIntermTyped* preIncValue = incDecCounter(-1); // result is original value
3542 TIntermTyped* oldCounter = incDecCounter(1);
3544 TIntermTyped* lValue = intermediate.addIndex(EOpIndexIndirect, argArray, oldCounter, loc);
3545 TIntermTyped* rValue = argAggregate->getSequence()[1]->getAsTyped();
3557 TIntermTyped* oldCounter = incDecCounter(-1);
3559 TIntermTyped* newCounter = intermediate.addBinaryNode(EOpAdd, oldCounter,
3645 void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
3651 const auto convertReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) -> TIntermTyped* {
3654 TIntermTyped* convertedResult = nullptr;
3672 TIntermTyped* shadowCopy = intermediate.addAssign(EOpAssign, intermediate.addSymbol(*sampleShadow, loc),
3691 TIntermTyped* structMember = intermediate.addIndex(EOpIndexDirectStruct,
3699 TIntermTyped* vec4Member = intermediate.addIndex(EOpIndexDirect,
3704 TIntermTyped* memberAssign = nullptr;
3709 TIntermTyped* structVecComponent = intermediate.addIndex(EOpIndexDirect, structMember,
3775 TIntermTyped *argSamp = argAggregate->getSequence()[0]->getAsTyped(); // sampler
3776 TIntermTyped *argCoord = argAggregate->getSequence()[1]->getAsTyped(); // coord
3779 TIntermTyped *w = intermediate.addConstantUnion(3, loc, true);
3780 TIntermTyped *argLod = intermediate.addIndex(EOpIndexDirect, argCoord, w, loc);
3813 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // sampler
3814 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // coord
3818 TIntermTyped* w = intermediate.addConstantUnion(3, loc, true);
3819 TIntermTyped* bias = intermediate.addIndex(EOpIndexDirect, arg1, w, loc);
3854 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
3855 TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped();
3856 TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped();
3857 TIntermTyped* argBias = nullptr;
3858 TIntermTyped* argOffset = nullptr;
3892 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
3893 TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped();
3894 TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped();
3895 TIntermTyped* argDDX = argAggregate->getSequence()[3]->getAsTyped();
3896 TIntermTyped* argDDY = argAggregate->getSequence()[4]->getAsTyped();
3897 TIntermTyped* argOffset = nullptr;
3932 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
3980 TIntermTyped* queryLod = mipQuery ? argAggregate->getSequence()[1]->getAsTyped() :
3991 TIntermTyped* sizeQueryAssign = intermediate.addAssign(EOpAssign,
4001 TIntermTyped* indexedOut = nullptr;
4005 TIntermTyped* component = intermediate.addConstantUnion(compNum, loc, true);
4013 TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + compNum]->getAsTyped();
4014 TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, indexedOut, loc);
4021 TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + numDims]->getAsTyped();
4028 TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, levelsQuery, loc);
4034 TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + numDims]->getAsTyped();
4041 TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, samplesQuery, loc);
4057 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
4058 TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped();
4059 TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped();
4060 TIntermTyped* argCmpVal = argAggregate->getSequence()[3]->getAsTyped();
4061 TIntermTyped* argOffset = nullptr;
4129 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
4130 TIntermTyped* argCoord = argAggregate->getSequence()[1]->getAsTyped();
4131 TIntermTyped* argOffset = nullptr;
4132 TIntermTyped* lodComponent = nullptr;
4133 TIntermTyped* coordSwizzle = nullptr;
4151 TIntermTyped* coordIdx = intermediate.addSwizzle(coordFields, loc);
4156 TIntermTyped* lodIdx = intermediate.addConstantUnion(coordFields.size(), loc, true);
4176 TIntermTyped* argSampleIdx = argAggregate->getSequence()[2]->getAsTyped();
4201 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
4202 TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped();
4203 TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped();
4204 TIntermTyped* argLod = argAggregate->getSequence()[3]->getAsTyped();
4205 TIntermTyped* argOffset = nullptr;
4232 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
4233 TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped();
4234 TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped();
4235 TIntermTyped* argOffset = nullptr;
4297 TIntermTyped* argTex = argAggregate->getSequence()[arg++]->getAsTyped();
4298 TIntermTyped* argSamp = argAggregate->getSequence()[arg++]->getAsTyped();
4299 TIntermTyped* argCoord = argAggregate->getSequence()[arg++]->getAsTyped();
4300 TIntermTyped* argOffset = nullptr;
4301 TIntermTyped* argOffsets[4] = { nullptr, nullptr, nullptr, nullptr };
4302 // TIntermTyped* argStatus = nullptr; // TODO: residency
4303 TIntermTyped* argCmp = nullptr;
4361 TIntermTyped* argChannel = intermediate.addConstantUnion(channel, loc, true);
4404 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
4405 TIntermTyped* argSamp = argAggregate->getSequence()[1]->getAsTyped();
4406 TIntermTyped* argCoord = argAggregate->getSequence()[2]->getAsTyped();
4414 TIntermTyped* lodComponent = intermediate.addConstantUnion(
4417 TIntermTyped* lodComponentIdx = intermediate.addIndex(EOpIndexDirect, txquerylod, lodComponent, loc);
4431 TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped();
4432 TIntermTyped* argSampIdx = argAggregate->getSequence()[1]->getAsTyped();
4443 TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, intermediate.addSymbol(*outSampleCount, loc),
4447 TIntermTyped* idxtest[4];
4462 TIntermTyped* index[4];
4474 TIntermTyped* test =
4493 const TIntermTyped* argSubpass =
4518 void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
4541 TIntermTyped* data = argAggregate->getSequence()[1]->getAsTyped();
4580 void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
4585 const auto imageAtomicParams = [this, &loc, &node](TIntermAggregate* atomic, TIntermTyped* load) {
4598 const auto isImageParam = [](TIntermTyped* image) -> bool {
4603 const auto lookupBuiltinVariable = [&](const char* name, TBuiltInVariable builtin, TType& type) -> TIntermTyped* {
4636 TIntermTyped* arg0 = argAggregate->getSequence()[1]->getAsTyped();
4637 TIntermTyped* arg1 = argAggregate->getSequence()[0]->getAsTyped();
4651 TIntermTyped* arg0 = fnUnary->getOperand();
4653 TIntermTyped* one = intermediate.addConstantUnion(1, type0, loc, true);
4662 TIntermTyped* typedArg = arguments->getAsTyped();
4684 TIntermTyped* arg0 = fnUnary->getOperand();
4702 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped();
4703 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped();
4704 TIntermTyped* arg2 = argAggregate->getSequence()[2]->getAsTyped();
4706 TIntermTyped* sinStatement = handleUnaryMath(loc, "sin", EOpSin, arg0);
4707 TIntermTyped* cosStatement = handleUnaryMath(loc, "cos", EOpCos, arg0);
4708 TIntermTyped* sinAssign = intermediate.addAssign(EOpAssign, arg1, sinStatement, loc);
4709 TIntermTyped* cosAssign = intermediate.addAssign(EOpAssign, arg2, cosStatement, loc);
4725 TIntermTyped* arg0 = fnUnary->getOperand();
4727 TIntermTyped* compareNode = nullptr;
4760 TIntermTyped* zero;
4779 TIntermTyped* arg0 = fnUnary->getOperand();
4780 TIntermTyped* log2 = handleUnaryMath(loc, "log2", EOpLog2, arg0);
4781 TIntermTyped* base = intermediate.addConstantUnion(0.301029995663981f, EbtFloat, loc, true);
4795 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped();
4796 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped();
4798 TIntermTyped* y = intermediate.addConstantUnion(1, loc, true);
4799 TIntermTyped* z = intermediate.addConstantUnion(2, loc, true);
4800 TIntermTyped* w = intermediate.addConstantUnion(3, loc, true);
4802 TIntermTyped* src0y = intermediate.addIndex(EOpIndexDirect, arg0, y, loc);
4803 TIntermTyped* src1y = intermediate.addIndex(EOpIndexDirect, arg1, y, loc);
4804 TIntermTyped* src0z = intermediate.addIndex(EOpIndexDirect, arg0, z, loc);
4805 TIntermTyped* src1w = intermediate.addIndex(EOpIndexDirect, arg1, w, loc);
4828 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // dest
4829 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // value
4830 TIntermTyped* arg2 = nullptr;
4873 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // dest
4874 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // cmp
4875 TIntermTyped* arg2 = argAggregate->getSequence()[2]->getAsTyped(); // value
4876 TIntermTyped* arg3 = argAggregate->getSequence()[3]->getAsTyped(); // orig
4906 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped(); // value
4907 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped(); // offset
4909 TIntermTyped* i28 = intermediate.addConstantUnion(28, loc, true);
4910 TIntermTyped* iU = handleBinaryMath(loc, ">>", EOpRightShift,
4914 TIntermTyped* recip16 = intermediate.addConstantUnion((1.0/16.0), EbtFloat, loc, true);
4915 TIntermTyped* floatOffset = handleBinaryMath(loc, "mul", EOpMul,
4934 TIntermTyped* n_dot_l = argAggregate->getSequence()[0]->getAsTyped();
4935 TIntermTyped* n_dot_h = argAggregate->getSequence()[1]->getAsTyped();
4936 TIntermTyped* m = argAggregate->getSequence()[2]->getAsTyped();
4944 TIntermTyped* zero = intermediate.addConstantUnion(0.0, EbtFloat, loc, true);
4959 TIntermTyped* compare = handleBinaryMath(loc, "<", EOpLessThan, min_ndot, zero);
4960 TIntermTyped* n_dot_h_m = handleBinaryMath(loc, "mul", EOpMul, n_dot_h, m); // n_dot_h * m
4977 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped();
4978 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped();
4993 TIntermTyped* convert = new TIntermUnary(EOpUint64BitsToDouble);
5005 TIntermTyped* argValue = node->getAsUnaryNode()->getOperand();
5006 TIntermTyped* zero = intermediate.addConstantUnion(0, loc, true);
5027 TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true);
5028 TIntermTyped* component = argValue->getType().isVector() ?
5034 TIntermTyped* unpackOp = new TIntermUnary(EOpUnpackHalf2x16);
5039 TIntermTyped* lowOrder = intermediate.addIndex(EOpIndexDirect, unpackOp, zero, loc);
5055 TIntermTyped* argValue = node->getAsUnaryNode()->getOperand();
5057 TIntermTyped* zero = intermediate.addConstantUnion(0.0, EbtFloat, loc, true);
5078 TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true);
5079 TIntermTyped* component = argValue->getType().isVector() ?
5091 TIntermTyped* packOp = new TIntermUnary(EOpPackHalf2x16);
5110 TIntermTyped* arg0 = node->getAsUnaryNode()->getOperand();
5116 TIntermTyped* swizzleIdx = intermediate.addSwizzle(selectors, loc);
5117 TIntermTyped* swizzled = intermediate.addIndex(EOpVectorSwizzle, arg0, swizzleIdx, loc);
5121 TIntermTyped* conversion = intermediate.addConstantUnion(255.001953f, EbtFloat, loc, true);
5122 TIntermTyped* rangeConverted = handleBinaryMath(loc, "mul", EOpMul, conversion, swizzled);
5137 TIntermTyped* arg0 = node->getAsUnaryNode()->getOperand();
5143 TIntermTyped* tmpArgAssign = intermediate.addAssign(EOpAssign,
5152 TIntermTyped* isnan = handleUnaryMath(loc, "isnan", EOpIsNan, intermediate.addSymbol(*tempArg, loc));
5155 TIntermTyped* notnan = handleUnaryMath(loc, "!", EOpLogicalNot, isnan);
5158 TIntermTyped* isinf = handleUnaryMath(loc, "isinf", EOpIsInf, intermediate.addSymbol(*tempArg, loc));
5161 TIntermTyped* notinf = handleUnaryMath(loc, "!", EOpLogicalNot, isinf);
5164 TIntermTyped* andNode = handleBinaryMath(loc, "and", EOpLogicalAnd, notnan, notinf);
5203 TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc,
5223 TIntermTyped* res = intermediate.addBuiltInFunctionCall(loc,
5249 TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermTyped* arguments)
5251 TIntermTyped* result = nullptr;
5294 TIntermTyped* arg0 = nullptr;
5362 static_cast<TIntermTyped*>(arguments)->getCompleteString().c_str());
5384 const TIntermTyped* fnNode = result;
5436 void HlslParseContext::pushFrontArguments(TIntermTyped* front, TIntermTyped*& arguments)
5451 void HlslParseContext::addGenMulArgumentConversion(const TSourceLoc& loc, TFunction& call, TIntermTyped*& args)
5461 TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped();
5462 TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped();
5526 void HlslParseContext::addInputArgumentConversions(const TFunction& function, TIntermTyped*& arguments)
5531 const auto setArg = [&](int paramNum, TIntermTyped* arg) {
5550 TIntermTyped* arg = function.getParamCount() == 1
5558 TIntermTyped* convArg = intermediate.addConversion(EOpFunctionCall, *function[param].type, arg);
5599 void HlslParseContext::expandArguments(const TSourceLoc& loc, const TFunction& function, TIntermTyped*& arguments)
5605 const auto setArg = [&](int paramNum, TIntermTyped* arg) {
5617 const auto setArgList = [&](int paramNum, const TVector<TIntermTyped*>& args) {
5624 [&](TIntermTyped* arg) {
5640 TIntermTyped* arg = function.getParamCount() == 1
5648 TVector<TIntermTyped*> memberArgs;
5672 TIntermTyped* HlslParseContext::addOutputArgumentConversions(const TFunction& function, TIntermOperator& intermNode)
5712 TIntermTyped* conversionTree = nullptr;
5736 TIntermTyped* tempAssign = handleAssign(arguments[i]->getLoc(), EOpAssign, arguments[i]->getAsTyped(),
5818 const TIntermTyped* unaryArg = nullptr;
5819 const TIntermTyped* arg0 = nullptr;
5944 const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true);
6173 TIntermTyped* HlslParseContext::convertConditionalExpression(const TSourceLoc& loc, TIntermTyped* condition,
6220 void HlslParseContext::variableCheck(TIntermTyped*& nodePtr)
6244 void HlslParseContext::constantValueCheck(TIntermTyped* node, const char* token)
6254 void HlslParseContext::integerCheck(const TIntermTyped* node, const char* token)
6576 void HlslParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair)
6687 TIntermTyped*& initializer)
6724 TIntermTyped* HlslParseContext::indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const
6732 TIntermTyped* arrayPosition = intermediate.addConstantUnion(unsigned(bufferStruct->size()-1), loc);
6734 TIntermTyped* argArray = intermediate.addIndex(EOpIndexDirectStruct, buffer, arrayPosition, loc);
7008 const TIntermTyped* node)
7285 TIntermTyped*& args)
7707 TIntermTyped* initializer)
7854 TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable)
7956 TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, const TType& type,
7957 TIntermTyped* initializer, TIntermTyped* scalarInit)
7992 TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped();
8083 TIntermTyped* emulatedConstructorArguments;
8102 void HlslParseContext::lengthenList(const TSourceLoc& loc, TIntermSequence& list, int size, TIntermTyped* scalarInit)
8118 TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type)
8156 TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type)
8184 TIntermTyped *newNode;
8242 TIntermTyped* constructor = intermediate.setAggregateOperator(aggrNode, op, type, loc);
8254 TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node,
8257 TIntermTyped* newNode;
8400 TIntermTyped* HlslParseContext::convertArray(TIntermTyped* node, const TType& type)
8409 TIntermTyped* constructee = node->getAsTyped();
8416 TIntermTyped* component;
8440 TIntermTyped* elementArg;
8473 TIntermTyped* HlslParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount,
8477 TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped());
9068 TIntermTyped* prevExpression = prevBranch->getExpression();
9069 TIntermTyped* newExpression = branchNode->getAsBranchNode()->getExpression();
9089 TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression,
9697 TIntermTyped* pcfArguments = nullptr;
9704 TIntermTyped* inputArg = nullptr;
9740 TIntermTyped* pcfCall = nullptr;
9789 TIntermTyped* callingArgs = nullptr;
9801 TIntermTyped* arg = nullptr;
9817 TIntermTyped* callReturn = handleFunctionCall(loc, &callee, callingArgs);
9818 TIntermTyped* index = intermediate.addConstantUnion(cpt, loc);
9820 TIntermTyped* element = intermediate.addIndex(EOpIndexDirect, perCtrlPtSym, index, loc);
9874 TIntermTyped* barrier = new TIntermAggregate(EOpBarrier);
9880 TIntermTyped* zero = intermediate.addConstantUnion(0, loc, true);
9881 TIntermTyped* cmp = intermediate.addBinaryNode(EOpEqual, invocationIdSym, zero, loc, TType(EbtBool));
9886 TIntermTyped* invocationIdTest = new TIntermSelection(cmp, pcfCallSequence, nullptr);