Rename operator enums so they can be autogenerated
Camel casing is removed from the enums where it differs from the GLSL
spec. This way it's easier to autogenerate code for built-in
functions mapped to operators.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2490d5d0e8ffb45eba343f225f76779e63381a65
Reviewed-on: https://chromium-review.googlesource.com/929361
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp b/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
index b6d998b..3ebecc5 100644
--- a/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
+++ b/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
@@ -38,10 +38,10 @@
// !(x > 0.0 || x < 0.0 || x == 0.0) will be optimized and always equal to false.
emu->addEmulatedFunction(
- EOpIsNan, float1,
+ EOpIsnan, float1,
"bool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? false : x != 0.0; }");
emu->addEmulatedFunction(
- EOpIsNan, float2,
+ EOpIsnan, float2,
"bvec2 isnan_emu(vec2 x)\n"
"{\n"
" bvec2 isnan;\n"
@@ -52,7 +52,7 @@
" return isnan;\n"
"}\n");
emu->addEmulatedFunction(
- EOpIsNan, float3,
+ EOpIsnan, float3,
"bvec3 isnan_emu(vec3 x)\n"
"{\n"
" bvec3 isnan;\n"
@@ -63,7 +63,7 @@
" return isnan;\n"
"}\n");
emu->addEmulatedFunction(
- EOpIsNan, float4,
+ EOpIsnan, float4,
"bvec4 isnan_emu(vec4 x)\n"
"{\n"
" bvec4 isnan;\n"
diff --git a/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp b/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
index e78d86d..f3a83bf 100644
--- a/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
+++ b/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
@@ -27,7 +27,7 @@
TType *float3 = new TType(EbtFloat, 3);
TType *float4 = new TType(EbtFloat, 4);
- emu->addEmulatedFunction(EOpIsNan, float1,
+ emu->addEmulatedFunction(EOpIsnan, float1,
"bool isnan_emu(float x)\n"
"{\n"
" return (x > 0.0 || x < 0.0) ? false : x != 0.0;\n"
@@ -35,7 +35,7 @@
"\n");
emu->addEmulatedFunction(
- EOpIsNan, float2,
+ EOpIsnan, float2,
"bool2 isnan_emu(float2 x)\n"
"{\n"
" bool2 isnan;\n"
@@ -47,7 +47,7 @@
"}\n");
emu->addEmulatedFunction(
- EOpIsNan, float3,
+ EOpIsnan, float3,
"bool3 isnan_emu(float3 x)\n"
"{\n"
" bool3 isnan;\n"
@@ -59,7 +59,7 @@
"}\n");
emu->addEmulatedFunction(
- EOpIsNan, float4,
+ EOpIsnan, float4,
"bool4 isnan_emu(float4 x)\n"
"{\n"
" bool4 isnan;\n"
diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
index c7319f5..61d4cf3 100644
--- a/src/compiler/translator/IntermNode.cpp
+++ b/src/compiler/translator/IntermNode.cpp
@@ -151,7 +151,7 @@
case EOpClamp:
case EOpMix:
case EOpStep:
- case EOpSmoothStep:
+ case EOpSmoothstep:
case EOpLdexp:
case EOpMulMatrixComponentWise:
case EOpOuterProduct:
@@ -1021,8 +1021,8 @@
static_cast<unsigned char>(mOperand->getType().getRows()),
static_cast<unsigned char>(mOperand->getType().getCols())));
break;
- case EOpIsInf:
- case EOpIsNan:
+ case EOpIsinf:
+ case EOpIsnan:
setType(TType(EbtBool, EbpUndefined, resultQualifier, operandPrimarySize));
break;
case EOpBitfieldReverse:
@@ -2537,12 +2537,12 @@
break;
}
- case EOpIsNan:
+ case EOpIsnan:
ASSERT(getType().getBasicType() == EbtFloat);
resultArray[i].setBConst(gl::isNaN(operandArray[0].getFConst()));
break;
- case EOpIsInf:
+ case EOpIsinf:
ASSERT(getType().getBasicType() == EbtFloat);
resultArray[i].setBConst(gl::isInf(operandArray[0].getFConst()));
break;
@@ -2607,7 +2607,7 @@
foldFloatTypeUnary(operandArray[i], &sqrtf, &resultArray[i]);
break;
- case EOpInverseSqrt:
+ case EOpInversesqrt:
// There is no stdlib built-in function equavalent for GLES built-in inversesqrt(),
// so getting the square root first using builtin function sqrt() and then taking
// its inverse.
@@ -3230,7 +3230,7 @@
break;
}
- case EOpSmoothStep:
+ case EOpSmoothstep:
{
ASSERT(basicType == EbtFloat);
resultArray = new TConstantUnion[maxObjectSize];
diff --git a/src/compiler/translator/Operator.cpp b/src/compiler/translator/Operator.cpp
index 7a21566..70140c5 100644
--- a/src/compiler/translator/Operator.cpp
+++ b/src/compiler/translator/Operator.cpp
@@ -151,7 +151,7 @@
return "log2";
case EOpSqrt:
return "sqrt";
- case EOpInverseSqrt:
+ case EOpInversesqrt:
return "inversesqrt";
case EOpAbs:
@@ -184,11 +184,11 @@
return "mix";
case EOpStep:
return "step";
- case EOpSmoothStep:
+ case EOpSmoothstep:
return "smoothstep";
- case EOpIsNan:
+ case EOpIsnan:
return "isnan";
- case EOpIsInf:
+ case EOpIsinf:
return "isinf";
case EOpFloatBitsToInt:
@@ -382,4 +382,4 @@
default:
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/compiler/translator/Operator.h b/src/compiler/translator/Operator.h
index 72f3dbf..6980ce0 100644
--- a/src/compiler/translator/Operator.h
+++ b/src/compiler/translator/Operator.h
@@ -119,7 +119,7 @@
EOpExp2,
EOpLog2,
EOpSqrt,
- EOpInverseSqrt,
+ EOpInversesqrt,
EOpAbs,
EOpSign,
@@ -136,9 +136,9 @@
EOpClamp,
EOpMix,
EOpStep,
- EOpSmoothStep,
- EOpIsNan,
- EOpIsInf,
+ EOpSmoothstep,
+ EOpIsnan,
+ EOpIsinf,
EOpFloatBitsToInt,
EOpFloatBitsToUint,
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 2e19264..f04127f 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -734,7 +734,7 @@
case EOpExp2:
case EOpLog2:
case EOpSqrt:
- case EOpInverseSqrt:
+ case EOpInversesqrt:
case EOpAbs:
case EOpSign:
case EOpFloor:
@@ -743,8 +743,8 @@
case EOpRoundEven:
case EOpCeil:
case EOpFract:
- case EOpIsNan:
- case EOpIsInf:
+ case EOpIsnan:
+ case EOpIsinf:
case EOpFloatBitsToInt:
case EOpFloatBitsToUint:
case EOpIntBitsToFloat:
@@ -955,7 +955,7 @@
case EOpClamp:
case EOpMix:
case EOpStep:
- case EOpSmoothStep:
+ case EOpSmoothstep:
case EOpFrexp:
case EOpLdexp:
case EOpDistance:
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index ecd2f76..faf6591 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -1519,7 +1519,7 @@
case EOpSqrt:
outputTriplet(out, visit, "sqrt(", "", ")");
break;
- case EOpInverseSqrt:
+ case EOpInversesqrt:
outputTriplet(out, visit, "rsqrt(", "", ")");
break;
case EOpAbs:
@@ -1547,14 +1547,14 @@
case EOpFract:
outputTriplet(out, visit, "frac(", "", ")");
break;
- case EOpIsNan:
+ case EOpIsnan:
if (node->getUseEmulatedFunction())
writeEmulatedFunctionTriplet(out, visit, node->getOp());
else
outputTriplet(out, visit, "isnan(", "", ")");
mRequiresIEEEStrictCompiling = true;
break;
- case EOpIsInf:
+ case EOpIsinf:
outputTriplet(out, visit, "isinf(", "", ")");
break;
case EOpFloatBitsToInt:
@@ -2085,7 +2085,7 @@
case EOpStep:
outputTriplet(out, visit, "step(", ", ", ")");
break;
- case EOpSmoothStep:
+ case EOpSmoothstep:
outputTriplet(out, visit, "smoothstep(", ", ", ")");
break;
case EOpFrexp:
diff --git a/src/compiler/translator/SymbolTable.cpp b/src/compiler/translator/SymbolTable.cpp
index 7f1273a..540d695 100644
--- a/src/compiler/translator/SymbolTable.cpp
+++ b/src/compiler/translator/SymbolTable.cpp
@@ -893,7 +893,7 @@
insertBuiltInOp(COMMON_BUILTINS, EOpExp2, genType, genType);
insertBuiltInOp(COMMON_BUILTINS, EOpLog2, genType, genType);
insertBuiltInOp(COMMON_BUILTINS, EOpSqrt, genType, genType);
- insertBuiltInOp(COMMON_BUILTINS, EOpInverseSqrt, genType, genType);
+ insertBuiltInOp(COMMON_BUILTINS, EOpInversesqrt, genType, genType);
//
// Common Functions.
@@ -933,16 +933,16 @@
insertBuiltInOp(ESSL3_BUILTINS, EOpMix, genType, genType, genType, genBType);
insertBuiltInOp(COMMON_BUILTINS, EOpStep, genType, genType, genType);
insertBuiltInOp(COMMON_BUILTINS, EOpStep, genType, float1, genType);
- insertBuiltInOp(COMMON_BUILTINS, EOpSmoothStep, genType, genType, genType, genType);
- insertBuiltInOp(COMMON_BUILTINS, EOpSmoothStep, genType, float1, float1, genType);
+ insertBuiltInOp(COMMON_BUILTINS, EOpSmoothstep, genType, genType, genType, genType);
+ insertBuiltInOp(COMMON_BUILTINS, EOpSmoothstep, genType, float1, float1, genType);
const TType *outGenType = StaticType::GetQualified<EbtGenType, EvqOut>();
const TType *outGenIType = StaticType::GetQualified<EbtGenIType, EvqOut>();
insertBuiltInOp(ESSL3_BUILTINS, EOpModf, genType, genType, outGenType);
- insertBuiltInOp(ESSL3_BUILTINS, EOpIsNan, genBType, genType);
- insertBuiltInOp(ESSL3_BUILTINS, EOpIsInf, genBType, genType);
+ insertBuiltInOp(ESSL3_BUILTINS, EOpIsnan, genBType, genType);
+ insertBuiltInOp(ESSL3_BUILTINS, EOpIsinf, genBType, genType);
insertBuiltInOp(ESSL3_BUILTINS, EOpFloatBitsToInt, genIType, genType);
insertBuiltInOp(ESSL3_BUILTINS, EOpFloatBitsToUint, genUType, genType);
insertBuiltInOp(ESSL3_BUILTINS, EOpIntBitsToFloat, genType, genIType);