From 123c801f106dd1157fc889eaec934272ac6be937 Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Fri, 29 May 2015 14:09:59 -0700 Subject: [PATCH] Allow different multiplication order in reflect() GLSL spec allows compiler to assume that multiplication is commutative. reflect() contains three multiplications which compiler can re-order based on the spec language. This change relaxes reflect() tests to allow both evaluation orders. Bug: 19408572 Change-Id: I78e5b6e6f7bc761b4c49f5e1d4a283fcc60bf512 --- android/cts/master/com.drawelements.deqp.gles3.xml | 86 ++++++++++++++++++++++ android/cts/master/gles3-master.txt | 24 ++++++ android/cts/master/src/gles3-test-issues.txt | 3 - modules/glshared/glsBuiltinPrecisionTests.cpp | 11 ++- 4 files changed, 119 insertions(+), 5 deletions(-) diff --git a/android/cts/master/com.drawelements.deqp.gles3.xml b/android/cts/master/com.drawelements.deqp.gles3.xml index d5f16a3..adaa5c6 100644 --- a/android/cts/master/com.drawelements.deqp.gles3.xml +++ b/android/cts/master/com.drawelements.deqp.gles3.xml @@ -58827,6 +58827,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/cts/master/gles3-master.txt b/android/cts/master/gles3-master.txt index 9ab6ea5..910726a 100644 --- a/android/cts/master/gles3-master.txt +++ b/android/cts/master/gles3-master.txt @@ -18039,6 +18039,30 @@ dEQP-GLES3.functional.shaders.builtin_functions.precision.faceforward.highp_frag dEQP-GLES3.functional.shaders.builtin_functions.precision.faceforward.highp_fragment.vec2 dEQP-GLES3.functional.shaders.builtin_functions.precision.faceforward.highp_fragment.vec3 dEQP-GLES3.functional.shaders.builtin_functions.precision.faceforward.highp_fragment.vec4 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_vertex.scalar +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_vertex.vec2 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_vertex.vec3 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_vertex.vec4 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_fragment.scalar +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_fragment.vec2 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_fragment.vec3 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.lowp_fragment.vec4 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_vertex.scalar +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_vertex.vec2 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_vertex.vec3 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_vertex.vec4 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_fragment.scalar +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_fragment.vec2 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_fragment.vec3 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.mediump_fragment.vec4 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_vertex.scalar +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_vertex.vec2 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_vertex.vec3 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_vertex.vec4 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_fragment.scalar +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_fragment.vec2 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_fragment.vec3 +dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.highp_fragment.vec4 dEQP-GLES3.functional.shaders.builtin_functions.precision.refract.lowp_vertex.scalar dEQP-GLES3.functional.shaders.builtin_functions.precision.refract.lowp_vertex.vec2 dEQP-GLES3.functional.shaders.builtin_functions.precision.refract.lowp_vertex.vec3 diff --git a/android/cts/master/src/gles3-test-issues.txt b/android/cts/master/src/gles3-test-issues.txt index d11aebb..1a6d2f5 100644 --- a/android/cts/master/src/gles3-test-issues.txt +++ b/android/cts/master/src/gles3-test-issues.txt @@ -38,9 +38,6 @@ dEQP-GLES3.functional.shaders.builtin_functions.precision.atan.mediump_fragment. dEQP-GLES3.functional.shaders.builtin_functions.precision.atan.mediump_fragment.vec3 dEQP-GLES3.functional.shaders.builtin_functions.precision.atan.mediump_fragment.vec4 -# Bug 19408572 -dEQP-GLES3.functional.shaders.builtin_functions.precision.reflect.* - # Bug 18323060 dEQP-GLES3.functional.shaders.random.all_features.fragment.16 diff --git a/modules/glshared/glsBuiltinPrecisionTests.cpp b/modules/glshared/glsBuiltinPrecisionTests.cpp index b954cad..73cdaa9 100644 --- a/modules/glshared/glsBuiltinPrecisionTests.cpp +++ b/modules/glshared/glsBuiltinPrecisionTests.cpp @@ -3055,6 +3055,8 @@ class Reflect : public DerivedFunc< { public: typedef typename Reflect::Ret Ret; + typedef typename Reflect::Arg0 Arg0; + typedef typename Reflect::Arg1 Arg1; typedef typename Reflect::ArgExprs ArgExprs; string getName (void) const @@ -3063,9 +3065,14 @@ public: } protected: - ExprP doExpand (ExpandContext&, const ArgExprs& args) const + ExprP doExpand (ExpandContext& ctx, const ArgExprs& args) const { - return args.a - (args.b * dot(args.b, args.a) * constant(2.0f)); + const ExprP& i = args.a; + const ExprP& n = args.b; + const ExprP dotNI = bindExpression("dotNI", ctx, dot(n, i)); + + return i - alternatives((n * dotNI) * constant(2.0f), + n * (dotNI * constant(2.0f))); } }; -- 2.7.4