Commit 3e142e47 by Arun Patole Committed by Jamie Madill

Implement missing variants of abs/sign

This change adds ANGLE support for abs/sign variants introduced in ESSL3. BUG=angle:923 TEST=dEQP tests Tests passing 100% because of this change: dEQP-GLES3.functional.shaders.builtin_functions.common.abs dEQP-GLES3.functional.shaders.builtin_functions.common.sign Change-Id: If22032be2c1ed08451275262e311ef5ac613d45e Reviewed-on: https://chromium-review.googlesource.com/251060Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ed6be7e6
...@@ -151,11 +151,21 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR ...@@ -151,11 +151,21 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "abs", float3); symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "abs", float3);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "abs", float4); symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "abs", float4);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int1, "abs", int1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "abs", int2);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "abs", int3);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "abs", int4);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "sign", float1); symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "sign", float1);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "sign", float2); symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "sign", float2);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "sign", float3); symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "sign", float3);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "sign", float4); symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "sign", float4);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int1, "sign", int1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "sign", int2);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "sign", int3);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "sign", int4);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "floor", float1); symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "floor", float1);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "floor", float2); symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "floor", float2);
symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "floor", float3); symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "floor", float3);
...@@ -893,6 +903,8 @@ void IdentifyBuiltIns(sh::GLenum type, ShShaderSpec spec, ...@@ -893,6 +903,8 @@ void IdentifyBuiltIns(sh::GLenum type, ShShaderSpec spec,
symbolTable.relateToOperator(COMMON_BUILTINS, "step", EOpStep); symbolTable.relateToOperator(COMMON_BUILTINS, "step", EOpStep);
symbolTable.relateToOperator(COMMON_BUILTINS, "smoothstep", EOpSmoothStep); symbolTable.relateToOperator(COMMON_BUILTINS, "smoothstep", EOpSmoothStep);
symbolTable.relateToOperator(ESSL3_BUILTINS, "abs", EOpAbs);
symbolTable.relateToOperator(ESSL3_BUILTINS, "sign", EOpSign);
symbolTable.relateToOperator(ESSL3_BUILTINS, "min", EOpMin); symbolTable.relateToOperator(ESSL3_BUILTINS, "min", EOpMin);
symbolTable.relateToOperator(ESSL3_BUILTINS, "max", EOpMax); symbolTable.relateToOperator(ESSL3_BUILTINS, "max", EOpMax);
symbolTable.relateToOperator(ESSL3_BUILTINS, "clamp", EOpClamp); symbolTable.relateToOperator(ESSL3_BUILTINS, "clamp", EOpClamp);
......
...@@ -338,6 +338,8 @@ bool TIntermUnary::promote(TInfoSink &) ...@@ -338,6 +338,8 @@ bool TIntermUnary::promote(TInfoSink &)
break; break;
// operators for built-ins are already type checked against their prototype // operators for built-ins are already type checked against their prototype
case EOpAbs:
case EOpSign:
case EOpAny: case EOpAny:
case EOpAll: case EOpAll:
case EOpVectorLogicalNot: case EOpVectorLogicalNot:
......
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