Remove blindly enabling all device extensions
authorNoah Fredriks <Noah.Fredriks@amd.com>
Fri, 6 Oct 2017 21:43:54 +0000 (17:43 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sat, 7 Oct 2017 15:49:49 +0000 (11:49 -0400)
A couple didn't need any or just one extension, but enabled all of
them.

This is not correct.  For example, AMD's Vulkan implementation exposes
both VK_KHR_maintenance1 and VK_AMD_negative_viewport_height, which
cannot be enabled at the same time according to VkDeviceCreateInfo
valid usage.

Components: vulkan

VK_GL_CTS Issue: 734, 736

Affects:
dEQP-VK.synchronization.op.multi_queue.*
dEQP-VK.multiview.*

Change-Id: I22682f15e0ef552d778e980c5f836c48d26d4905

external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp

index f7f3a7d..c32e30b 100644 (file)
@@ -465,11 +465,10 @@ void MultiViewRenderTestInstance::createMultiViewDevices (void)
        m_hasMultiDrawIndirect = enabledFeatures.features.multiDrawIndirect;
 
        {
-               const std::vector<VkExtensionProperties>        deviceExtensions        = enumerateDeviceExtensionProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice(), DE_NULL);
-               vector<const char*>                                                     charDevExtensions;
+               vector<const char*>                                                     deviceExtensions;
 
-               for (std::size_t ndx = 0; ndx < deviceExtensions.size(); ++ndx)
-                       charDevExtensions.push_back(deviceExtensions[ndx].extensionName);
+               if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_multiview"))
+                       deviceExtensions.push_back("VK_KHR_multiview");
 
                const VkDeviceCreateInfo                deviceInfo                      =
                {
@@ -481,7 +480,7 @@ void MultiViewRenderTestInstance::createMultiViewDevices (void)
                        0u,                                                                                                                             //deUint32                                                      enabledLayerCount;
                        DE_NULL,                                                                                                                //const char* const*                            ppEnabledLayerNames;
                        static_cast<deUint32>(deviceExtensions.size()),                                 //deUint32                                                      enabledExtensionCount;
-                       charDevExtensions.empty() ? DE_NULL : &charDevExtensions[0],    //const char* const*                            pEnabledExtensionNames;
+                       deviceExtensions.empty() ? DE_NULL : &deviceExtensions[0],              //const char* const*                            pEnabledExtensionNames;
                        DE_NULL                                                                                                                 //const VkPhysicalDeviceFeatures*       pEnabledFeatures;
                };
 
index d9a5b5e..199bb67 100644 (file)
@@ -118,12 +118,6 @@ public:
                }
 
                {
-                       const std::vector<VkExtensionProperties>        deviceExtensions        = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
-                       std::vector<const char*>                                        charDevExtensions;
-
-                       for (size_t ndx = 0; ndx < deviceExtensions.size(); ndx++)
-                               charDevExtensions.push_back(deviceExtensions[ndx].extensionName);
-
                        const VkDeviceCreateInfo                deviceInfo              =
                        {
                                VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,                                                   //VkStructureType                                       sType;
@@ -133,8 +127,8 @@ public:
                                &queueInfos[0],                                                                                                 //const VkDeviceQueueCreateInfo*        pQueueCreateInfos;
                                0u,                                                                                                                             //deUint32                                                      enabledLayerCount;
                                DE_NULL,                                                                                                                //const char* const*                            ppEnabledLayerNames;
-                               static_cast<deUint32>(deviceExtensions.size()),                                 //deUint32                                                      enabledExtensionCount;
-                               charDevExtensions.empty() ? DE_NULL : &charDevExtensions[0],    //const char* const*                            ppEnabledExtensionNames;
+                               0u,                                                                                                                             //deUint32                                                      enabledExtensionCount;
+                               DE_NULL,                                                                                                                //const char* const*                            ppEnabledExtensionNames;
                                &context.getDeviceFeatures()                                                                    //const VkPhysicalDeviceFeatures*       pEnabledFeatures;
                        };