From c4369e72de671d69afdb274e11734c5765f5b3b9 Mon Sep 17 00:00:00 2001 From: Graeme Leese Date: Tue, 25 Jun 2019 15:55:26 +0100 Subject: [PATCH] Fix template usage in precision tests The definitions were duplicated for float and deFloat16 even though that is one of the template parameters. Use the parameters properly and we only need one copy. Components: Vulkan Affects (trivially): dEQP-VK.glsl.builtin.precision* Change-Id: Ic5487f43944cd6b8f8e8b04430a85df90b0407f4 --- .../vktShaderBuiltinPrecisionTests.cpp | 44 ++-------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp index 89d7e10..f2a7b1c 100644 --- a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp +++ b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp @@ -2665,7 +2665,7 @@ protected: \ ExprP doExpand (ExpandContext&, \ const CLASS::ArgExprs& args_) const \ { \ - const ExprP& ARG0 = args_.a; \ + const ExprP& ARG0 = args_.a; \ return EXPANSION; \ } \ }; \ @@ -2685,7 +2685,7 @@ protected: \ ExprP doExpand (ExpandContext&, \ const CLASS::ArgExprs& args_) const \ { \ - const ExprP& ARG0 = args_.a; \ + const ExprP& ARG0 = args_.a; \ return EXPANSION; \ } \ Interval getInputRange (const bool /*is16bit*/) const \ @@ -2698,47 +2698,11 @@ DEFINE_CONSTRUCTOR1(CLASS, TRET, NAME, T0) #define DEFINE_DERIVED_FLOAT1_INPUTRANGE(CLASS, NAME, ARG0, EXPANSION, INTERVAL) \ DEFINE_DERIVED1_INPUTRANGE(CLASS, float, NAME, float, ARG0, EXPANSION, INTERVAL) -#define DEFINE_DERIVED1_16BIT(CLASS, TRET, NAME, T0, ARG0, EXPANSION) \ -class CLASS : public DerivedFunc > /* NOLINT(CLASS) */ \ -{ \ -public: \ - string getName (void) const { return #NAME; } \ - \ -protected: \ - ExprP doExpand (ExpandContext&, \ - const CLASS::ArgExprs& args_) const \ - { \ - const ExprP& ARG0 = args_.a; \ - return EXPANSION; \ - } \ -}; \ -DEFINE_CONSTRUCTOR1(CLASS, TRET, NAME, T0) - -#define DEFINE_DERIVED1_INPUTRANGE_16BIT(CLASS, TRET, NAME, T0, ARG0, EXPANSION, INTERVAL) \ -class CLASS : public DerivedFunc > /* NOLINT(CLASS) */ \ -{ \ -public: \ - string getName (void) const { return #NAME; } \ - \ -protected: \ - ExprP doExpand (ExpandContext&, \ - const CLASS::ArgExprs& args_) const \ - { \ - const ExprP& ARG0 = args_.a; \ - return EXPANSION; \ - } \ - Interval getInputRange (const bool /*is16bit*/) const \ - { \ - return INTERVAL; \ - } \ -}; \ -DEFINE_CONSTRUCTOR1(CLASS, TRET, NAME, T0) - #define DEFINE_DERIVED_FLOAT1_16BIT(CLASS, NAME, ARG0, EXPANSION) \ - DEFINE_DERIVED1_16BIT(CLASS, deFloat16, NAME, deFloat16, ARG0, EXPANSION) + DEFINE_DERIVED1(CLASS, deFloat16, NAME, deFloat16, ARG0, EXPANSION) #define DEFINE_DERIVED_FLOAT1_INPUTRANGE_16BIT(CLASS, NAME, ARG0, EXPANSION, INTERVAL) \ - DEFINE_DERIVED1_INPUTRANGE_16BIT(CLASS, deFloat16, NAME, deFloat16, ARG0, EXPANSION, INTERVAL) + DEFINE_DERIVED1_INPUTRANGE(CLASS, deFloat16, NAME, deFloat16, ARG0, EXPANSION, INTERVAL) #define DEFINE_CONSTRUCTOR2(CLASS, TRET, NAME, T0, T1) \ ExprP NAME (const ExprP& arg0, const ExprP& arg1) \ -- 2.7.4