Commit 9e5a19fd by steve-lunarg

HLSL: fix return type for isfinite

The prior decomposition of isfinite was not setting the return type on the sequence node. (Sequence was used because there's an internal temporary to avoid the complex rvalue problem).
parent ae79697d
uniform float f;
uniform float f;
uniform float2 f2;
uniform float3 f3;
bool test1(float v)
{
return !isnan(v) && isfinite(v);
}
float4 main() : SV_Target0
{
isfinite(f);
isfinite(f2);
isfinite(f3);
return 0;
}
......@@ -3907,25 +3907,27 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
TIntermAggregate* compoundStatement = intermediate.makeAggregate(tmpArgAssign, loc);
const TType boolType(EbtBool, EvqTemporary, arg0->getVectorSize(), arg0->getMatrixCols(), arg0->getMatrixRows());
TIntermTyped* isnan = handleUnaryMath(loc, "isnan", EOpIsNan, intermediate.addSymbol(*tempArg, loc));
isnan->setType(TType(EbtBool));
isnan->setType(boolType);
TIntermTyped* notnan = handleUnaryMath(loc, "!", EOpLogicalNot, isnan);
notnan->setType(TType(EbtBool));
notnan->setType(boolType);
TIntermTyped* isinf = handleUnaryMath(loc, "isinf", EOpIsInf, intermediate.addSymbol(*tempArg, loc));
isinf->setType(TType(EbtBool));
isinf->setType(boolType);
TIntermTyped* notinf = handleUnaryMath(loc, "!", EOpLogicalNot, isinf);
notinf->setType(TType(EbtBool));
notinf->setType(boolType);
TIntermTyped* andNode = handleBinaryMath(loc, "and", EOpLogicalAnd, notnan, notinf);
andNode->setType(TType(EbtBool));
andNode->setType(boolType);
compoundStatement = intermediate.growAggregate(compoundStatement, andNode);
compoundStatement->setOperator(EOpSequence);
compoundStatement->setLoc(loc);
compoundStatement->setType(TType(EbtVoid));
compoundStatement->setType(boolType);
node = compoundStatement;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment