Merge vk-gl-cts/vulkan-cts-1.3.2 into vk-gl-cts/main
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / api / vktApiVersionCheck.cpp
index fd6a767..eda5b71 100644 (file)
@@ -36,6 +36,7 @@
 #include "vkApiVersion.hpp"
 #include "vkDefs.hpp"
 #include "vkPlatform.hpp"
+#include "vkSafetyCriticalUtil.hpp"
 
 #include "vktApiVersionCheck.hpp"
 #include "vktTestCase.hpp"
@@ -134,7 +135,7 @@ public:
                tcu::TestLog&                                           log                             = m_context.getTestContext().getLog();
                const deUint32                                          apiVersion              = m_context.getUsedApiVersion();
                const vk::Platform&                                     platform                = m_context.getTestContext().getPlatform().getVulkanPlatform();
-               de::MovePtr<vk::Library>                        vkLibrary               = de::MovePtr<vk::Library>(platform.createLibrary());
+               de::MovePtr<vk::Library>                        vkLibrary               = de::MovePtr<vk::Library>(platform.createLibrary(m_context.getTestContext().getCommandLine().getVkLibraryPath()));
                const tcu::FunctionLibrary&                     funcLibrary             = vkLibrary->getFunctionLibrary();
 
                deUint32                                                        failsQuantity   = 0u;
@@ -350,9 +351,47 @@ private:
                        &queuePriority
                };
 
+               void* pNext                                                                     = DE_NULL;
+#ifdef CTS_USES_VULKANSC
+               VkDeviceObjectReservationCreateInfo memReservationInfo  = context.getTestContext().getCommandLine().isSubProcess() ? context.getResourceInterface()->getStatMax() : resetDeviceObjectReservationCreateInfo();
+               memReservationInfo.pNext                                                                = pNext;
+               pNext                                                                                                   = &memReservationInfo;
+
+               VkPhysicalDeviceVulkanSC10Features sc10Features                 = createDefaultSC10Features();
+               sc10Features.pNext                                                                              = pNext;
+               pNext                                                                                                   = &sc10Features;
+
+               VkPipelineCacheCreateInfo                       pcCI;
+               std::vector<VkPipelinePoolSize>         poolSizes;
+               if (context.getTestContext().getCommandLine().isSubProcess())
+               {
+                       if (context.getResourceInterface()->getCacheDataSize() > 0)
+                       {
+                               pcCI =
+                               {
+                                       VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO,           // VkStructureType                              sType;
+                                       DE_NULL,                                                                                        // const void*                                  pNext;
+                                       VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT |
+                                               VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT,   // VkPipelineCacheCreateFlags   flags;
+                                       context.getResourceInterface()->getCacheDataSize(),     // deUintptr                                    initialDataSize;
+                                       context.getResourceInterface()->getCacheData()          // const void*                                  pInitialData;
+                               };
+                               memReservationInfo.pipelineCacheCreateInfoCount         = 1;
+                               memReservationInfo.pPipelineCacheCreateInfos            = &pcCI;
+                       }
+
+                       poolSizes                                                       = context.getResourceInterface()->getPipelinePoolSizes();
+                       if (!poolSizes.empty())
+                       {
+                               memReservationInfo.pipelinePoolSizeCount                = deUint32(poolSizes.size());
+                               memReservationInfo.pPipelinePoolSizes                   = poolSizes.data();
+                       }
+               }
+#endif // CTS_USES_VULKANSC
+
                const VkDeviceCreateInfo        deviceInfo              = {
                        VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
-                       DE_NULL,
+                       pNext,
                        static_cast<VkDeviceCreateFlags>(0u),
                        1u,
                        &queueInfo,