From e1cd4204c7ca28648bb6ccc4d32af56d671edfa4 Mon Sep 17 00:00:00 2001 From: Alexander Galazin Date: Thu, 21 Sep 2017 16:03:04 -0500 Subject: [PATCH] Check API version in addition to present extensions Components: Vulkan VK-GL-CTS issue: 473 Change-Id: I07ff1b66b98046ac7975e92684e8003969c18345 --- .../vulkancts/framework/vulkan/vkQueryUtil.cpp | 53 +++++++++ .../vulkancts/framework/vulkan/vkQueryUtil.hpp | 6 + .../framework/vulkan/vkSupportedExtensions.inl | 6 +- .../api/vktApiBufferAndImageAllocationUtil.cpp | 4 +- .../modules/vulkan/api/vktApiBufferTests.cpp | 2 +- .../vulkan/api/vktApiBufferViewCreateTests.cpp | 3 +- .../vulkan/api/vktApiCommandBuffersTests.cpp | 2 +- .../vulkan/api/vktApiCopiesAndBlittingTests.cpp | 8 +- .../vulkan/api/vktApiDescriptorPoolTests.cpp | 3 +- .../vulkan/api/vktApiDeviceInitializationTests.cpp | 15 ++- .../vulkan/api/vktApiExternalMemoryTests.cpp | 123 +++++++++++---------- .../modules/vulkan/api/vktApiFeatureInfo.cpp | 37 ++++--- .../vulkan/api/vktApiImageClearingTests.cpp | 6 +- .../vulkan/api/vktApiObjectManagementTests.cpp | 4 +- .../binding_model/vktBindingShaderAccessTests.cpp | 12 +- .../modules/vulkan/clipping/vktClippingTests.cpp | 2 +- .../compute/vktComputeBasicComputeShaderTests.cpp | 12 +- .../draw/vktDrawNegativeViewportHeightTests.cpp | 3 +- .../draw/vktDrawShaderDrawParametersTests.cpp | 2 +- .../geometry/vktGeometryLayeredRenderingTests.cpp | 2 +- .../vktImageCompressionTranscodingSupport.cpp | 2 +- .../modules/vulkan/image/vktImageMutableTests.cpp | 4 +- .../image/vktImageTranscodingSupportTests.cpp | 2 +- .../vulkan/memory/vktMemoryAllocationTests.cpp | 34 +++--- .../vulkan/memory/vktMemoryBindingTests.cpp | 4 +- .../vulkan/memory/vktMemoryMappingTests.cpp | 2 +- .../vulkan/memory/vktMemoryRequirementsTests.cpp | 29 +++-- .../vulkan/multiview/vktMultiViewRenderTests.cpp | 4 +- .../pipeline/vktPipelineImageSamplingInstance.cpp | 6 +- .../pipeline/vktPipelineRenderToImageTests.cpp | 14 +-- .../protected_memory/vktProtectedMemContext.hpp | 2 +- .../protected_memory/vktProtectedMemUtils.cpp | 38 ++++--- .../protected_memory/vktProtectedMemUtils.hpp | 3 +- .../vulkan/renderpass/vktRenderPassTests.cpp | 10 +- .../shaderexecutor/vktOpaqueTypeIndexingTests.cpp | 2 +- .../sparse_resources/vktSparseResourcesBase.cpp | 3 +- .../vktSparseResourcesTestsUtil.cpp | 8 +- .../spirv_assembly/vktSpvAsmComputeShaderCase.cpp | 4 +- .../vktSpvAsmGraphicsShaderTestUtil.cpp | 4 +- .../vulkan/spirv_assembly/vktSpvAsmUtils.cpp | 27 ++--- .../vulkan/spirv_assembly/vktSpvAsmUtils.hpp | 16 +-- .../modules/vulkan/ssbo/vktSSBOLayoutCase.cpp | 2 +- ...vktSynchronizationCrossInstanceSharingTests.cpp | 36 +++--- .../vktSynchronizationOperation.cpp | 8 +- .../vktSynchronizationOperation.hpp | 5 +- .../vktSynchronizationWin32KeyedMutexTests.cpp | 26 +++-- .../tessellation/vktTessellationWindingTests.cpp | 2 +- external/vulkancts/modules/vulkan/vktTestCase.cpp | 9 +- .../modules/vulkan/wsi/vktWsiSurfaceTests.cpp | 34 +++--- .../vulkan/ycbcr/vktYCbCrConversionTests.cpp | 2 +- .../modules/vulkan/ycbcr/vktYCbCrUtil.cpp | 9 +- external/vulkancts/scripts/src/vulkan.h.in | 10 +- 52 files changed, 397 insertions(+), 269 deletions(-) diff --git a/external/vulkancts/framework/vulkan/vkQueryUtil.cpp b/external/vulkancts/framework/vulkan/vkQueryUtil.cpp index 3d3a816..511aed5 100644 --- a/external/vulkancts/framework/vulkan/vkQueryUtil.cpp +++ b/external/vulkancts/framework/vulkan/vkQueryUtil.cpp @@ -26,6 +26,7 @@ #include "deMemory.h" #include "deString.h" +#include "deSTLUtil.hpp" #include @@ -51,6 +52,26 @@ void getCoreDeviceExtensions(deUint32 apiVersion, vector& dst) getCoreDeviceExtensionsImpl(apiVersion, dst); } +bool isCoreInstanceExtension(const deUint32 apiVersion, const std::string& extension) +{ + vector coreExtensions; + getCoreInstanceExtensions(apiVersion, coreExtensions); + if (de::contains(coreExtensions.begin(), coreExtensions.end(), extension)) + return true; + + return false; +} + +bool isCoreDeviceExtension(const deUint32 apiVersion, const std::string& extension) +{ + vector coreExtensions; + getCoreDeviceExtensions(apiVersion, coreExtensions); + if (de::contains(coreExtensions.begin(), coreExtensions.end(), extension)) + return true; + + return false; +} + vector enumeratePhysicalDevices (const InstanceInterface& vk, VkInstance instance) { deUint32 numDevices = 0; @@ -364,6 +385,38 @@ bool isCompatible (const VkLayerProperties& layerProperties, const RequiredLayer return true; } +bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector& extensions, const std::string& required) +{ + if (isCoreInstanceExtension(instanceVersion, required)) + return true; + else + return de::contains(extensions.begin(), extensions.end(), required); +} + +bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector& extensions, const std::string& required) +{ + if (isCoreDeviceExtension(deviceVersion, required)) + return true; + else + return de::contains(extensions.begin(), extensions.end(), required); +} + +bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector& extensions, const RequiredExtension& required) +{ + if (isCoreInstanceExtension(instanceVersion, required.name)) + return true; + else + return isExtensionSupported(extensions.begin(), extensions.end(), required); +} + +bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector& extensions, const RequiredExtension& required) +{ + if (isCoreDeviceExtension(deviceVersion, required.name)) + return true; + else + return isExtensionSupported(extensions.begin(), extensions.end(), required); +} + bool isExtensionSupported (const std::vector& extensions, const RequiredExtension& required) { return isExtensionSupported(extensions.begin(), extensions.end(), required); diff --git a/external/vulkancts/framework/vulkan/vkQueryUtil.hpp b/external/vulkancts/framework/vulkan/vkQueryUtil.hpp index ca39bdb..3c98b14 100644 --- a/external/vulkancts/framework/vulkan/vkQueryUtil.hpp +++ b/external/vulkancts/framework/vulkan/vkQueryUtil.hpp @@ -36,6 +36,8 @@ namespace vk void getCoreInstanceExtensions (deUint32 apiVersion, std::vector& dst); void getCoreDeviceExtensions (deUint32 apiVersion, std::vector& dst); +bool isCoreInstanceExtension (const deUint32 apiVersion, const std::string& extension); +bool isCoreDeviceExtension (const deUint32 apiVersion, const std::string& extension); // API queries @@ -109,6 +111,10 @@ bool isCompatible (const VkLayerProperties& layerProperties, cons template bool isExtensionSupported (ExtensionIterator begin, ExtensionIterator end, const RequiredExtension& required); bool isExtensionSupported (const std::vector& extensions, const RequiredExtension& required); +bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector& extensions, const std::string& required); +bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector& extensions, const std::string& required); +bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector& extensions, const RequiredExtension& required); +bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector& extensions, const RequiredExtension& required); template bool isLayerSupported (LayerIterator begin, LayerIterator end, const RequiredLayer& required); diff --git a/external/vulkancts/framework/vulkan/vkSupportedExtensions.inl b/external/vulkancts/framework/vulkan/vkSupportedExtensions.inl index 039e99a..9aa6ef0 100644 --- a/external/vulkancts/framework/vulkan/vkSupportedExtensions.inl +++ b/external/vulkancts/framework/vulkan/vkSupportedExtensions.inl @@ -10,8 +10,13 @@ void getCoreDeviceExtensionsImpl (deUint32 coreVersion, ::std::vector& extensions = context.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_dedicated_allocation") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation"); if (!isSupported) { TCU_THROW(NotSupportedError, "Not supported"); @@ -151,7 +151,7 @@ void ImageDedicatedAllocation::createTestImage (tcu::IVec2 size, { DE_UNREF(allocator); const std::vector& extensions = context.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_dedicated_allocation") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation"); if (!isSupported) { TCU_THROW(NotSupportedError, "Not supported"); diff --git a/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp index 308cc74..3bd7780 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp @@ -288,7 +288,7 @@ class DedicatedAllocationBuffersTestCase : public TestCase tcu::TestLog& log = m_testCtx.getLog(); log << tcu::TestLog::Message << getBufferUsageFlagsStr(m_testCase.usage) << tcu::TestLog::EndMessage; const std::vector& extensions = ctx.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_dedicated_allocation") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(ctx.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation"); if (!isSupported) { TCU_THROW(NotSupportedError, "Not supported"); diff --git a/external/vulkancts/modules/vulkan/api/vktApiBufferViewCreateTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiBufferViewCreateTests.cpp index 899c1e5..5279918 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiBufferViewCreateTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiBufferViewCreateTests.cpp @@ -29,6 +29,7 @@ #include "tcuTestLog.hpp" #include "vkPrograms.hpp" #include "vkRefUtil.hpp" +#include "vkQueryUtil.hpp" #include "vktTestCase.hpp" namespace vkt @@ -196,7 +197,7 @@ tcu::TestStatus BufferDedicatedAllocation::createTestBuffer (VkDeviceSize Move& memory) const { const std::vector& extensions = context.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_dedicated_allocation") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation"); if (!isSupported) TCU_THROW(NotSupportedError, "Not supported"); diff --git a/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp index 9b3d4a9..832c40b 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp @@ -1224,7 +1224,7 @@ bool executeSecondaryCmdBuffer (Context& context, tcu::TestStatus trimCommandPoolTest (Context& context, const VkCommandBufferLevel cmdBufferLevel) { - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1")) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1")) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported"); const VkDevice vkDevice = context.getDevice(); diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 15e7851..ca1af21 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -325,10 +325,8 @@ CopiesAndBlittingTestInstance::CopiesAndBlittingTestInstance (Context& context, if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); } // Create command pool @@ -863,7 +861,7 @@ CopyImageToImage::CopyImageToImage (Context& context, TestParams params) if ((m_params.dst.image.imageType == VK_IMAGE_TYPE_3D && m_params.src.image.imageType == VK_IMAGE_TYPE_2D) || (m_params.dst.image.imageType == VK_IMAGE_TYPE_2D && m_params.src.image.imageType == VK_IMAGE_TYPE_3D)) { - if (std::find(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1") == context.getDeviceExtensions().end()) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1")) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported"); } diff --git a/external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp index 5aa91c4..6d582c8 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp @@ -29,6 +29,7 @@ #include "vkRefUtil.hpp" #include "vkPlatform.hpp" #include "vkDeviceUtil.hpp" +#include "vkQueryUtil.hpp" #include "tcuCommandLine.hpp" #include "tcuTestLog.hpp" @@ -147,7 +148,7 @@ tcu::TestStatus outOfPoolMemoryTest (Context& context) { const DeviceInterface& vkd = context.getDeviceInterface(); const VkDevice device = context.getDevice(); - const bool expectOutOfPoolMemoryError = de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1"); + const bool expectOutOfPoolMemoryError = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"); deUint32 numErrorsReturned = 0; const struct FailureCase diff --git a/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp index 579c9e5..4a82f15 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp @@ -635,15 +635,20 @@ tcu::TestStatus createDeviceWithVariousQueueCountsTest (Context& context) Move createInstanceWithExtension (const PlatformInterface& vkp, const char* extensionName, Context& context) { - const vector instanceExts = enumerateInstanceExtensionProperties(vkp, DE_NULL); + const vector instanceExts = enumerateInstanceExtensionProperties(vkp, DE_NULL); vector enabledExts; - if (!isExtensionSupported(instanceExts, RequiredExtension(extensionName))) - TCU_THROW(NotSupportedError, (string(extensionName) + " is not supported").c_str()); + const deUint32 instanceVersion = context.getUsedApiVersion(); - enabledExts.push_back(extensionName); + if (!isCoreInstanceExtension(instanceVersion, extensionName)) + { + if (!isExtensionSupported(instanceExts, RequiredExtension(extensionName))) + TCU_THROW(NotSupportedError, (string(extensionName) + " is not supported").c_str()); + else + enabledExts.push_back(extensionName); + } - return createDefaultInstance(vkp, context.getUsedApiVersion(), vector() /* layers */, enabledExts); + return createDefaultInstance(vkp, instanceVersion, vector() /* layers */, enabledExts); } tcu::TestStatus createDeviceFeatures2Test (Context& context) diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp index ccb0485..aaa657e 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp @@ -27,6 +27,7 @@ #include "vkQueryUtil.hpp" #include "vkPlatform.hpp" #include "vkMemUtil.hpp" +#include "vkApiVersion.hpp" #include "tcuTestLog.hpp" @@ -175,22 +176,27 @@ deUint32 chooseQueueFamilyIndex (const vk::InstanceInterface& vki, TCU_THROW(NotSupportedError, "Queue type not supported"); } -std::vector getInstanceExtensions (const vk::VkExternalSemaphoreHandleTypeFlags externalSemaphoreTypes, - const vk::VkExternalMemoryHandleTypeFlags externalMemoryTypes, +std::vector getInstanceExtensions (const deUint32 instanceVersion, + const vk::VkExternalSemaphoreHandleTypeFlags externalSemaphoreTypes, + const vk::VkExternalMemoryHandleTypeFlags externalMemoryTypes, const vk::VkExternalFenceHandleTypeFlags externalFenceTypes) { std::vector instanceExtensions; - instanceExtensions.push_back("VK_KHR_get_physical_device_properties2"); + if (!vk::isCoreInstanceExtension(instanceVersion, "VK_KHR_get_physical_device_properties2")) + instanceExtensions.push_back("VK_KHR_get_physical_device_properties2"); if (externalSemaphoreTypes != 0) - instanceExtensions.push_back("VK_KHR_external_semaphore_capabilities"); + if (!vk::isCoreInstanceExtension(instanceVersion, "VK_KHR_external_semaphore_capabilities")) + instanceExtensions.push_back("VK_KHR_external_semaphore_capabilities"); if (externalMemoryTypes != 0) - instanceExtensions.push_back("VK_KHR_external_memory_capabilities"); + if (!vk::isCoreInstanceExtension(instanceVersion, "VK_KHR_external_memory_capabilities")) + instanceExtensions.push_back("VK_KHR_external_memory_capabilities"); if (externalFenceTypes != 0) - instanceExtensions.push_back("VK_KHR_external_fence_capabilities"); + if (!vk::isCoreInstanceExtension(instanceVersion, "VK_KHR_external_fence_capabilities")) + instanceExtensions.push_back("VK_KHR_external_fence_capabilities"); return instanceExtensions; } @@ -204,7 +210,7 @@ vk::Move createInstance (const vk::PlatformInterface& vkp, { deUint32 version = 0u; vkp.enumerateInstanceVersion(&version); - return vk::createDefaultInstance(vkp, version, std::vector(), getInstanceExtensions(externalSemaphoreTypes, externalMemoryTypes, externalFenceTypes)); + return vk::createDefaultInstance(vkp, version, std::vector(), getInstanceExtensions(version, externalSemaphoreTypes, externalMemoryTypes, externalFenceTypes)); } catch (const vk::Error& error) { @@ -215,7 +221,8 @@ vk::Move createInstance (const vk::PlatformInterface& vkp, } } -vk::Move createDevice (const vk::InstanceInterface& vki, +vk::Move createDevice (const deUint32 apiVersion, + const vk::InstanceInterface& vki, vk::VkPhysicalDevice physicalDevice, const vk::VkExternalSemaphoreHandleTypeFlags externalSemaphoreTypes, const vk::VkExternalMemoryHandleTypeFlags externalMemoryTypes, @@ -241,8 +248,10 @@ vk::Move createDevice (const vk::InstanceInterface& vki, if (useDedicatedAllocs) { - deviceExtensions.push_back("VK_KHR_dedicated_allocation"); - deviceExtensions.push_back("VK_KHR_get_memory_requirements2"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_dedicated_allocation")) + deviceExtensions.push_back("VK_KHR_dedicated_allocation"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_get_memory_requirements2")) + deviceExtensions.push_back("VK_KHR_get_memory_requirements2"); } if ((externalMemoryTypes @@ -609,7 +618,7 @@ tcu::TestStatus testSemaphoreWin32Create (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::VkExportSemaphoreWin32HandleInfoKHR win32ExportInfo = @@ -680,7 +689,7 @@ tcu::TestStatus testSemaphoreImportTwice (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique semaphore (createExportableSemaphore(vkd, *device, config.externalType)); @@ -727,7 +736,7 @@ tcu::TestStatus testSemaphoreImportReimport (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -773,7 +782,7 @@ tcu::TestStatus testSemaphoreSignalExportImportWait (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique semaphoreA (createExportableSemaphore(vkd, *device, config.externalType)); @@ -812,7 +821,7 @@ tcu::TestStatus testSemaphoreExportSignalImportWait (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -849,7 +858,7 @@ tcu::TestStatus testSemaphoreExportImportSignalWait (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -883,7 +892,7 @@ tcu::TestStatus testSemaphoreSignalImport (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -931,7 +940,7 @@ tcu::TestStatus testSemaphoreSignalWaitImport (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -981,7 +990,7 @@ tcu::TestStatus testSemaphoreMultipleExports (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique semaphore (createExportableSemaphore(vkd, *device, config.externalType)); @@ -1020,7 +1029,7 @@ tcu::TestStatus testSemaphoreMultipleImports (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique semaphoreA (createExportableSemaphore(vkd, *device, config.externalType)); @@ -1070,7 +1079,7 @@ tcu::TestStatus testSemaphoreTransference (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1165,7 +1174,7 @@ tcu::TestStatus testSemaphoreFdDup (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1225,7 +1234,7 @@ tcu::TestStatus testSemaphoreFdDup2 (Context& context, { const vk::VkSemaphoreImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_SEMAPHORE_IMPORT_TEMPORARY_BIT : (vk::VkSemaphoreImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1289,7 +1298,7 @@ tcu::TestStatus testSemaphoreFdDup3 (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1354,7 +1363,7 @@ tcu::TestStatus testSemaphoreFdSendOverSocket (Context& context, checkSemaphoreSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, config.externalType, 0u, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1540,7 +1549,7 @@ tcu::TestStatus testFenceWin32Create (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::VkExportFenceWin32HandleInfoKHR win32ExportInfo = @@ -1611,7 +1620,7 @@ tcu::TestStatus testFenceImportTwice (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique fence (createExportableFence(vkd, *device, config.externalType)); @@ -1658,7 +1667,7 @@ tcu::TestStatus testFenceImportReimport (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1704,7 +1713,7 @@ tcu::TestStatus testFenceSignalExportImportWait (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique fenceA (createExportableFence(vkd, *device, config.externalType)); @@ -1743,7 +1752,7 @@ tcu::TestStatus testFenceExportSignalImportWait (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1780,7 +1789,7 @@ tcu::TestStatus testFenceExportImportSignalWait (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1814,7 +1823,7 @@ tcu::TestStatus testFenceSignalImport (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1862,7 +1871,7 @@ tcu::TestStatus testFenceReset (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1931,7 +1940,7 @@ tcu::TestStatus testFenceSignalWaitImport (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -1981,7 +1990,7 @@ tcu::TestStatus testFenceMultipleExports (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique fence (createExportableFence(vkd, *device, config.externalType)); @@ -2020,7 +2029,7 @@ tcu::TestStatus testFenceMultipleImports (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); const vk::Unique fenceA (createExportableFence(vkd, *device, config.externalType)); @@ -2070,7 +2079,7 @@ tcu::TestStatus testFenceTransference (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -2171,7 +2180,7 @@ tcu::TestStatus testFenceFdDup (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -2231,7 +2240,7 @@ tcu::TestStatus testFenceFdDup2 (Context& context, { const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -2295,7 +2304,7 @@ tcu::TestStatus testFenceFdDup3 (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -2360,7 +2369,7 @@ tcu::TestStatus testFenceFdSendOverSocket (Context& context, checkFenceSupport(vki, physicalDevice, config.externalType); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkQueue queue (getQueue(vkd, *device, queueFamilyIndex)); @@ -2569,7 +2578,7 @@ tcu::TestStatus testBufferQueries (Context& context, vk::VkExternalMemoryHandleT // \note We need to re-create with dedicated mem extensions if previous device instance didn't have them try { - device = createDevice(vki, physicalDevice, 0u, externalType, 0u, queueFamilyIndex, requiresDedicated); + device = createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, externalType, 0u, queueFamilyIndex, requiresDedicated); vkd = de::MovePtr(new vk::DeviceDriver(vki, *device)); deviceHasDedicated = requiresDedicated; } @@ -2644,7 +2653,7 @@ tcu::TestStatus testMemoryWin32Create (Context& context, MemoryTestConfig config const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const deUint32 seed = 1261033864u; @@ -2726,7 +2735,7 @@ tcu::TestStatus testMemoryImportTwice (Context& context, MemoryTestConfig config const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const deUint32 seed = 1261033864u; @@ -2779,7 +2788,7 @@ tcu::TestStatus testMemoryMultimpleImports (Context& context, MemoryTestConfig c const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkDeviceSize bufferSize = 1024; @@ -2812,7 +2821,7 @@ tcu::TestStatus testMemoryMultimpleExports (Context& context, MemoryTestConfig c const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkDeviceSize bufferSize = 1024; @@ -2844,7 +2853,7 @@ tcu::TestStatus testMemoryFdDup (Context& context, MemoryTestConfig config) const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); TestLog& log = context.getTestContext().getLog(); @@ -2905,7 +2914,7 @@ tcu::TestStatus testMemoryFdDup2 (Context& context, MemoryTestConfig config) const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); TestLog& log = context.getTestContext().getLog(); @@ -2967,7 +2976,7 @@ tcu::TestStatus testMemoryFdDup3 (Context& context, MemoryTestConfig config) const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); TestLog& log = context.getTestContext().getLog(); @@ -3029,7 +3038,7 @@ tcu::TestStatus testMemoryFdSendOverSocket (Context& context, MemoryTestConfig c const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); { - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex)); const vk::DeviceDriver vkd (vki, *device); TestLog& log = context.getTestContext().getLog(); @@ -3182,7 +3191,7 @@ tcu::TestStatus testBufferBindExportImportBind (Context& context, const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkDeviceSize bufferSize = 1024; @@ -3218,7 +3227,7 @@ tcu::TestStatus testBufferExportBindImportBind (Context& context, const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkDeviceSize bufferSize = 1024; @@ -3253,7 +3262,7 @@ tcu::TestStatus testBufferExportImportBindBind (Context& context, const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); const vk::DeviceDriver vkd (vki, *device); const vk::VkBufferUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkDeviceSize bufferSize = 1024; @@ -3389,7 +3398,7 @@ tcu::TestStatus testImageQueries (Context& context, vk::VkExternalMemoryHandleTy // \note We need to re-create with dedicated mem extensions if previous device instance didn't have them try { - device = createDevice(vki, physicalDevice, 0u, externalType, 0u, queueFamilyIndex, requiresDedicated); + device = createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, externalType, 0u, queueFamilyIndex, requiresDedicated); vkd = de::MovePtr(new vk::DeviceDriver(vki, *device)); deviceHasDedicated = requiresDedicated; } @@ -3451,7 +3460,7 @@ tcu::TestStatus testImageBindExportImportBind (Context& context, const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); const vk::DeviceDriver vkd (vki, *device); const vk::VkImageUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkFormat format = vk::VK_FORMAT_R8G8B8A8_UNORM; @@ -3491,7 +3500,7 @@ tcu::TestStatus testImageExportBindImportBind (Context& context, const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); const vk::DeviceDriver vkd (vki, *device); const vk::VkImageUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkFormat format = vk::VK_FORMAT_R8G8B8A8_UNORM; @@ -3530,7 +3539,7 @@ tcu::TestStatus testImageExportImportBindBind (Context& context, const vk::InstanceDriver vki (vkp, *instance); const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, *instance, context.getTestContext().getCommandLine())); const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); - const vk::Unique device (createDevice(vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); + const vk::Unique device (createDevice(context.getUsedApiVersion(), vki, physicalDevice, 0u, config.externalType, 0u, queueFamilyIndex, config.dedicated)); const vk::DeviceDriver vkd (vki, *device); const vk::VkImageUsageFlags usage = vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT|vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT; const vk::VkFormat format = vk::VK_FORMAT_R8G8B8A8_UNORM; diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index cc62cee..63389e5 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -97,11 +97,6 @@ enum LimitType #define LIMIT(_X_) DE_OFFSET_OF(VkPhysicalDeviceLimits, _X_), (const char*)(#_X_) #define FEATURE(_X_) DE_OFFSET_OF(VkPhysicalDeviceFeatures, _X_) -inline bool isExtensionSupported (const vector& extensionStrings, const string& extensionName) -{ - return de::contains(extensionStrings.begin(), extensionStrings.end(), extensionName); -} - bool validateFeatureLimits(VkPhysicalDeviceProperties* properties, VkPhysicalDeviceFeatures* features, TestLog& log) { bool limitsOk = true; @@ -1321,6 +1316,10 @@ tcu::TestStatus deviceGroupPeerMemoryFeatures (Context& context) const vector deviceGroupProps = enumeratePhysicalDeviceGroups(vki, *instance); std::vector deviceExtensions; deviceExtensions.push_back("VK_KHR_device_group"); + + if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_device_group")) + deviceExtensions.push_back("VK_KHR_device_group"); + deviceExtensions.push_back("VK_KHR_swapchain"); const std::vector queueProps = getPhysicalDeviceQueueFamilyProperties(vki, deviceGroupProps[devGroupIdx].physicalDevices[deviceIdx]); @@ -1815,11 +1814,14 @@ VkPhysicalDeviceSamplerYcbcrConversionFeatures getPhysicalDeviceSamplerYcbcrConv void checkYcbcrConversionSupport (Context& context) { - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_ycbcr_conversion")) - TCU_THROW(NotSupportedError, "VK_KHR_sampler_ycbcr_conversion is not supported"); + if (!vk::isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversion")) + { + if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_sampler_ycbcr_conversion")) + TCU_THROW(NotSupportedError, "VK_KHR_sampler_ycbcr_conversion is not supported"); - // Hard dependency for ycbcr - TCU_CHECK(de::contains(context.getInstanceExtensions().begin(), context.getInstanceExtensions().end(), "VK_KHR_get_physical_device_properties2")); + // Hard dependency for ycbcr + TCU_CHECK(de::contains(context.getInstanceExtensions().begin(), context.getInstanceExtensions().end(), "VK_KHR_get_physical_device_properties2")); + } { const VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeatures = getPhysicalDeviceSamplerYcbcrConversionFeatures(context.getInstanceInterface(), context.getPhysicalDevice()); @@ -2401,7 +2403,7 @@ tcu::TestStatus imageFormatProperties (Context& context, const VkFormat format, const VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures(); const VkPhysicalDeviceLimits& deviceLimits = context.getDeviceProperties().limits; const VkFormatProperties formatProperties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format); - const bool hasKhrMaintenance1 = isExtensionSupported(context.getDeviceExtensions(), "VK_KHR_maintenance1"); + const bool hasKhrMaintenance1 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"); const VkFormatFeatureFlags supportedFeatures = tiling == VK_IMAGE_TILING_LINEAR ? formatProperties.linearTilingFeatures : formatProperties.optimalTilingFeatures; const VkImageUsageFlags usageFlagSet = getValidImageUsageFlags(supportedFeatures, hasKhrMaintenance1); @@ -2534,10 +2536,15 @@ Move createInstanceWithExtension (const PlatformInterface& vkp, cons const vector instanceExts = enumerateInstanceExtensionProperties(vkp, DE_NULL); vector enabledExts; - if (!isExtensionSupported(instanceExts, RequiredExtension(extensionName))) - TCU_THROW(NotSupportedError, (string(extensionName) + " is not supported").c_str()); + const deUint32 instanceVersion = context.getUsedApiVersion(); - enabledExts.push_back(extensionName); + if (!isCoreInstanceExtension(instanceVersion, extensionName)) + { + if (!isExtensionSupported(instanceExts, RequiredExtension(extensionName))) + TCU_THROW(NotSupportedError, (string(extensionName) + " is not supported").c_str()); + else + enabledExts.push_back(extensionName); + } return createDefaultInstance(vkp, context.getUsedApiVersion(), vector() /* layers */, enabledExts); } @@ -3003,7 +3010,7 @@ tcu::TestStatus testMandatoryExtensions (Context& context) for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx) { - if (!isExtensionSupported(extensions, RequiredExtension(mandatoryExtensions[ndx]))) + if (!isInstanceExtensionSupported(context.getUsedApiVersion(), extensions, RequiredExtension(mandatoryExtensions[ndx]))) results.fail(string(mandatoryExtensions[ndx]) + " is not supported"); } } @@ -3018,7 +3025,7 @@ tcu::TestStatus testMandatoryExtensions (Context& context) for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx) { - if (!isExtensionSupported(extensions, RequiredExtension(mandatoryExtensions[ndx]))) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, RequiredExtension(mandatoryExtensions[ndx]))) results.fail(string(mandatoryExtensions[ndx]) + " is not supported"); } } diff --git a/external/vulkancts/modules/vulkan/api/vktApiImageClearingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiImageClearingTests.cpp index 3eeabd2..56a07f6 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiImageClearingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiImageClearingTests.cpp @@ -568,10 +568,8 @@ ImageClearingTestInstance::ImageClearingTestInstance (Context& context, const Te { if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); } } diff --git a/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp index 54195f7..fd31542 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp @@ -302,9 +302,9 @@ T alignToPowerOfTwo (T value, T align) return (value + align - T(1)) & ~(align - T(1)); } -inline bool hasDeviceExtension (Context& context, const string& name) +inline bool hasDeviceExtension (Context& context, const string name) { - return de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), name); + return isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), name); } VkDeviceSize getPageTableSize (const PlatformMemoryLimits& limits, VkDeviceSize allocationSize) diff --git a/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp b/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp index 32e5733..4167ec0 100644 --- a/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp +++ b/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp @@ -161,7 +161,8 @@ bool isDynamicDescriptorType (vk::VkDescriptorType type) return type == vk::VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || type == vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC; } -void verifyDriverSupport(const vk::VkPhysicalDeviceFeatures& deviceFeatures, +void verifyDriverSupport(const deUint32 apiVersion, + const vk::VkPhysicalDeviceFeatures& deviceFeatures, const std::vector& deviceExtensions, DescriptorUpdateMethod updateMethod, vk::VkDescriptorType descType, @@ -180,7 +181,8 @@ void verifyDriverSupport(const vk::VkPhysicalDeviceFeatures& deviceFeatures, case DESCRIPTOR_UPDATE_METHOD_WITH_PUSH_TEMPLATE: extensionNames.push_back("VK_KHR_push_descriptor"); case DESCRIPTOR_UPDATE_METHOD_WITH_TEMPLATE: - extensionNames.push_back("VK_KHR_descriptor_update_template"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_descriptor_update_template")) + extensionNames.push_back("VK_KHR_descriptor_update_template"); break; case DESCRIPTOR_UPDATE_METHOD_NORMAL: @@ -3322,7 +3324,7 @@ std::string BufferDescriptorCase::genNoAccessSource (void) const vkt::TestInstance* BufferDescriptorCase::createInstance (vkt::Context& context) const { - verifyDriverSupport(context.getDeviceFeatures(), context.getDeviceExtensions(), m_updateMethod, m_descriptorType, m_activeStages); + verifyDriverSupport(context.getUsedApiVersion(), context.getDeviceFeatures(), context.getDeviceExtensions(), m_updateMethod, m_descriptorType, m_activeStages); if (m_exitingStages == vk::VK_SHADER_STAGE_COMPUTE_BIT) { @@ -6595,7 +6597,7 @@ std::string ImageDescriptorCase::genNoAccessSource (void) const vkt::TestInstance* ImageDescriptorCase::createInstance (vkt::Context& context) const { - verifyDriverSupport(context.getDeviceFeatures(), context.getDeviceExtensions(), m_updateMethod, m_descriptorType, m_activeStages); + verifyDriverSupport(context.getUsedApiVersion(), context.getDeviceFeatures(), context.getDeviceExtensions(), m_updateMethod, m_descriptorType, m_activeStages); switch (m_descriptorType) { @@ -7776,7 +7778,7 @@ std::string TexelBufferDescriptorCase::genNoAccessSource (void) const vkt::TestInstance* TexelBufferDescriptorCase::createInstance (vkt::Context& context) const { - verifyDriverSupport(context.getDeviceFeatures(), context.getDeviceExtensions(), m_updateMethod, m_descriptorType, m_activeStages); + verifyDriverSupport(context.getUsedApiVersion(), context.getDeviceFeatures(), context.getDeviceExtensions(), m_updateMethod, m_descriptorType, m_activeStages); if (m_exitingStages == vk::VK_SHADER_STAGE_COMPUTE_BIT) { diff --git a/external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp b/external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp index dd95a07..3ec9f16 100644 --- a/external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp +++ b/external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp @@ -571,7 +571,7 @@ tcu::TestStatus testLargePoints (Context& context) bool pointClippingOutside = true; - if (de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance2")) + if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) { VkPointClippingBehavior clippingBehavior = getClippingBehavior(context.getInstanceInterface(), context.getPhysicalDevice()); diff --git a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp index 2985ef2..47e1e29 100644 --- a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp +++ b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp @@ -2356,13 +2356,15 @@ tcu::TestStatus ImageBarrierTestInstance::iterate (void) vk::Move createInstanceWithExtensions(const vk::PlatformInterface& vkp, const deUint32 version, const std::vector enableExtensions) { - std::vector enableExtensionPtrs (enableExtensions.size()); + std::vector enableExtensionPtrs; const std::vector availableExtensions = enumerateInstanceExtensionProperties(vkp, DE_NULL); for (size_t extensionID = 0; extensionID < enableExtensions.size(); extensionID++) { - if (!isExtensionSupported(availableExtensions, RequiredExtension(enableExtensions[extensionID]))) + if (!isInstanceExtensionSupported(version, availableExtensions, RequiredExtension(enableExtensions[extensionID]))) TCU_THROW(NotSupportedError, (enableExtensions[extensionID] + " is not supported").c_str()); - enableExtensionPtrs[extensionID] = enableExtensions[extensionID]; + + if (!isCoreInstanceExtension(version, enableExtensions[extensionID])) + enableExtensionPtrs.push_back(enableExtensions[extensionID]); } return createDefaultInstance(vkp, version, std::vector() /* layers */, enableExtensionPtrs, DE_NULL); } @@ -2406,7 +2408,9 @@ void ComputeTestInstance::createDeviceGroup (void) std::vector devGroupProperties = enumeratePhysicalDeviceGroups(m_context.getInstanceInterface(), m_deviceGroupInstance.get()); m_numPhysDevices = devGroupProperties[devGroupIdx].physicalDeviceCount; std::vector deviceExtensions; - deviceExtensions.push_back("VK_KHR_device_group"); + + if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_device_group")) + deviceExtensions.push_back("VK_KHR_device_group"); deviceExtensions.push_back("VK_KHR_swapchain"); VkDeviceGroupDeviceCreateInfo deviceGroupInfo = diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawNegativeViewportHeightTests.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawNegativeViewportHeightTests.cpp index 1d4db2c..179ae82 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawNegativeViewportHeightTests.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawNegativeViewportHeightTests.cpp @@ -31,6 +31,7 @@ #include "vkPrograms.hpp" #include "vkTypeUtil.hpp" #include "vkImageUtil.hpp" +#include "vkQueryUtil.hpp" #include "tcuVector.hpp" #include "tcuTextureUtil.hpp" @@ -396,7 +397,7 @@ tcu::TestStatus NegativeViewportHeightTestInstance::iterate (void) { // Check requirements - if (!de::contains(m_context.getDeviceExtensions().begin(), m_context.getDeviceExtensions().end(), std::string("VK_KHR_maintenance1"))) + if(!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_maintenance1")) TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_maintenance1"); // Set up the viewport and draw diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawShaderDrawParametersTests.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawShaderDrawParametersTests.cpp index 53bb063..69ea702 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawShaderDrawParametersTests.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawShaderDrawParametersTests.cpp @@ -110,7 +110,7 @@ DrawTest::DrawTest (Context &context, TestSpec testSpec) // Requirements { - if (!de::contains(m_context.getDeviceExtensions().begin(), m_context.getDeviceExtensions().end(), std::string("VK_KHR_shader_draw_parameters"))) + if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_draw_parameters")) TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_shader_draw_parameters"); if (isMultiDraw() && !m_context.getDeviceFeatures().multiDrawIndirect) diff --git a/external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp b/external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp index 35dc84f..30edc64 100644 --- a/external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp +++ b/external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp @@ -894,7 +894,7 @@ void initPrograms (SourceCollections& programCollection, const TestParams params tcu::TestStatus test (Context& context, const TestParams params) { if (VK_IMAGE_VIEW_TYPE_3D == params.image.viewType && - (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1"))) + (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported"); const DeviceInterface& vk = context.getDeviceInterface(); diff --git a/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp b/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp index 85d3027..1c87442 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp @@ -2570,7 +2570,7 @@ TestInstance* TexelViewCompatibleCase::createInstance (Context& context) const DE_ASSERT(getLayerSize(m_parameters.imageType, m_parameters.size).x() > 0u); DE_ASSERT(getLayerSize(m_parameters.imageType, m_parameters.size).y() > 0u); - if (std::find(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance2") == context.getDeviceExtensions().end()) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance2 not supported"); { diff --git a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp index 2462a8f..91510f7 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp @@ -949,7 +949,7 @@ class UploadDownloadExecutor public: UploadDownloadExecutor(Context &context, const CaseDef& caseSpec) : m_caseDef(caseSpec), - m_haveMaintenance2(de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance2")), + m_haveMaintenance2(isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")), m_vk(context.getDeviceInterface()), m_device(context.getDevice()), m_queue(context.getUniversalQueue()), @@ -1727,7 +1727,7 @@ tcu::TestStatus testMutable (Context& context, const CaseDef caseDef) // is not supported by the main format. With VK_KHR_maintenance2, we // can do this via VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR. if ((imageFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance2")) + !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) { TCU_THROW(NotSupportedError, "Image format doesn't support upload/download method"); } diff --git a/external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp index 926d3d1..0e195b3 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp @@ -832,7 +832,7 @@ TestInstance* ImageTranscodingCase::createInstance (Context& context) const DE_ASSERT(m_parameters.testedImageUsageFeature != 0); - if (std::find(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance2") == context.getDeviceExtensions().end()) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance2 not supported"); if (!isFormatUsageFlagSupported(context, featuredFormat, m_parameters.testedImageUsageFeature)) diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp index d3fa176..9a912f7 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp @@ -103,13 +103,15 @@ struct TestConfigRandom vk::Move createInstanceWithExtensions (const vk::PlatformInterface& vkp, deUint32 version, const std::vector& enableExtensions) { - std::vector enableExtensionPtrs (enableExtensions.size()); + std::vector enableExtensionPtrs; const std::vector availableExtensions = enumerateInstanceExtensionProperties(vkp, DE_NULL); for (size_t extensionID = 0; extensionID < enableExtensions.size(); extensionID++) { - if (!isExtensionSupported(availableExtensions, RequiredExtension(enableExtensions[extensionID]))) + if (!isInstanceExtensionSupported(version, availableExtensions, RequiredExtension(enableExtensions[extensionID]))) TCU_THROW(NotSupportedError, (enableExtensions[extensionID] + " is not supported").c_str()); - enableExtensionPtrs[extensionID] = enableExtensions[extensionID]; + + if (!isCoreInstanceExtension(version, enableExtensions[extensionID])) + enableExtensionPtrs.push_back(enableExtensions[extensionID]); } return createDefaultInstance(vkp, version, std::vector() /* layers */, enableExtensionPtrs); @@ -164,7 +166,11 @@ void BaseAllocateTestInstance::createDeviceGroup (void) m_subsetAllocationAllowed = devGroupProperties[devGroupIdx].subsetAllocation; if (m_numPhysDevices < 2) TCU_THROW(NotSupportedError, "Device group allocation tests not supported with 1 physical device"); - std::vector deviceExtensions (1, "VK_KHR_device_group"); + std::vector deviceExtensions; + + if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_device_group")) + deviceExtensions.push_back("VK_KHR_device_group"); + VkDeviceGroupDeviceCreateInfo deviceGroupInfo = { VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR, //stype @@ -194,16 +200,16 @@ void BaseAllocateTestInstance::createDeviceGroup (void) const VkDeviceCreateInfo deviceInfo = { - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // VkStructureType sType; - m_useDeviceGroups ? &deviceGroupInfo : DE_NULL, // const void* pNext; - (VkDeviceCreateFlags)0, // VkDeviceCreateFlags flags; - 1u , // uint32_t queueCreateInfoCount; - &queueInfo, // const VkDeviceQueueCreateInfo* pQueueCreateInfos; - 0u, // uint32_t enabledLayerCount; - DE_NULL, // const char* const* ppEnabledLayerNames; - deUint32(deviceExtensions.size()), // uint32_t enabledExtensionCount; - &deviceExtensions[0], // const char* const* ppEnabledExtensionNames; - &deviceFeatures, // const VkPhysicalDeviceFeatures* pEnabledFeatures; + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // VkStructureType sType; + m_useDeviceGroups ? &deviceGroupInfo : DE_NULL, // const void* pNext; + (VkDeviceCreateFlags)0, // VkDeviceCreateFlags flags; + 1u , // uint32_t queueCreateInfoCount; + &queueInfo, // const VkDeviceQueueCreateInfo* pQueueCreateInfos; + 0u, // uint32_t enabledLayerCount; + DE_NULL, // const char* const* ppEnabledLayerNames; + deUint32(deviceExtensions.size()), // uint32_t enabledExtensionCount; + deviceExtensions.empty() ? DE_NULL : &deviceExtensions[0], // const char* const* ppEnabledExtensionNames; + &deviceFeatures, // const VkPhysicalDeviceFeatures* pEnabledFeatures; }; m_logicalDevice = createDevice(instance, deviceGroupInfo.pPhysicalDevices[physDeviceIdx], &deviceInfo); m_deviceDriver = de::MovePtr(new DeviceDriver(instance, *m_logicalDevice)); diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp index 9a42bfd..27a3728 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp @@ -840,7 +840,7 @@ public: virtual tcu::TestStatus iterate (void) { const std::vector& extensions = m_context.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_bind_memory2") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(m_context.getUsedApiVersion(), extensions, "VK_KHR_bind_memory2"); if (!isSupported) { TCU_THROW(NotSupportedError, "Not supported"); @@ -893,7 +893,7 @@ public: virtual tcu::TestStatus iterate (void) { const std::vector& extensions = m_context.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_bind_memory2") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(m_context.getUsedApiVersion(), extensions, "VK_KHR_bind_memory2"); if (!isSupported) { TCU_THROW(NotSupportedError, "Not supported"); diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp index 100d700..167a4b7 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp @@ -538,7 +538,7 @@ tcu::TestStatus testMemoryMapping (Context& context, const TestConfig config) || config.allocationKind == ALLOCATION_KIND_DEDICATED_BUFFER) { const std::vector& extensions = context.getDeviceExtensions(); - const deBool isSupported = std::find(extensions.begin(), extensions.end(), "VK_KHR_dedicated_allocation") != extensions.end(); + const deBool isSupported = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation"); if (!isSupported) { TCU_THROW(NotSupportedError, "Not supported"); diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp index c98cc45..b9c28cd 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp @@ -486,7 +486,7 @@ void BufferMemoryRequirementsExtended::preTestChecks (Context& context, { const std::string extensionName("VK_KHR_get_memory_requirements2"); - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), extensionName)) TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); BufferMemoryRequirementsOriginal::preTestChecks(context, vki, physDevice, flags); @@ -568,10 +568,8 @@ void BufferMemoryRequirementsDedicatedAllocation::preTestChecks (Context& co const VkPhysicalDevice physDevice, const VkBufferCreateFlags flags) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); BufferMemoryRequirementsExtended::preTestChecks(context, vki, physDevice, flags); } @@ -705,7 +703,8 @@ protected: const VkPhysicalDeviceMemoryProperties& deviceMemoryProperties); private: - virtual bool isImageSupported (const InstanceInterface& vki, + virtual bool isImageSupported (const deUint32 apiVersion, + const InstanceInterface& vki, const VkPhysicalDevice physDevice, const std::vector& deviceExtensions, const VkImageCreateInfo& info); @@ -867,7 +866,7 @@ bool isUsageMatchesFeatures (const VkImageUsageFlags usage, const VkFormatFeatur } //! This catches both invalid as well as legal but unsupported combinations of image parameters -bool ImageMemoryRequirementsOriginal::isImageSupported (const InstanceInterface& vki, const VkPhysicalDevice physDevice, const std::vector& deviceExtensions, const VkImageCreateInfo& info) +bool ImageMemoryRequirementsOriginal::isImageSupported (const deUint32 apiVersion, const InstanceInterface& vki, const VkPhysicalDevice physDevice, const std::vector& deviceExtensions, const VkImageCreateInfo& info) { DE_ASSERT(info.extent.width >= 1u && info.extent.height >= 1u && info.extent.depth >= 1u); @@ -876,7 +875,7 @@ bool ImageMemoryRequirementsOriginal::isImageSupported (const InstanceInterface& || info.mipLevels != 1 || info.arrayLayers != 1 || info.samples != VK_SAMPLE_COUNT_1_BIT)) - || !de::contains(deviceExtensions.begin(), deviceExtensions.end(), "VK_KHR_sampler_ycbcr_conversion")) + || !isDeviceExtensionSupported(apiVersion, deviceExtensions, "VK_KHR_sampler_ycbcr_conversion")) { return false; } @@ -1365,7 +1364,7 @@ tcu::TestStatus ImageMemoryRequirementsOriginal::execTest (Context& context, con m_currentTestImageInfo = imageInfo; - if (!isImageSupported(vki, physDevice, context.getDeviceExtensions(), m_currentTestImageInfo)) + if (!isImageSupported(context.getUsedApiVersion(), vki, physDevice, context.getDeviceExtensions(), m_currentTestImageInfo)) continue; log << tcu::TestLog::Message << "- " << getImageInfoString(m_currentTestImageInfo) << tcu::TestLog::EndMessage; @@ -1441,7 +1440,7 @@ void ImageMemoryRequirementsExtended::preTestChecks (Context& context, { const std::string extensionName("VK_KHR_get_memory_requirements2"); - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), extensionName)) TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); ImageMemoryRequirementsOriginal::preTestChecks (context, vki, physDevice, createFlags); @@ -1503,10 +1502,8 @@ void ImageMemoryRequirementsDedicatedAllocation::preTestChecks (Context& con const VkPhysicalDevice physDevice, const VkImageCreateFlags createFlags) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); ImageMemoryRequirementsExtended::preTestChecks (context, vki, physDevice, createFlags); } @@ -1644,13 +1641,13 @@ tcu::TestStatus testMultiplaneImages (Context& context, ImageTestParams params) { const std::string extensionName("VK_KHR_get_memory_requirements2"); - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), extensionName)) TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); } { const std::string extensionName("VK_KHR_sampler_ycbcr_conversion"); - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), extensionName)) TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); } diff --git a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp index 643b279..567ee34 100644 --- a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp +++ b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp @@ -175,7 +175,7 @@ MultiViewRenderTestInstance::MultiViewRenderTestInstance (Context& context, cons , m_squareCount (4u) ,m_queueFamilyIndex (0u) { - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_multiview")) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_multiview")) throw tcu::NotSupportedError("VK_KHR_multiview is not supported"); createMultiViewDevices(); @@ -340,7 +340,7 @@ TestParameters MultiViewRenderTestInstance::fillMissingParameters (const TestPar return parameters; else { - if (!de::contains(m_context.getDeviceExtensions().begin(), m_context.getDeviceExtensions().end(), "VK_KHR_multiview")) + if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_multiview")) throw tcu::NotSupportedError("VK_KHR_multiview is not supported"); const InstanceInterface& instance = m_context.getInstanceInterface(); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp index bf162cd..e31b201 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp @@ -268,10 +268,8 @@ ImageSamplingInstance::ImageSamplingInstance (Context& context, if (m_allocationKind == ALLOCATION_KIND_DEDICATED) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, std::string("VK_KHR_dedicated_allocation is not supported").c_str()); } // Create texture images, views and samplers diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp index 89b4e2e..b2825f2 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineRenderToImageTests.cpp @@ -1244,7 +1244,7 @@ tcu::TestStatus testWithSizeReduction (Context& context, const CaseDef& caseDef) void checkImageViewTypeRequirements (Context& context, const VkImageViewType viewType) { if (viewType == VK_IMAGE_VIEW_TYPE_3D && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1")) + (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported"); if (viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY && !context.getDeviceFeatures().imageCubeArray) @@ -1260,10 +1260,8 @@ tcu::TestStatus testAttachmentSize (Context& context, const CaseDef caseDef) if (caseDef.allocationKind == ALLOCATION_KIND_DEDICATED) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); } return testWithSizeReduction(context, caseDef); @@ -1430,10 +1428,8 @@ tcu::TestStatus testRenderToMipMaps (Context& context, const CaseDef caseDef) if (caseDef.allocationKind == ALLOCATION_KIND_DEDICATED) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); } if (useDepthStencil && !isDepthStencilFormatSupported(vki, physDevice, caseDef.depthStencilFormat)) diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemContext.hpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemContext.hpp index 0d6fa7d..3518fc4 100644 --- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemContext.hpp +++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemContext.hpp @@ -48,7 +48,7 @@ public: , m_vki (m_interface, *m_instance) , m_phyDevice (vk::chooseDevice(m_vki, *m_instance, m_context.getTestContext().getCommandLine())) , m_queueFamilyIndex (chooseProtectedMemQueueFamilyIndex(m_vki, m_phyDevice)) - , m_device (makeProtectedMemDevice(m_vki, m_phyDevice, m_queueFamilyIndex)) + , m_device (makeProtectedMemDevice(m_vki, m_phyDevice, m_queueFamilyIndex, ctx.getUsedApiVersion())) , m_allocator (createAllocator()) , m_deviceDriver (m_vki, *m_device) , m_queue (getProtectedQueue(m_deviceDriver, *m_device, m_queueFamilyIndex, 0)) diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp index abaed31..7cae2fe 100644 --- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp +++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp @@ -28,12 +28,16 @@ #include "vkQueryUtil.hpp" #include "vkTypeUtil.hpp" #include "vkDebugReportUtil.hpp" +#include "vkApiVersion.hpp" #include "vkPlatform.hpp" #include "vktProtectedMemContext.hpp" namespace vkt { + +using namespace vk; + namespace ProtectedMem { @@ -88,13 +92,14 @@ vk::Move makeProtectedMemInstance (const vk::PlatformInterface& TCU_THROW(NotSupportedError, "No validation layers found"); } - requiredExtensions.push_back("VK_KHR_get_physical_device_properties2"); + if (!isCoreInstanceExtension(context.getUsedApiVersion(), "VK_KHR_get_physical_device_properties2")) + requiredExtensions.push_back("VK_KHR_get_physical_device_properties2"); for (std::vector::const_iterator requiredExtName = requiredExtensions.begin(); requiredExtName != requiredExtensions.end(); ++requiredExtName) { - if (!isExtensionSupported(supportedExtensions, vk::RequiredExtension(*requiredExtName))) + if (!isInstanceExtensionSupported(context.getUsedApiVersion(), supportedExtensions, vk::RequiredExtension(*requiredExtName))) TCU_THROW(NotSupportedError, (*requiredExtName + " is not supported").c_str()); } @@ -130,9 +135,11 @@ deUint32 chooseProtectedMemQueueFamilyIndex (const vk::InstanceDriver& vkd, vk::Move makeProtectedMemDevice (const vk::InstanceDriver& vkd, vk::VkPhysicalDevice physicalDevice, - const deUint32 queueFamilyIndex) + const deUint32 queueFamilyIndex, + const deUint32 apiVersion) { const Extensions supportedExtensions (vk::enumerateDeviceExtensionProperties(vkd, physicalDevice, DE_NULL)); + std::vector requiredExtensions; deUint32 extensionsCount = 1; const char* const extensions[] = { @@ -142,8 +149,11 @@ vk::Move makeProtectedMemDevice (const vk::InstanceDriver& vkd, // Check if the physical device supports the protected memory extension name for (deUint32 ndx = 0; ndx < extensionsCount; ++ndx) { - if (!isExtensionSupported(supportedExtensions, vk::RequiredExtension(extensions[ndx]))) + if (!isDeviceExtensionSupported(apiVersion, supportedExtensions, vk::RequiredExtension(extensions[ndx]))) TCU_THROW(NotSupportedError, (std::string(extensions[ndx]) + " is not supported").c_str()); + + if (!isCoreDeviceExtension(apiVersion, extensions[ndx])) + requiredExtensions.push_back(extensions[ndx]); } // Check if the protected memory can be enabled on the physical device. @@ -183,16 +193,16 @@ vk::Move makeProtectedMemDevice (const vk::InstanceDriver& vkd, const vk::VkDeviceCreateInfo deviceParams = { - vk::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // sType - &featuresExt, // pNext - (vk::VkDeviceCreateFlags)0, // flags - DE_LENGTH_OF_ARRAY(queueInfos), // queueCreateInfosCount - &queueInfos[0], // pQueueCreateInfos - 0u, // enabledLayerCount - DE_NULL, // pEnabledLayerNames - extensionsCount, // enabledExtensionCount - DE_ARRAY_BEGIN(extensions), // pEnabledExtensionNames - DE_NULL // pEnabledFeatures + vk::VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, // sType + &featuresExt, // pNext + (vk::VkDeviceCreateFlags)0, // flags + DE_LENGTH_OF_ARRAY(queueInfos), // queueCreateInfosCount + &queueInfos[0], // pQueueCreateInfos + 0u, // enabledLayerCount + DE_NULL, // pEnabledLayerNames + (deUint32)requiredExtensions.size(), // enabledExtensionCount + requiredExtensions.empty() ? DE_NULL : &requiredExtensions[0], // pEnabledExtensionNames + DE_NULL // pEnabledFeatures }; return vk::createDevice(vkd, physicalDevice, &deviceParams, DE_NULL); diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.hpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.hpp index 5920da7..3de495f 100644 --- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.hpp +++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.hpp @@ -57,7 +57,8 @@ deUint32 chooseProtectedMemQueueFamilyIndex (const vk::InstanceDriver& v vk::Move makeProtectedMemDevice (const vk::InstanceDriver& vkd, vk::VkPhysicalDevice physicalDevice, - const deUint32 queueFamilyIndex); + const deUint32 queueFamilyIndex, + const deUint32 apiVersion); vk::VkQueue getProtectedQueue (const vk::DeviceInterface& vk, vk::VkDevice device, const deUint32 queueFamilyIndex, diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp index 75ed1fe..14f03ce 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassTests.cpp @@ -4400,15 +4400,13 @@ tcu::TestStatus renderPassTest (Context& context, TestConfig config) if (config.allocationKind == ALLOCATION_KIND_DEDICATED) { - const std::string extensionName("VK_KHR_dedicated_allocation"); - - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), extensionName)) - TCU_THROW(NotSupportedError, std::string(extensionName + " is not supported").c_str()); + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation")) + TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported"); } if (!renderPassInfo.getInputAspects().empty()) { - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), string("VK_KHR_maintenance2"))) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance2 not supported."); } @@ -4469,7 +4467,7 @@ tcu::TestStatus renderPassTest (Context& context, TestConfig config) } } - if (requireDepthStencilLayout && !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), string("VK_KHR_maintenance2"))) + if (requireDepthStencilLayout && !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) TCU_THROW(NotSupportedError, "VK_KHR_maintenance2 is not supported"); } diff --git a/external/vulkancts/modules/vulkan/shaderexecutor/vktOpaqueTypeIndexingTests.cpp b/external/vulkancts/modules/vulkan/shaderexecutor/vktOpaqueTypeIndexingTests.cpp index f3533f7..503023b 100644 --- a/external/vulkancts/modules/vulkan/shaderexecutor/vktOpaqueTypeIndexingTests.cpp +++ b/external/vulkancts/modules/vulkan/shaderexecutor/vktOpaqueTypeIndexingTests.cpp @@ -1279,7 +1279,7 @@ tcu::TestStatus BlockArrayIndexingCaseInstance::iterate (void) if ((m_flags & FLAG_USE_STORAGE_BUFFER) != 0) { - if (!de::contains(m_context.getDeviceExtensions().begin(), m_context.getDeviceExtensions().end(), "VK_KHR_storage_buffer_storage_class")) + if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_storage_buffer_storage_class")) TCU_THROW(NotSupportedError, "VK_KHR_storage_buffer_storage_class is not supported"); } diff --git a/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesBase.cpp b/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesBase.cpp index 47cbf11..bb58368 100644 --- a/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesBase.cpp +++ b/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesBase.cpp @@ -95,7 +95,8 @@ void SparseResourcesBaseInstance::createDeviceSupportingQueues(const QueueRequir deviceGroupInfo.physicalDeviceCount = devGroupProperties[m_deviceGroupIdx].physicalDeviceCount; deviceGroupInfo.pPhysicalDevices = devGroupProperties[m_deviceGroupIdx].physicalDevices; - deviceExtensions.push_back("VK_KHR_device_group"); + if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_device_group")) + deviceExtensions.push_back("VK_KHR_device_group"); } InstanceDriver instance(m_context.getPlatformInterface(), m_useDeviceGroups ? m_deviceGroupInstance.get() : m_context.getInstance()); diff --git a/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesTestsUtil.cpp b/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesTestsUtil.cpp index e2f87dd..766f91d 100644 --- a/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesTestsUtil.cpp +++ b/external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesTestsUtil.cpp @@ -38,13 +38,15 @@ namespace sparse vk::Move createInstanceWithExtensions(const vk::PlatformInterface& vkp, const deUint32 version, const std::vector enableExtensions) { - std::vector enableExtensionPtrs (enableExtensions.size()); + std::vector enableExtensionPtrs; const std::vector availableExtensions = enumerateInstanceExtensionProperties(vkp, DE_NULL); for (size_t extensionID = 0; extensionID < enableExtensions.size(); extensionID++) { - if (!isExtensionSupported(availableExtensions, RequiredExtension(enableExtensions[extensionID]))) + if (!isInstanceExtensionSupported(version, availableExtensions, RequiredExtension(enableExtensions[extensionID]))) TCU_THROW(NotSupportedError, (enableExtensions[extensionID] + " is not supported").c_str()); - enableExtensionPtrs[extensionID] = enableExtensions[extensionID]; + + if (!isCoreInstanceExtension(version, enableExtensions[extensionID])) + enableExtensionPtrs.push_back(enableExtensions[extensionID]); } return createDefaultInstance(vkp, version, std::vector() /* layers */, enableExtensionPtrs, DE_NULL); diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp index d08250d..090eadd 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp @@ -337,13 +337,13 @@ tcu::TestStatus SpvAsmComputeShaderInstance::iterate (void) // 16bit storage features { - if (!is16BitStorageFeaturesSupported(vki, physicalDevice, m_context.getInstanceExtensions(), m_shaderSpec.requestedVulkanFeatures.ext16BitStorage)) + if (!is16BitStorageFeaturesSupported(m_context.getUsedApiVersion(), vki, physicalDevice, m_context.getInstanceExtensions(), m_shaderSpec.requestedVulkanFeatures.ext16BitStorage)) TCU_THROW(NotSupportedError, "Requested 16bit storage features not supported"); } // VariablePointers features { - if (!isVariablePointersFeaturesSupported(vki, physicalDevice, m_context.getInstanceExtensions(), m_shaderSpec.requestedVulkanFeatures.extVariablePointers)) + if (!isVariablePointersFeaturesSupported(m_context.getUsedApiVersion(), vki, physicalDevice, m_context.getInstanceExtensions(), m_shaderSpec.requestedVulkanFeatures.extVariablePointers)) TCU_THROW(NotSupportedError, "Request Variable Pointer feature not supported"); } } diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp index ef243c5..3213532 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp @@ -2230,13 +2230,13 @@ TestStatus runAndVerifyDefaultPipeline (Context& context, InstanceContext instan // 16bit storage features { - if (!is16BitStorageFeaturesSupported(vkInstance, vkPhysicalDevice, context.getInstanceExtensions(), instance.requestedFeatures.ext16BitStorage)) + if (!is16BitStorageFeaturesSupported(context.getUsedApiVersion(), vkInstance, vkPhysicalDevice, context.getInstanceExtensions(), instance.requestedFeatures.ext16BitStorage)) TCU_THROW(NotSupportedError, "Requested 16bit storage features not supported"); } // Variable Pointers features { - if (!isVariablePointersFeaturesSupported(vkInstance, vkPhysicalDevice, context.getInstanceExtensions(), instance.requestedFeatures.extVariablePointers)) + if (!isVariablePointersFeaturesSupported(context.getUsedApiVersion(), vkInstance, vkPhysicalDevice, context.getInstanceExtensions(), instance.requestedFeatures.extVariablePointers)) TCU_THROW(NotSupportedError, "Requested Variable Pointer features not supported"); if (instance.requestedFeatures.extVariablePointers) diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.cpp index 1047e0d..bf6b59f 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.cpp @@ -48,7 +48,7 @@ VkPhysicalDeviceFeatures filterDefaultDeviceFeatures (const VkPhysicalDeviceFeat return enabledDeviceFeatures; } -VkPhysicalDevice16BitStorageFeatures querySupported16BitStorageFeatures (const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions) +VkPhysicalDevice16BitStorageFeatures querySupported16BitStorageFeatures (const deUint32 apiVersion, const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions) { VkPhysicalDevice16BitStorageFeatures extensionFeatures = { @@ -66,7 +66,7 @@ VkPhysicalDevice16BitStorageFeatures querySupported16BitStorageFeatures (const I features.pNext = &extensionFeatures; // Call the getter only if supported. Otherwise above "zero" defaults are used - if (de::contains(instanceExtensions.begin(), instanceExtensions.end(), "VK_KHR_get_physical_device_properties2")) + if(isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2")) { vki.getPhysicalDeviceFeatures2(device, &features); } @@ -74,7 +74,7 @@ VkPhysicalDevice16BitStorageFeatures querySupported16BitStorageFeatures (const I return extensionFeatures; } -VkPhysicalDeviceVariablePointerFeatures querySupportedVariablePointersFeatures (const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions) +VkPhysicalDeviceVariablePointerFeatures querySupportedVariablePointersFeatures (const deUint32 apiVersion, const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions) { VkPhysicalDeviceVariablePointerFeatures extensionFeatures = { @@ -90,7 +90,7 @@ VkPhysicalDeviceVariablePointerFeatures querySupportedVariablePointersFeatures ( features.pNext = &extensionFeatures; // Call the getter only if supported. Otherwise above "zero" defaults are used - if (de::contains(instanceExtensions.begin(), instanceExtensions.end(), "VK_KHR_get_physical_device_properties2")) + if(isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2")) { vki.getPhysicalDeviceFeatures2(device, &features); } @@ -100,9 +100,9 @@ VkPhysicalDeviceVariablePointerFeatures querySupportedVariablePointersFeatures ( } // anonymous -bool is16BitStorageFeaturesSupported (const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions, Extension16BitStorageFeatures toCheck) +bool is16BitStorageFeaturesSupported (const deUint32 apiVersion, const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions, Extension16BitStorageFeatures toCheck) { - VkPhysicalDevice16BitStorageFeatures extensionFeatures = querySupported16BitStorageFeatures(vki, device, instanceExtensions); + VkPhysicalDevice16BitStorageFeatures extensionFeatures = querySupported16BitStorageFeatures(apiVersion, vki, device, instanceExtensions); if ((toCheck & EXT16BITSTORAGEFEATURES_UNIFORM_BUFFER_BLOCK) != 0 && extensionFeatures.storageBuffer16BitAccess == VK_FALSE) return false; @@ -119,9 +119,9 @@ bool is16BitStorageFeaturesSupported (const InstanceInterface& vki, VkPhysicalDe return true; } -bool isVariablePointersFeaturesSupported (const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions, ExtensionVariablePointersFeatures toCheck) +bool isVariablePointersFeaturesSupported (const deUint32 apiVersion, const InstanceInterface& vki, VkPhysicalDevice device, const std::vector& instanceExtensions, ExtensionVariablePointersFeatures toCheck) { - VkPhysicalDeviceVariablePointerFeatures extensionFeatures = querySupportedVariablePointersFeatures(vki, device, instanceExtensions); + VkPhysicalDeviceVariablePointerFeatures extensionFeatures = querySupportedVariablePointersFeatures(apiVersion, vki, device, instanceExtensions); if ((toCheck & EXTVARIABLEPOINTERSFEATURES_VARIABLE_POINTERS_STORAGEBUFFER) != 0 && extensionFeatures.variablePointersStorageBuffer == VK_FALSE) return false; @@ -139,7 +139,7 @@ Move createDeviceWithExtensions (Context& context, { const InstanceInterface& vki = context.getInstanceInterface(); const VkPhysicalDevice physicalDevice = context.getPhysicalDevice(); - std::vector extensions (requiredExtensions.size()); + std::vector extensions; void* pExtension = DE_NULL; const VkPhysicalDeviceFeatures deviceFeatures = getPhysicalDeviceFeatures(vki, physicalDevice); VkPhysicalDevice16BitStorageFeatures ext16BitStorageFeatures; @@ -150,7 +150,7 @@ Move createDeviceWithExtensions (Context& context, const std::string& ext = requiredExtensions[extNdx]; // Check that all required extensions are supported first. - if (!de::contains(supportedExtensions.begin(), supportedExtensions.end(), ext)) + if (!isDeviceExtensionSupported(context.getUsedApiVersion(), supportedExtensions, ext)) { TCU_THROW(NotSupportedError, (std::string("Device extension not supported: ") + ext).c_str()); } @@ -161,17 +161,18 @@ Move createDeviceWithExtensions (Context& context, // For the 16bit storage extension, we have four features to test. Requesting all features supported. // Note that we don't throw NotImplemented errors here if a specific feature is not supported; // that should be done when actually trying to use that specific feature. - ext16BitStorageFeatures = querySupported16BitStorageFeatures(vki, physicalDevice, context.getInstanceExtensions()); + ext16BitStorageFeatures = querySupported16BitStorageFeatures(context.getUsedApiVersion(), vki, physicalDevice, context.getInstanceExtensions()); pExtension = &ext16BitStorageFeatures; } else if (ext == "VK_KHR_variable_pointers") { // For the VariablePointers extension, we have two features to test. Requesting all features supported. - extVariablePointerFeatures = querySupportedVariablePointersFeatures(vki, physicalDevice, context.getInstanceExtensions()); + extVariablePointerFeatures = querySupportedVariablePointersFeatures(context.getUsedApiVersion(), vki, physicalDevice, context.getInstanceExtensions()); pExtension = &extVariablePointerFeatures; } - extensions[extNdx] = ext.c_str(); + if (!isCoreDeviceExtension(context.getUsedApiVersion(), ext)) + extensions.push_back(ext.c_str()); } const float queuePriorities[] = { 1.0f }; diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.hpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.hpp index 392dbb6..bd8d2dc 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.hpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmUtils.hpp @@ -67,16 +67,18 @@ struct VulkanFeatures }; // Returns true if the given 16bit storage extension features in `toCheck` are all supported. -bool is16BitStorageFeaturesSupported (const vk::InstanceInterface& vkInstance, - vk::VkPhysicalDevice device, - const std::vector& instanceExtensions, - Extension16BitStorageFeatures toCheck); +bool is16BitStorageFeaturesSupported (const deUint32 apiVersion, + const vk::InstanceInterface& vkInstance, + vk::VkPhysicalDevice device, + const std::vector& instanceExtensions, + Extension16BitStorageFeatures toCheck); // Returns true if the given variable pointers extension features in `toCheck` are all supported. -bool isVariablePointersFeaturesSupported (const vk::InstanceInterface& vkInstance, +bool isVariablePointersFeaturesSupported (const deUint32 apiVersion, + const vk::InstanceInterface& vkInstance, vk::VkPhysicalDevice device, - const std::vector& instanceExtensions, - ExtensionVariablePointersFeatures toCheck); + const std::vector& instanceExtensions, + ExtensionVariablePointersFeatures toCheck); // Creates a Vulkan logical device with the requiredExtensions enabled and all other extensions disabled. // The logical device will be created from the instance and physical device in the given context. diff --git a/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp b/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp index 7560867..44063e0 100644 --- a/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp +++ b/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp @@ -2305,7 +2305,7 @@ void SSBOLayoutCase::initPrograms (vk::SourceCollections& programCollection) con TestInstance* SSBOLayoutCase::createInstance (Context& context) const { - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_relaxed_block_layout") && usesRelaxedLayout(m_interface)) + if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_relaxed_block_layout") && usesRelaxedLayout(m_interface)) TCU_THROW(NotSupportedError, "VK_KHR_relaxed_block_layout not supported"); return new SSBOLayoutCaseInstance(context, m_bufferMode, m_interface, m_refLayout, m_initialData, m_writeData); } diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp index 8d95685..4563667 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp @@ -25,7 +25,6 @@ #include "vkDeviceUtil.hpp" #include "vkPlatform.hpp" - #include "vktTestCaseUtil.hpp" #include "vktSynchronizationUtil.hpp" @@ -177,10 +176,12 @@ vk::Move createInstance (const vk::PlatformInterface& vkp, deUin try { std::vector extensions; - - extensions.push_back("VK_KHR_get_physical_device_properties2"); - extensions.push_back("VK_KHR_external_semaphore_capabilities"); - extensions.push_back("VK_KHR_external_memory_capabilities"); + if (!vk::isCoreInstanceExtension(version, "VK_KHR_get_physical_device_properties2")) + extensions.push_back("VK_KHR_get_physical_device_properties2"); + if (!vk::isCoreInstanceExtension(version, "VK_KHR_external_semaphore_capabilities")) + extensions.push_back("VK_KHR_external_semaphore_capabilities"); + if (!vk::isCoreInstanceExtension(version, "VK_KHR_external_memory_capabilities")) + extensions.push_back("VK_KHR_external_memory_capabilities"); return vk::createDefaultInstance(vkp, version, std::vector(), extensions); } @@ -215,7 +216,8 @@ vk::VkPhysicalDevice getPhysicalDevice (const vk::InstanceInterface& vki, vk::Vk return (vk::VkPhysicalDevice)0; } -vk::Move createDevice (const vk::InstanceInterface& vki, +vk::Move createDevice (const deUint32 apiVersion, + const vk::InstanceInterface& vki, vk::VkPhysicalDevice physicalDevice, vk::VkExternalMemoryHandleTypeFlagBits memoryHandleType, vk::VkExternalSemaphoreHandleTypeFlagBits semaphoreHandleType, @@ -228,13 +230,17 @@ vk::Move createDevice (const vk::InstanceInterface& vki, std::vector extensions; if (dedicated) - extensions.push_back("VK_KHR_dedicated_allocation"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_dedicated_allocation")) + extensions.push_back("VK_KHR_dedicated_allocation"); if (khrMemReqSupported) - extensions.push_back("VK_KHR_get_memory_requirements2"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_get_memory_requirements2")) + extensions.push_back("VK_KHR_get_memory_requirements2"); - extensions.push_back("VK_KHR_external_semaphore"); - extensions.push_back("VK_KHR_external_memory"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_external_semaphore")) + extensions.push_back("VK_KHR_external_semaphore"); + if (!vk::isCoreDeviceExtension(apiVersion, "VK_KHR_external_memory")) + extensions.push_back("VK_KHR_external_memory"); if (memoryHandleType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT || semaphoreHandleType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT @@ -856,8 +862,8 @@ SharingTestInstance::SharingTestInstance (Context& context, , m_physicalDeviceA (getPhysicalDevice(m_vkiA, *m_instanceA, context.getTestContext().getCommandLine())) , m_queueFamiliesA (vk::getPhysicalDeviceQueueFamilyProperties(m_vkiA, m_physicalDeviceA)) , m_queueFamilyIndicesA (getFamilyIndices(m_queueFamiliesA)) - , m_getMemReq2Supported (de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_get_memory_requirements2")) - , m_deviceA (createDevice(m_vkiA, m_physicalDeviceA, m_config.memoryHandleType, m_config.semaphoreHandleType, m_config.dedicated, m_getMemReq2Supported)) + , m_getMemReq2Supported (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_get_memory_requirements2")) + , m_deviceA (createDevice(context.getUsedApiVersion(), m_vkiA, m_physicalDeviceA, m_config.memoryHandleType, m_config.semaphoreHandleType, m_config.dedicated, m_getMemReq2Supported)) , m_vkdA (m_vkiA, *m_deviceA) , m_instanceB (createInstance(context.getPlatformInterface(), context.getUsedApiVersion())) @@ -866,7 +872,7 @@ SharingTestInstance::SharingTestInstance (Context& context, , m_physicalDeviceB (getPhysicalDevice(m_vkiB, *m_instanceB, getDeviceId(m_vkiA, m_physicalDeviceA))) , m_queueFamiliesB (vk::getPhysicalDeviceQueueFamilyProperties(m_vkiB, m_physicalDeviceB)) , m_queueFamilyIndicesB (getFamilyIndices(m_queueFamiliesB)) - , m_deviceB (createDevice(m_vkiB, m_physicalDeviceB, m_config.memoryHandleType, m_config.semaphoreHandleType, m_config.dedicated, m_getMemReq2Supported)) + , m_deviceB (createDevice(context.getUsedApiVersion(), m_vkiB, m_physicalDeviceB, m_config.memoryHandleType, m_config.semaphoreHandleType, m_config.dedicated, m_getMemReq2Supported)) , m_vkdB (m_vkiB, *m_deviceB) , m_semaphoreHandleType (m_config.semaphoreHandleType) @@ -1017,7 +1023,7 @@ tcu::TestStatus SharingTestInstance::iterate (void) const vk::Unique commandBufferA (createCommandBuffer(m_vkdA, *m_deviceA, *commandPoolA)); vk::SimpleAllocator allocatorA (m_vkdA, *m_deviceA, vk::getPhysicalDeviceMemoryProperties(m_vkiA, m_physicalDeviceA)); const std::vector deviceExtensionsA; - OperationContext operationContextA (m_vkiA, m_vkdA, m_physicalDeviceA, *m_deviceA, allocatorA, deviceExtensionsA, m_context.getBinaryCollection(), m_pipelineCacheData); + OperationContext operationContextA (m_context.getUsedApiVersion(), m_vkiA, m_vkdA, m_physicalDeviceA, *m_deviceA, allocatorA, deviceExtensionsA, m_context.getBinaryCollection(), m_pipelineCacheData); if (!checkQueueFlags(m_queueFamiliesA[m_queueANdx].queueFlags , m_supportWriteOp->getQueueFlags(operationContextA))) TCU_THROW(NotSupportedError, "Operation not supported by the source queue"); @@ -1027,7 +1033,7 @@ tcu::TestStatus SharingTestInstance::iterate (void) const vk::Unique commandBufferB (createCommandBuffer(m_vkdB, *m_deviceB, *commandPoolB)); vk::SimpleAllocator allocatorB (m_vkdB, *m_deviceB, vk::getPhysicalDeviceMemoryProperties(m_vkiB, m_physicalDeviceB)); const std::vector deviceExtensionsB; - OperationContext operationContextB (m_vkiB, m_vkdB, m_physicalDeviceB, *m_deviceB, allocatorB, deviceExtensionsB, m_context.getBinaryCollection(), m_pipelineCacheData); + OperationContext operationContextB (m_context.getUsedApiVersion(), m_vkiB, m_vkdB, m_physicalDeviceB, *m_deviceB, allocatorB, deviceExtensionsB, m_context.getBinaryCollection(), m_pipelineCacheData); if (!checkQueueFlags(m_queueFamiliesB[m_queueBNdx].queueFlags , m_supportReadOp->getQueueFlags(operationContextB))) TCU_THROW(NotSupportedError, "Operation not supported by the destination queue"); diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp index 18ecc7e..58fcabc 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp @@ -561,7 +561,7 @@ public: VkQueueFlags getQueueFlags (const OperationContext& context) const { if (m_bufferOp == BUFFER_OP_FILL && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance1")) + !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1")) { return VK_QUEUE_COMPUTE_BIT | VK_QUEUE_GRAPHICS_BIT; } @@ -3412,6 +3412,7 @@ OperationContext::OperationContext (Context& context, PipelineCacheData& pipelin , m_progCollection (context.getBinaryCollection()) , m_pipelineCacheData (pipelineCacheData) , m_deviceExtensions (context.getDeviceExtensions()) + , m_usedApiVersion (context.getUsedApiVersion()) { } @@ -3424,10 +3425,12 @@ OperationContext::OperationContext (Context& context, PipelineCacheData& pipelin , m_progCollection (context.getBinaryCollection()) , m_pipelineCacheData (pipelineCacheData) , m_deviceExtensions (context.getDeviceExtensions()) + , m_usedApiVersion (context.getUsedApiVersion()) { } -OperationContext::OperationContext (const vk::InstanceInterface& vki, +OperationContext::OperationContext (const deUint32 apiVersion, + const vk::InstanceInterface& vki, const vk::DeviceInterface& vkd, vk::VkPhysicalDevice physicalDevice, vk::VkDevice device, @@ -3443,6 +3446,7 @@ OperationContext::OperationContext (const vk::InstanceInterface& vki, , m_progCollection (programCollection) , m_pipelineCacheData (pipelineCacheData) , m_deviceExtensions (deviceExtensions) + , m_usedApiVersion (apiVersion) { } diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.hpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.hpp index f4e78c1..b6426b1 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.hpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.hpp @@ -119,7 +119,8 @@ public: const vk::VkDevice device, vk::Allocator& allocator); - OperationContext (const vk::InstanceInterface& vki, + OperationContext (const deUint32 apiVersion, + const vk::InstanceInterface& vki, const vk::DeviceInterface& vkd, vk::VkPhysicalDevice physicalDevice, vk::VkDevice device, @@ -136,6 +137,7 @@ public: vk::ProgramCollection& getBinaryCollection (void) const { return m_progCollection; } PipelineCacheData& getPipelineCacheData (void) const { return m_pipelineCacheData; } const std::vector& getDeviceExtensions (void) const { return m_deviceExtensions;} + deUint32 getUsedApiVersion (void) const { return m_usedApiVersion; } private: const vk::InstanceInterface& m_vki; @@ -146,6 +148,7 @@ private: vk::ProgramCollection& m_progCollection; PipelineCacheData& m_pipelineCacheData; const std::vector& m_deviceExtensions; + const deUint32 m_usedApiVersion; // Disabled OperationContext (const OperationContext&); diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp index 6ed61af..6c78833 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationWin32KeyedMutexTests.cpp @@ -65,6 +65,7 @@ using namespace vkt::ExternalMemoryUtil; namespace vkt { +using namespace vk; namespace synchronization { namespace @@ -144,10 +145,10 @@ vk::Move createInstance (const vk::PlatformInterface& vkp, deUin try { std::vector extensions; - - extensions.push_back("VK_KHR_get_physical_device_properties2"); - - extensions.push_back("VK_KHR_external_memory_capabilities"); + if (!isCoreInstanceExtension(version, "VK_KHR_get_physical_device_properties2")) + extensions.push_back("VK_KHR_get_physical_device_properties2"); + if (!isCoreInstanceExtension(version, "VK_KHR_get_physical_device_properties2")) + extensions.push_back("VK_KHR_external_memory_capabilities"); return vk::createDefaultInstance(vkp, version, std::vector(), extensions); } @@ -167,7 +168,8 @@ vk::VkPhysicalDevice getPhysicalDevice (const vk::InstanceInterface& vki, return vk::chooseDevice(vki, instance, cmdLine); } -vk::Move createDevice (const vk::InstanceInterface& vki, +vk::Move createDevice (const deUint32 apiVersion, + const vk::InstanceInterface& vki, vk::VkPhysicalDevice physicalDevice) { const float priority = 0.0f; @@ -175,11 +177,15 @@ vk::Move createDevice (const vk::InstanceInterface& vki, std::vector queueFamilyIndices (queueFamilyProperties.size(), 0xFFFFFFFFu); std::vector extensions; - extensions.push_back("VK_KHR_external_memory"); + if (!isCoreDeviceExtension(apiVersion, "VK_KHR_external_memory")) + extensions.push_back("VK_KHR_external_memory"); + if (!isCoreDeviceExtension(apiVersion, "VK_KHR_dedicated_allocation")) + extensions.push_back("VK_KHR_dedicated_allocation"); + if (!isCoreDeviceExtension(apiVersion, "VK_KHR_get_memory_requirements2")) + extensions.push_back("VK_KHR_get_memory_requirements2"); + extensions.push_back("VK_KHR_external_memory_win32"); extensions.push_back("VK_KHR_win32_keyed_mutex"); - extensions.push_back("VK_KHR_dedicated_allocation"); - extensions.push_back("VK_KHR_get_memory_requirements2"); try { @@ -1436,7 +1442,7 @@ Win32KeyedMutexTestInstance::Win32KeyedMutexTestInstance (Context& context, , m_physicalDevice (getPhysicalDevice(m_vki, *m_instance, context.getTestContext().getCommandLine())) , m_queueFamilies (vk::getPhysicalDeviceQueueFamilyProperties(m_vki, m_physicalDevice)) , m_queueFamilyIndices (getFamilyIndices(m_queueFamilies)) - , m_device (createDevice(m_vki, m_physicalDevice)) + , m_device (createDevice(context.getUsedApiVersion(), m_vki, m_physicalDevice)) , m_vkd (m_vki, *m_device) , m_supportDX11 (new DX11OperationSupport(m_vki, m_physicalDevice, config.resource)) @@ -1554,7 +1560,7 @@ tcu::TestStatus Win32KeyedMutexTestInstance::iterate (void) const vk::Unique commandBufferRead (allocateCommandBuffer(m_vkd, *m_device, *commandPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY)); vk::SimpleAllocator allocator (m_vkd, *m_device, vk::getPhysicalDeviceMemoryProperties(m_vki, m_physicalDevice)); const std::vector deviceExtensions; - OperationContext operationContext (m_vki, m_vkd, m_physicalDevice, *m_device, allocator, deviceExtensions, m_context.getBinaryCollection(), m_pipelineCacheData); + OperationContext operationContext (m_context.getUsedApiVersion(), m_vki, m_vkd, m_physicalDevice, *m_device, allocator, deviceExtensions, m_context.getBinaryCollection(), m_pipelineCacheData); if (!checkQueueFlags(m_queueFamilies[m_queueNdx].queueFlags, vk::VK_QUEUE_GRAPHICS_BIT)) TCU_THROW(NotSupportedError, "Operation not supported by the source queue"); diff --git a/external/vulkancts/modules/vulkan/tessellation/vktTessellationWindingTests.cpp b/external/vulkancts/modules/vulkan/tessellation/vktTessellationWindingTests.cpp index c435143..8f0a0a8 100644 --- a/external/vulkancts/modules/vulkan/tessellation/vktTessellationWindingTests.cpp +++ b/external/vulkancts/modules/vulkan/tessellation/vktTessellationWindingTests.cpp @@ -401,7 +401,7 @@ WindingTestInstance::WindingTestInstance (Context& context, void WindingTestInstance::requireExtension (const char* name) const { - if (!de::contains(m_context.getDeviceExtensions().begin(), m_context.getDeviceExtensions().end(), name)) + if(!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), name)) TCU_THROW(NotSupportedError, (std::string(name) + " is not supported").c_str()); } diff --git a/external/vulkancts/modules/vulkan/vktTestCase.cpp b/external/vulkancts/modules/vulkan/vktTestCase.cpp index b31343b..d6866fa 100644 --- a/external/vulkancts/modules/vulkan/vktTestCase.cpp +++ b/external/vulkancts/modules/vulkan/vktTestCase.cpp @@ -203,7 +203,7 @@ static deUint32 findQueueFamilyIndexWithCaps (const InstanceInterface& vkInstanc Move createDefaultDevice (const InstanceInterface& vki, VkPhysicalDevice physicalDevice, - deUint32 apiVersion, + const deUint32 apiVersion, deUint32 queueIndex, const VkPhysicalDeviceFeatures2& enabledFeatures, const vector& enabledExtensions, @@ -264,9 +264,9 @@ Move createDefaultDevice (const InstanceInterface& vki, return createDevice(vki, physicalDevice, &deviceInfo); }; -bool isPhysicalDeviceFeatures2Supported (const vector& instanceExtensions) +bool isPhysicalDeviceFeatures2Supported (const deUint32 version, const vector& instanceExtensions) { - return de::contains(instanceExtensions.begin(), instanceExtensions.end(), "VK_KHR_get_physical_device_properties2"); + return isInstanceExtensionSupported(version, instanceExtensions, "VK_KHR_get_physical_device_properties"); } struct DeviceFeatures @@ -275,6 +275,7 @@ struct DeviceFeatures VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYCbCrConversionFeatures; DeviceFeatures (const InstanceInterface& vki, + const deUint32 apiVersion, VkPhysicalDevice physicalDevice, const vector& instanceExtensions, const vector& deviceExtensions) @@ -287,7 +288,7 @@ struct DeviceFeatures coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2; samplerYCbCrConversionFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR; - if (isPhysicalDeviceFeatures2Supported(instanceExtensions)) + if (isPhysicalDeviceFeatures2Supported(apiVersion, instanceExtensions)) { if (de::contains(deviceExtensions.begin(), deviceExtensions.end(), "VK_KHR_sampler_ycbcr_conversion")) { diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp index ba66c89..a36e1f6 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp @@ -39,6 +39,7 @@ #include "vkWsiPlatform.hpp" #include "vkWsiUtil.hpp" #include "vkAllocationCallbackUtil.hpp" +#include "vkQueryUtil.hpp" #include "tcuTestLog.hpp" #include "tcuFormatUtil.hpp" @@ -168,17 +169,6 @@ struct CheckPhysicalDeviceSurfacePresentModesIncompleteResult : public CheckInco typedef vector Extensions; -void checkAllSupported (const Extensions& supportedExtensions, const vector& requiredExtensions) -{ - for (vector::const_iterator requiredExtName = requiredExtensions.begin(); - requiredExtName != requiredExtensions.end(); - ++requiredExtName) - { - if (!isExtensionSupported(supportedExtensions, RequiredExtension(*requiredExtName))) - TCU_THROW(NotSupportedError, (*requiredExtName + " is not supported").c_str()); - } -} - Move createInstanceWithWsi (const PlatformInterface& vkp, deUint32 version, const Extensions& supportedExtensions, @@ -186,12 +176,21 @@ Move createInstanceWithWsi (const PlatformInterface& vkp, const vector extraExtensions, const VkAllocationCallbacks* pAllocator = DE_NULL) { - vector extensions = extraExtensions; + vector extensions; extensions.push_back("VK_KHR_surface"); extensions.push_back(getExtensionName(wsiType)); - checkAllSupported(supportedExtensions, extensions); + for (vector::const_iterator extraExtensionsName = extraExtensions.begin(); + extraExtensionsName != extraExtensions.end(); + ++extraExtensionsName) + { + if (!isInstanceExtensionSupported(version, supportedExtensions, RequiredExtension(*extraExtensionsName))) + TCU_THROW(NotSupportedError, (*extraExtensionsName + " is not supported").c_str()); + + if (!isCoreInstanceExtension(version, *extraExtensionsName)) + extensions.push_back(*extraExtensionsName); + } return vk::createDefaultInstance(vkp, version, vector(), extensions, pAllocator); } @@ -773,7 +772,9 @@ tcu::TestStatus queryDevGroupSurfacePresentCapabilitiesTest (Context& context, T deUint32 queueFamilyIndex = 0; VkDeviceGroupPresentCapabilitiesKHR* presentCapabilities; std::vector deviceExtensions; - deviceExtensions.push_back("VK_KHR_device_group"); + + if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_device_group")) + deviceExtensions.push_back("VK_KHR_device_group"); deviceExtensions.push_back("VK_KHR_swapchain"); const vector deviceGroupProps = enumeratePhysicalDeviceGroups(instHelper.vki, *instHelper.instance); @@ -872,7 +873,10 @@ tcu::TestStatus queryDevGroupSurfacePresentModesTest (Context& context, Type wsi VkDeviceGroupPresentModeFlagsKHR* presentModeFlags; vector rectanglesBuffer; std::vector deviceExtensions; - deviceExtensions.push_back("VK_KHR_device_group"); + + if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_device_group")) + deviceExtensions.push_back("VK_KHR_device_group"); + deviceExtensions.push_back("VK_KHR_swapchain"); const vector deviceGroupProps = enumeratePhysicalDeviceGroups(instHelper.vki, *instHelper.instance); diff --git a/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrConversionTests.cpp b/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrConversionTests.cpp index cae77d0..28d94f8 100644 --- a/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrConversionTests.cpp +++ b/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrConversionTests.cpp @@ -1937,7 +1937,7 @@ tcu::TestStatus textureConversionTest (Context& context, const TestConfig config logTestCaseInfo(log, config); #if !defined(FAKE_COLOR_CONVERSION) - if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), string("VK_KHR_sampler_ycbcr_conversion"))) + if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_sampler_ycbcr_conversion")) TCU_THROW(NotSupportedError, "Extension VK_KHR_sampler_ycbcr_conversion not supported"); try diff --git a/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrUtil.cpp b/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrUtil.cpp index 6de2ccf..3123fbb 100644 --- a/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrUtil.cpp +++ b/external/vulkancts/modules/vulkan/ycbcr/vktYCbCrUtil.cpp @@ -189,12 +189,15 @@ void checkImageSupport (Context& context, VkFormat format, VkImageCreateFlags cr const VkPhysicalDeviceSamplerYcbcrConversionFeatures* features = findStructure(context.getDeviceFeatures2().pNext); vector reqExts; - reqExts.push_back("VK_KHR_sampler_ycbcr_conversion"); + if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversio")) + reqExts.push_back("VK_KHR_sampler_ycbcr_conversion"); if (disjoint) { - reqExts.push_back("VK_KHR_bind_memory2"); - reqExts.push_back("VK_KHR_get_memory_requirements2"); + if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_bind_memory2")) + reqExts.push_back("VK_KHR_bind_memory2"); + if (!isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_get_memory_requirements2")) + reqExts.push_back("VK_KHR_get_memory_requirements2"); } for (vector::const_iterator extIter = reqExts.begin(); extIter != reqExts.end(); ++extIter) diff --git a/external/vulkancts/scripts/src/vulkan.h.in b/external/vulkancts/scripts/src/vulkan.h.in index 0de20c2..9f538db 100644 --- a/external/vulkancts/scripts/src/vulkan.h.in +++ b/external/vulkancts/scripts/src/vulkan.h.in @@ -5181,12 +5181,12 @@ typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; #define VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO #define VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR VK_ERROR_INVALID_EXTERNAL_HANDLE #define VK_QUEUE_FAMILY_EXTERNAL_KHR VK_QUEUE_FAMILY_EXTERNAL +//VK_KHR_external_memory DEVICE 1_1_0 #ifdef VK_USE_PLATFORM_WIN32_KHR #define VK_KHR_external_memory_win32 1 #define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" -//VK_KHR_external_memory DEVICE 1_1_0 typedef struct VkImportMemoryWin32HandleInfoKHR { VkStructureType sType; @@ -5324,12 +5324,12 @@ typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR; #define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" #define VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO +//VK_KHR_external_semaphore DEVICE 1_1_0 #ifdef VK_USE_PLATFORM_WIN32_KHR #define VK_KHR_external_semaphore_win32 1 #define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" -//VK_KHR_external_semaphore DEVICE 1_1_0 typedef struct VkImportSemaphoreWin32HandleInfoKHR { VkStructureType sType; @@ -5560,7 +5560,7 @@ typedef VkExportFenceCreateInfo VkExportFenceCreateInfoKHR; #define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME "VK_KHR_external_fence" #define VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO -//VK_KHR_external_fence INSTANCE 1_1_0 +//VK_KHR_external_fence DEVICE 1_1_0 #ifdef VK_USE_PLATFORM_WIN32_KHR #define VK_KHR_external_fence_win32 1 @@ -5660,11 +5660,11 @@ typedef VkPipelineTessellationDomainOriginStateCreateInfo VkPipelineTessellation #define VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO #define VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL #define VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL +//VK_KHR_maintenance2 DEVICE 1_1_0 #define VK_KHR_get_surface_capabilities2 1 #define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1 #define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2" -//VK_KHR_maintenance2 DEVICE 1_1_0 typedef struct VkPhysicalDeviceSurfaceInfo2KHR { VkStructureType sType; @@ -5706,11 +5706,11 @@ typedef VkPhysicalDeviceVariablePointerFeatures VkPhysicalDeviceVariablePointerF #define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1 #define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers" #define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES +//VK_KHR_variable_pointers DEVICE 1_1_0 #define VK_KHR_get_display_properties2 1 #define VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION 1 #define VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_display_properties2" -//VK_KHR_variable_pointers DEVICE 1_1_0 typedef struct VkDisplayProperties2KHR { VkStructureType sType; -- 2.7.4