Merge vk-gl-cts/vulkan-cts-1.2.2 into vk-gl-cts/vulkan-cts-1.2.3
authorAlexander Galazin <alexander.galazin@arm.com>
Fri, 21 Aug 2020 14:19:50 +0000 (16:19 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Fri, 21 Aug 2020 14:19:50 +0000 (16:19 +0200)
Change-Id: Ide95e912e13d3a98a8f967bbe9233a2585aee268

external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemBufferValidator.hpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemCopyImageToBufferTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemFillUpdateCopyBufferTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemStorageBufferTests.cpp

index d9aaddc..6bff2ea 100644 (file)
@@ -82,17 +82,19 @@ template<typename T>
 class BufferValidator
 {
 public:
-                                                                       BufferValidator                 (const ValidationData<T> data)
+                                                                       BufferValidator                 (const ValidationData<T> data, vk::VkFormat format)
                                                                                : m_refData                     (data)
                                                                                , m_refDataStorage      (*reinterpret_cast<ValidationDataStorage<T>*>( &std::vector<char>(sizeof(ValidationDataStorage<T>), '\0').front()))
                                                                                , m_bufferType          (SAMPLER_BUFFER)
+                                                                               , m_format                      (format)
                                                                        {
                                                                        }
 
-                                                                       BufferValidator                 (const ValidationDataStorage<T> data)
+                                                                       BufferValidator                 (const ValidationDataStorage<T> data, vk::VkFormat format)
                                                                                : m_refData                     (*reinterpret_cast<ValidationData<T>*>( &std::vector<char>(sizeof(ValidationData<T>), '\0').front()))
                                                                                , m_refDataStorage      (data)
                                                                                , m_bufferType          (STORAGE_BUFFER)
+                                                                               , m_format                      (format)
                                                                        {
                                                                        }
 
@@ -110,6 +112,7 @@ private:
        const ValidationDataStorage<T>  m_refDataStorage;
 
        BufferType                                              m_bufferType;
+       vk::VkFormat                                    m_format;
 };
 
 template<>
@@ -239,7 +242,7 @@ bool BufferValidator<T>::validateBuffer (ProtectedContext&          ctx,
                                                DE_NULL,                                                                                // const void*                          pNext
                                                0u,                                                                                             // VkBufferViewCreateFlags      flags
                                                buffer,                                                                                 // VkBuffer                                     buffer
-                                               vk::VK_FORMAT_R32G32B32A32_UINT,                                // VkFormat                                     format
+                                               m_format,                                                                               // VkFormat                                     format
                                                0u,                                                                                             // VkDeviceSize                         offset
                                                VK_WHOLE_SIZE                                                                   // VkDeviceSize                         range
                                        };
index 1dedf15..b6f1a01 100644 (file)
@@ -82,10 +82,11 @@ public:
                                                                                                                 const std::string&             name,
                                                                                                                 vk::VkClearColorValue  fillValue,
                                                                                                                 ValidationData<T>              data,
-                                                                                                                CmdBufferType                  cmdBufferType)
+                                                                                                                CmdBufferType                  cmdBufferType,
+                                                                                                                vk::VkFormat                   format)
                                                                : TestCase                              (testCtx, name, "Copy image to buffer.")
                                                                , m_fillValue                   (fillValue)
-                                                               , m_validator                   (data)
+                                                               , m_validator                   (data, format)
                                                                , m_cmdBufferType               (cmdBufferType)
                                                        {
                                                        }
@@ -366,7 +367,7 @@ tcu::TestCaseGroup* createCopyImageToFloatBufferTests(tcu::TestContext& testCtx,
                DE_ASSERT(testData[ndx].data.positions[3].x() < MAX_POSITION);
 
                const std::string name = "copy_" + de::toString(ndx + 1);
-               copyStaticTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdBufferType));
+               copyStaticTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
        }
 
        /* Add a few randomized tests */
@@ -394,7 +395,7 @@ tcu::TestCaseGroup* createCopyImageToFloatBufferTests(tcu::TestContext& testCtx,
                DE_ASSERT(data.positions[2].x() < MAX_POSITION);
                DE_ASSERT(data.positions[3].x() < MAX_POSITION);
 
-               copyRandomTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), clearValue.color, data, cmdBufferType));
+               copyRandomTests->addChild(new CopyImageToBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), clearValue.color, data, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
        }
 
        std::string groupName = getCmdBufferTypeStr(cmdBufferType);
index d9211b5..9c6f9a4 100644 (file)
@@ -99,10 +99,11 @@ public:
                                                                                                                         deUint32                               fillValue,
                                                                                                                         ValidationData<T>              data,
                                                                                                                         CmdType                                cmdType,
-                                                                                                                        CmdBufferType                  cmdBufferType)
+                                                                                                                        CmdBufferType                  cmdBufferType,
+                                                                                                                        vk::VkFormat                   format)
                                                                : TestCase                      (testCtx, name, getTestTypeName(cmdType))
                                                                , m_fillValue           (fillValue)
-                                                               , m_validator           (data)
+                                                               , m_validator           (data, format)
                                                                , m_cmdType                     (cmdType)
                                                                , m_cmdBufferType       (cmdBufferType)
                                                        {
@@ -358,7 +359,7 @@ tcu::TestCaseGroup* createFillUpdateCopyBufferFloatTests (tcu::TestContext& test
 
                const std::string name = "test_" + de::toString(ndx + 1);
                staticTests->addChild(new FillUpdateCopyBufferTestCase<tcu::Vec4>(
-                                                       testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType));
+                       testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
        }
 
        /* Add a few randomized tests */
@@ -390,7 +391,7 @@ tcu::TestCaseGroup* createFillUpdateCopyBufferFloatTests (tcu::TestContext& test
                DE_ASSERT(data.positions[2].x() < MAX_POSITION);
                DE_ASSERT(data.positions[3].x() < MAX_POSITION);
 
-               randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType));
+               randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::Vec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SFLOAT));
        }
 
        const std::string                               groupName               = getCmdBufferTypeStr(cmdBufferType);
@@ -469,7 +470,7 @@ tcu::TestCaseGroup* createFillUpdateCopyBufferIntegerTests (tcu::TestContext& te
 
                const std::string name = "test_" + de::toString(ndx + 1);
                staticTests->addChild(new FillUpdateCopyBufferTestCase<tcu::IVec4>(
-                                                       testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType));
+                       testCtx, name.c_str(), testData[ndx].fillValue.uint, testData[ndx].data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SINT));
        }
 
        /* Add a few randomized tests */
@@ -501,7 +502,7 @@ tcu::TestCaseGroup* createFillUpdateCopyBufferIntegerTests (tcu::TestContext& te
                DE_ASSERT(data.positions[2].x() < MAX_POSITION);
                DE_ASSERT(data.positions[3].x() < MAX_POSITION);
 
-               randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::IVec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType));
+               randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::IVec4>(testCtx, name.c_str(), fillValue.uint, data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_SINT));
        }
 
        const std::string                               groupName               = getCmdBufferTypeStr(cmdBufferType);
@@ -577,7 +578,7 @@ tcu::TestCaseGroup* createFillUpdateCopyBufferUnsignedTests (tcu::TestContext& t
 
                const std::string name = "test_" + de::toString(ndx + 1);
                staticTests->addChild(new FillUpdateCopyBufferTestCase<tcu::UVec4>(
-                                                       testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdType, cmdBufferType));
+                       testCtx, name.c_str(), testData[ndx].fillValue, testData[ndx].data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_UINT));
        }
 
        /* Add a few randomized tests */
@@ -605,7 +606,7 @@ tcu::TestCaseGroup* createFillUpdateCopyBufferUnsignedTests (tcu::TestContext& t
                DE_ASSERT(data.positions[2].x() < MAX_POSITION);
                DE_ASSERT(data.positions[3].x() < MAX_POSITION);
 
-               randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::UVec4>(testCtx, name.c_str(), fillValue, data, cmdType, cmdBufferType));
+               randomTests->addChild(new FillUpdateCopyBufferTestCase<tcu::UVec4>(testCtx, name.c_str(), fillValue, data, cmdType, cmdBufferType, vk::VK_FORMAT_R32G32B32A32_UINT));
        }
 
        const std::string                               groupName               = getCmdBufferTypeStr(cmdBufferType);
index 2466a3d..6f8113f 100644 (file)
@@ -202,12 +202,13 @@ public:
                                                                                                                 const char*                            name,
                                                                                                                 const tcu::UVec4                       testInput,
                                                                                                                 ValidationDataStorage<T>       validationData,
+                                                                                                                vk::VkFormat                           format,
                                                                                                                 const std::string&                     extraShader = "")
                                                                        : TestCase              (testctx, name, getSSBOTestDescription(testType))
                                                                        , m_testType    (testType)
                                                                        , m_shaderType  (shaderType)
                                                                        , m_testInput   (testInput)
-                                                                       , m_validator   (validationData)
+                                                                       , m_validator   (validationData, format)
                                                                        , m_extraShader (extraShader)
                                                                {
                                                                }
@@ -676,7 +677,7 @@ tcu::TestCaseGroup* createSpecifiedStorageBufferTests (tcu::TestContext&                                            te
        for (size_t ndx = 0; ndx < testCount; ++ndx)
        {
                const std::string name = testTypeStr + "_" + de::toString(ndx + 1);
-               testGroup->addChild(new StorageBufferTestCase<tcu::UVec4>(testCtx, testType, shaderType, name.c_str(), testData[ndx].values, testData[ndx]));
+               testGroup->addChild(new StorageBufferTestCase<tcu::UVec4>(testCtx, testType, shaderType, name.c_str(), testData[ndx].values, testData[ndx], vk::VK_FORMAT_R32G32B32A32_UINT));
        }
 
        return testGroup.release();
@@ -871,7 +872,7 @@ tcu::TestCaseGroup* createAtomicStorageBufferTests (tcu::TestContext& testctx)
                                calculateAtomicOpData(atomicType, inputValue, atomicArg, atomicCall, refValue, testData[ndx].swapNdx);
 
                                ValidationDataStorage<tcu::UVec4>       validationData  = { refValue };
-                               staticTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, atomicCall));
+                               staticTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, vk::VK_FORMAT_R32G32B32A32_UINT, atomicCall));
                        }
 
                        de::MovePtr<tcu::TestCaseGroup> randomTests             (new tcu::TestCaseGroup(testctx, "random", (atomicDesc + " with random input").c_str()));
@@ -889,7 +890,7 @@ tcu::TestCaseGroup* createAtomicStorageBufferTests (tcu::TestContext& testctx)
                                calculateAtomicOpData(atomicType, inputValue, atomicArg, atomicCall, refValue, ndx);
 
                                ValidationDataStorage<tcu::UVec4>       validationData  = { refValue };
-                               randomTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, atomicCall));
+                               randomTests->addChild(new StorageBufferTestCase<tcu::UVec4>(testctx, SSBO_ATOMIC, shaderType, name.c_str(), inputValue, validationData, vk::VK_FORMAT_R32G32B32A32_UINT, atomicCall));
 
                        }