Fix framework for R64 int images test
authorArkadiusz Sarwa <arkadiusz.sarwa@amd.com>
Tue, 7 Apr 2020 11:04:40 +0000 (13:04 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 17 Apr 2020 09:14:03 +0000 (05:14 -0400)
Affects:
dEQP-VK.api.info.*r64_*int
dEQP-VK.api.buffer_view.create.*.r64_*int
dEQP-VK.api.granularity*r64_*int

Components: Framework, Vulkan

VK-GL-CTS Issue: 2286

Change-Id: I675cbf34cd59733f5a73d987c16c3b3d323fd170

external/vulkancts/framework/vulkan/vkImageUtil.cpp
external/vulkancts/modules/vulkan/image/vktImageTestsUtil.cpp
external/vulkancts/modules/vulkan/texture/vktSampleVerifierUtil.cpp
framework/common/tcuTexture.cpp
framework/common/tcuTexture.hpp
framework/common/tcuTextureUtil.cpp
modules/internal/ditTextureFormatTests.cpp

index 037cc39..b24e432 100644 (file)
@@ -2099,6 +2099,8 @@ tcu::TextureFormat mapVkFormat (VkFormat format)
                case VK_FORMAT_R32G32B32A32_SINT:               return TextureFormat(TextureFormat::RGBA,       TextureFormat::SIGNED_INT32);
                case VK_FORMAT_R32G32B32A32_SFLOAT:             return TextureFormat(TextureFormat::RGBA,       TextureFormat::FLOAT);
 
+               case VK_FORMAT_R64_UINT:                                return TextureFormat(TextureFormat::R,          TextureFormat::UNSIGNED_INT64);
+               case VK_FORMAT_R64_SINT:                                return TextureFormat(TextureFormat::R,          TextureFormat::SIGNED_INT64);
                case VK_FORMAT_R64_SFLOAT:                              return TextureFormat(TextureFormat::R,          TextureFormat::FLOAT64);
                case VK_FORMAT_R64G64_SFLOAT:                   return TextureFormat(TextureFormat::RG,         TextureFormat::FLOAT64);
                case VK_FORMAT_R64G64B64_SFLOAT:                return TextureFormat(TextureFormat::RGB,        TextureFormat::FLOAT64);
index 76bb14b..fb60a10 100644 (file)
@@ -795,7 +795,7 @@ bool isPackedType (const vk::VkFormat format)
 {
        const tcu::TextureFormat        textureFormat   = mapVkFormat(format);
 
-       DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (textureFormat.type)
        {
index e33869b..06ac08b 100644 (file)
@@ -653,7 +653,7 @@ void convertNormalizedInt (deInt64          num,
 
 bool isPackedType (const TextureFormat::ChannelType type)
 {
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -678,7 +678,7 @@ void getPackInfo (const TextureFormat texFormat,
                                  IVec4& bitOffsets,
                                  int& baseTypeBytes)
 {
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (texFormat.type)
        {
index f5c85b6..4f2378f 100644 (file)
@@ -274,7 +274,7 @@ inline deUint16 convertSatRteUint12 (float f)
 inline float channelToFloat (const deUint8* value, TextureFormat::ChannelType type)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -306,7 +306,7 @@ inline float channelToFloat (const deUint8* value, TextureFormat::ChannelType ty
 inline int channelToInt (const deUint8* value, TextureFormat::ChannelType type)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -338,7 +338,7 @@ inline int channelToInt (const deUint8* value, TextureFormat::ChannelType type)
 void floatToChannel (deUint8* dst, float src, TextureFormat::ChannelType type)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -425,7 +425,7 @@ static inline deUint16 convertSatUint12 (S src)
 void intToChannel (deUint8* dst, int src, TextureFormat::ChannelType type)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -618,12 +618,14 @@ bool isValid (TextureFormat format)
                case TextureFormat::SIGNED_INT8:
                case TextureFormat::SIGNED_INT16:
                case TextureFormat::SIGNED_INT32:
+               case TextureFormat::SIGNED_INT64:
                        return isColor;
 
                case TextureFormat::UNSIGNED_INT8:
                case TextureFormat::UNSIGNED_INT16:
                case TextureFormat::UNSIGNED_INT24:
                case TextureFormat::UNSIGNED_INT32:
+               case TextureFormat::UNSIGNED_INT64:
                        return isColor || format.order == TextureFormat::S;
 
                case TextureFormat::HALF_FLOAT:
@@ -643,7 +645,7 @@ bool isValid (TextureFormat format)
                        return 0u;
        }
 
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 }
 
 int getNumUsedChannels (TextureFormat::ChannelOrder order)
@@ -683,7 +685,7 @@ int getNumUsedChannels (TextureFormat::ChannelOrder order)
 int getChannelSize (TextureFormat::ChannelType type)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -697,10 +699,12 @@ int getChannelSize (TextureFormat::ChannelType type)
                case TextureFormat::SIGNED_INT8:                return 1;
                case TextureFormat::SIGNED_INT16:               return 2;
                case TextureFormat::SIGNED_INT32:               return 4;
+               case TextureFormat::SIGNED_INT64:               return 8;
                case TextureFormat::UNSIGNED_INT8:              return 1;
                case TextureFormat::UNSIGNED_INT16:             return 2;
                case TextureFormat::UNSIGNED_INT24:             return 3;
                case TextureFormat::UNSIGNED_INT32:             return 4;
+               case TextureFormat::UNSIGNED_INT64:             return 8;
                case TextureFormat::HALF_FLOAT:                 return 2;
                case TextureFormat::FLOAT:                              return 4;
                case TextureFormat::FLOAT64:                    return 8;
@@ -721,7 +725,7 @@ int getPixelSize (TextureFormat format)
        DE_ASSERT(isValid(format));
 
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (type)
        {
@@ -3860,10 +3864,12 @@ std::ostream& operator<< (std::ostream& str, TextureFormat::ChannelType type)
                "SIGNED_INT8",
                "SIGNED_INT16",
                "SIGNED_INT32",
+               "SIGNED_INT64",
                "UNSIGNED_INT8",
                "UNSIGNED_INT16",
                "UNSIGNED_INT24",
                "UNSIGNED_INT32",
+               "UNSIGNED_INT64",
                "HALF_FLOAT",
                "FLOAT",
                "FLOAT64",
index b8d2be0..8baee3e 100644 (file)
@@ -101,10 +101,12 @@ public:
                SIGNED_INT8,
                SIGNED_INT16,
                SIGNED_INT32,
+               SIGNED_INT64,
                UNSIGNED_INT8,
                UNSIGNED_INT16,
                UNSIGNED_INT24,
                UNSIGNED_INT32,
+               UNSIGNED_INT64,
                HALF_FLOAT,
                FLOAT,
                FLOAT64,
index 785ebb4..ec5e6f4 100644 (file)
@@ -120,7 +120,7 @@ tcu::Vec4 linearToSRGBIfNeeded (const TextureFormat& format, const tcu::Vec4& co
 bool isCombinedDepthStencilType (TextureFormat::ChannelType type)
 {
        // make sure to update this if type table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        return  type == TextureFormat::UNSIGNED_INT_16_8_8                      ||
                        type == TextureFormat::UNSIGNED_INT_24_8                        ||
@@ -162,7 +162,7 @@ bool hasDepthComponent (TextureFormat::ChannelOrder order)
 TextureChannelClass getTextureChannelClass (TextureFormat::ChannelType channelType)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (channelType)
        {
@@ -196,10 +196,12 @@ TextureChannelClass getTextureChannelClass (TextureFormat::ChannelType channelTy
                case TextureFormat::SIGNED_INT8:                                        return TEXTURECHANNELCLASS_SIGNED_INTEGER;
                case TextureFormat::SIGNED_INT16:                                       return TEXTURECHANNELCLASS_SIGNED_INTEGER;
                case TextureFormat::SIGNED_INT32:                                       return TEXTURECHANNELCLASS_SIGNED_INTEGER;
+               case TextureFormat::SIGNED_INT64:                                       return TEXTURECHANNELCLASS_SIGNED_INTEGER;
                case TextureFormat::UNSIGNED_INT8:                                      return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
                case TextureFormat::UNSIGNED_INT16:                                     return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
                case TextureFormat::UNSIGNED_INT24:                                     return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
                case TextureFormat::UNSIGNED_INT32:                                     return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
+               case TextureFormat::UNSIGNED_INT64:                                     return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
                case TextureFormat::HALF_FLOAT:                                         return TEXTURECHANNELCLASS_FLOATING_POINT;
                case TextureFormat::FLOAT:                                                      return TEXTURECHANNELCLASS_FLOATING_POINT;
                case TextureFormat::FLOAT64:                                            return TEXTURECHANNELCLASS_FLOATING_POINT;
@@ -349,7 +351,7 @@ ConstPixelBufferAccess flipYAccess (const ConstPixelBufferAccess& access)
 static Vec2 getFloatChannelValueRange (TextureFormat::ChannelType channelType)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        float cMin = 0.0f;
        float cMax = 0.0f;
@@ -518,7 +520,7 @@ UVec4 getFormatMaxUintValue (const TextureFormat& format)
 static IVec4 getChannelBitDepth (TextureFormat::ChannelType channelType)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (channelType)
        {
@@ -587,7 +589,7 @@ IVec4 getTextureFormatBitDepth (const TextureFormat& format)
 static IVec4 getChannelMantissaBitDepth (TextureFormat::ChannelType channelType)
 {
        // make sure this table is updated if format table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        switch (channelType)
        {
@@ -1269,7 +1271,7 @@ template <typename AccessType>
 static AccessType toSamplerAccess (const AccessType& baseAccess, Sampler::DepthStencilMode mode)
 {
        // make sure to update this if type table is updated
-       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40);
+       DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 42);
 
        if (!isCombinedDepthStencilType(baseAccess.getFormat().type))
                return baseAccess;
index 7cbc5f8..ae9dabd 100644 (file)
@@ -879,6 +879,42 @@ static const deUint32 s_unsignedInt32IntRef[] =
        0x0e659f16, 0x6d8499b2, 0xf09486ef, 0x67f99d25,
 };
 
+static const deUint8 s_Int64In[] =
+{
+       0x90, 0xb0, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00,
+       0x40, 0x70, 0x38, 0x2a, 0x01, 0x01, 0x00, 0x00,
+       0x04, 0x0d, 0x67, 0x87, 0x01, 0x01, 0x01, 0x00,
+       0xfc, 0x37, 0xe6, 0x40, 0x01, 0x01, 0x01, 0x01,
+       0x09, 0x0e, 0xb6, 0x2f, 0x02, 0x01, 0x01, 0x01,
+       0x24, 0xde, 0x70, 0x2a, 0x01, 0x02, 0x01, 0x01,
+       0x16, 0x9f, 0x65, 0x0e, 0x01, 0x01, 0x02, 0x01,
+       0xef, 0x86, 0x94, 0x72, 0x01, 0x01, 0x01, 0x02,
+       0xc6, 0x7e, 0x50, 0x2a, 0x01, 0x00, 0x00, 0x00,
+       0x4d, 0xa9, 0x77, 0x0d, 0x01, 0x01, 0x00, 0x00,
+       0xf0, 0xb7, 0xde, 0x6b, 0x01, 0x01, 0x01, 0x00,
+       0xa8, 0x9c, 0xfc, 0x6d, 0x01, 0x01, 0x01, 0x01,
+       0xf3, 0x19, 0x14, 0x97, 0x02, 0x01, 0x01, 0x01,
+       0x95, 0x32, 0xab, 0x7a, 0x01, 0x02, 0x01, 0x01,
+       0x68, 0x84, 0xd9, 0x71, 0x01, 0x01, 0x02, 0x01,
+       0xf7, 0x73, 0x8f, 0x0a, 0x01, 0x01, 0x01, 0x02,
+};
+
+static const deUint32 s_Int64FloatRef[] =
+{
+       0x4fbc0058, 0x5380951c, 0x578080c4, 0x5b808081,
+       0x5b808081, 0x5b808101, 0x5b810081, 0x5c004040,
+       0x4f95283f, 0x538086bc, 0x578080b6, 0x5b808081,
+       0x5b808081, 0x5b808101, 0x5b810081, 0x5c004040,
+};
+
+static const deUint32 s_Int64IntRef[] =
+{
+       0x7800b090, 0x2a387040, 0x87670d04, 0x40e637fc,
+       0x2fb60e09, 0x2a70de24, 0x0e659f16, 0x729486ef,
+       0x2a507ec6, 0x0d77a94d, 0x6bdeb7f0, 0x6dfc9ca8,
+       0x971419f3, 0x7aab3295, 0x71d98468, 0x0a8f73f7,
+};
+
 static const deUint8 s_halfFloatIn[] =
 {
        0x2b, 0x74, 0x6a, 0x5d,
@@ -1159,10 +1195,13 @@ static const struct
        { s_signedInt8In,                               DE_LENGTH_OF_ARRAY(s_signedInt8In),                                     s_signedInt8FloatRef,                           s_signedInt8IntRef,                             s_signedInt8UintRef                             },
        { s_signedInt16In,                              DE_LENGTH_OF_ARRAY(s_signedInt16In),                            s_signedInt16FloatRef,                          s_signedInt16IntRef,                    s_signedInt16UintRef                    },
        { s_signedInt32In,                              DE_LENGTH_OF_ARRAY(s_signedInt32In),                            s_signedInt32FloatRef,                          s_signedInt32IntRef,                    s_signedInt32UintRef                    },
+       { s_Int64In,                                    DE_LENGTH_OF_ARRAY(s_Int64In),                                          s_Int64FloatRef,                                        s_Int64IntRef,                                  s_Int64IntRef                                   },
        { s_unsignedInt8In,                             DE_LENGTH_OF_ARRAY(s_unsignedInt8In),                           s_unsignedInt8FloatRef,                         s_unsignedInt8IntRef,                   s_unsignedInt8UintRef                   },
        { s_unsignedInt16In,                    DE_LENGTH_OF_ARRAY(s_unsignedInt16In),                          s_unsignedInt16FloatRef,                        s_unsignedInt16IntRef,                  s_unsignedInt16UintRef                  },
        { s_unsignedInt24In,                    DE_LENGTH_OF_ARRAY(s_unsignedInt24In),                          s_unsignedInt24FloatRef,                        s_unsignedInt24IntRef,                  s_unsignedInt24UintRef                  },
        { s_unsignedInt32In,                    DE_LENGTH_OF_ARRAY(s_unsignedInt32In),                          s_unsignedInt32FloatRef,                        s_unsignedInt32IntRef,                  s_unsignedInt32UintRef                  },
+       { s_Int64In,                                    DE_LENGTH_OF_ARRAY(s_Int64In),                                          s_Int64FloatRef,                                        s_Int64IntRef,                                  s_Int64IntRef                                   },
+
        { s_halfFloatIn,                                DE_LENGTH_OF_ARRAY(s_halfFloatIn),                                      s_halfFloatFloatRef,                            s_halfFloatIntRef,                              s_halfFloatUintRef                              },
        { s_floatIn,                                    DE_LENGTH_OF_ARRAY(s_floatIn),                                          s_floatFloatRef,                                        s_floatIntRef,                                  s_floatUintRef                                  },
        { s_float64In,                                  DE_LENGTH_OF_ARRAY(s_float64In),                                        s_float64FloatRef,                                      s_float64IntRef,                                s_float64IntRef                                 },
@@ -1670,6 +1709,10 @@ tcu::TestCaseGroup* createTextureFormatTests (tcu::TestContext& testCtx)
 
        for (int channelType = 0; channelType < TextureFormat::CHANNELTYPE_LAST; channelType++)
        {
+               // \todo [2020-04-08] Missing tests for SIGNED_INT64 and UNSIGNED_INT64
+               if (TextureFormat::SIGNED_INT64 == channelType || channelType == TextureFormat::UNSIGNED_INT64)
+                       continue;
+
                for (int channelOrder = 0; channelOrder < TextureFormat::CHANNELORDER_LAST; channelOrder++)
                {
                        const TextureFormat             format          ((TextureFormat::ChannelOrder)channelOrder, (TextureFormat::ChannelType)channelType);