Web: Reclaim more space and make all work w/wo GLSLANG_WEB.
This commit is contained in:
parent
e5eee8fb03
commit
f8d1d7442b
13 changed files with 8983 additions and 2103 deletions
|
|
@ -801,10 +801,8 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
|||
//
|
||||
// Add a new newNode for the conversion.
|
||||
//
|
||||
TIntermUnary* newNode = nullptr;
|
||||
|
||||
TOperator newOp = EOpNull;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
bool convertToIntTypes = (convertTo == EbtInt8 || convertTo == EbtUint8 ||
|
||||
convertTo == EbtInt16 || convertTo == EbtUint16 ||
|
||||
convertTo == EbtInt || convertTo == EbtUint ||
|
||||
|
|
@ -838,7 +836,10 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
|||
(node->getBasicType() == EbtFloat16 && ! convertToFloatTypes))
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
TIntermUnary* newNode = nullptr;
|
||||
TOperator newOp = EOpNull;
|
||||
if (!buildConvertOp(convertTo, node->getBasicType(), newOp)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -847,11 +848,14 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
|||
newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
|
||||
|
||||
if (node->getAsConstantUnion()) {
|
||||
#ifndef GLSLANG_WEB
|
||||
// 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
|
||||
// to those types
|
||||
if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
|
||||
(getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
|
||||
(getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16))) {
|
||||
(getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16)))
|
||||
#endif
|
||||
{
|
||||
TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
|
||||
if (folded)
|
||||
return folded;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue