From 66b4bb72aadcdacbd7cfc8d8ee5573ffc181b3d0 Mon Sep 17 00:00:00 2001 From: Noah Fredriks Date: Fri, 6 Oct 2017 17:43:54 -0400 Subject: [PATCH] Remove blindly enabling all device extensions 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 --- .../modules/vulkan/multiview/vktMultiViewRenderTests.cpp | 9 ++++----- .../vktSynchronizationOperationMultiQueueTests.cpp | 10 ++-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp index f7f3a7d..c32e30b 100644 --- a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp +++ b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp @@ -465,11 +465,10 @@ void MultiViewRenderTestInstance::createMultiViewDevices (void) m_hasMultiDrawIndirect = enabledFeatures.features.multiDrawIndirect; { - const std::vector deviceExtensions = enumerateDeviceExtensionProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice(), DE_NULL); - vector charDevExtensions; + vector 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(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; }; diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp index d9a5b5e..199bb67 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp @@ -118,12 +118,6 @@ public: } { - const std::vector deviceExtensions = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL); - std::vector 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(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; }; -- 2.7.4