HLSL: Fix #802: Preserve promoted child under ! operator.
This commit is contained in:
parent
7e997e2612
commit
18958f6cd2
4 changed files with 253 additions and 4 deletions
|
|
@ -356,12 +356,12 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
|||
node->updatePrecision();
|
||||
|
||||
// If it's a (non-specialization) constant, it must be folded.
|
||||
if (child->getAsConstantUnion())
|
||||
return child->getAsConstantUnion()->fold(op, node->getType());
|
||||
if (node->getOperand()->getAsConstantUnion())
|
||||
return node->getOperand()->getAsConstantUnion()->fold(op, node->getType());
|
||||
|
||||
// If it's a specialization constant, the result is too,
|
||||
// if the operation is allowed for specialization constants.
|
||||
if (child->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node))
|
||||
if (node->getOperand()->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node))
|
||||
node->getWritableType().getQualifier().makeSpecConstant();
|
||||
|
||||
return node;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue