Fix template usage in precision tests
authorGraeme Leese <gleese@broadcom.com>
Tue, 25 Jun 2019 14:55:26 +0000 (15:55 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 3 Jul 2019 09:41:49 +0000 (05:41 -0400)
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

external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp

index 89d7e10..f2a7b1c 100644 (file)
@@ -2665,7 +2665,7 @@ protected:                                                                                                                                        \
        ExprP<TRET>             doExpand                (ExpandContext&,                                                \
                                                                         const CLASS::ArgExprs& args_) const    \
        {                                                                                                                                               \
-               const ExprP<float>& ARG0 = args_.a;                                                             \
+               const ExprP<T0>& ARG0 = args_.a;                                                                        \
                return EXPANSION;                                                                                                       \
        }                                                                                                                                               \
 };                                                                                                                                                     \
@@ -2685,7 +2685,7 @@ protected:                                                                                                                                                                \
        ExprP<TRET>             doExpand                (ExpandContext&,                                                                        \
                                                                         const CLASS::ArgExprs& args_) const                            \
        {                                                                                                                                                                       \
-               const ExprP<float>& ARG0 = args_.a;                                                                                             \
+               const ExprP<T0>& 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<Signature<TRET, T0> > /* NOLINT(CLASS) */     \
-{                                                                                                                                                      \
-public:                                                                                                                                                \
-       string                  getName         (void) const            { return #NAME; }               \
-                                                                                                                                                       \
-protected:                                                                                                                                     \
-       ExprP<TRET>             doExpand                (ExpandContext&,                                                \
-                                                                        const CLASS::ArgExprs& args_) const    \
-       {                                                                                                                                               \
-               const ExprP<deFloat16>& 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<Signature<TRET, T0> > /* NOLINT(CLASS) */     \
-{                                                                                                                                                      \
-public:                                                                                                                                                \
-       string                  getName         (void) const            { return #NAME; }               \
-                                                                                                                                                       \
-protected:                                                                                                                                     \
-       ExprP<TRET>             doExpand                (ExpandContext&,                                                \
-                                                                        const CLASS::ArgExprs& args_) const    \
-       {                                                                                                                                               \
-               const ExprP<deFloat16>& 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<TRET> NAME (const ExprP<T0>& arg0, const ExprP<T1>& arg1)                \