From: ziga-lunarg Date: Thu, 10 Nov 2022 11:47:31 +0000 (+0100) Subject: Test creating device with promoted feature structures X-Git-Tag: upstream/1.3.5~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1c8f77b33b3fbb5c2e4e3c93c7af4ded5f069fe;p=platform%2Fupstream%2FVK-GL-CTS.git Test creating device with promoted feature structures Create device with structures from promoted extensions in the pNext chain of VkDeviceCreateInfo, even when the extensions are not supported Components: Vulkan VK-GL-CTS issue: 4071 New tests: dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted11_structures dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted12_structures dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted13_structures Change-Id: Ifc5fa05635b7363dad727bd2390db10cdef35d88 --- diff --git a/android/cts/main/vk-master-2022-03-01/api.txt b/android/cts/main/vk-master-2022-03-01/api.txt index 3e2e70a..9350b10 100644 --- a/android/cts/main/vk-master-2022-03-01/api.txt +++ b/android/cts/main/vk-master-2022-03-01/api.txt @@ -41,6 +41,9 @@ dEQP-VK.api.info.get_physical_device_properties2.features.attachment_feedback_lo dEQP-VK.api.info.get_physical_device_properties2.features.depth_clamp_zero_one_features_ext dEQP-VK.api.info.get_physical_device_properties2.features.address_binding_report_features_ext dEQP-VK.api.info.get_physical_device_properties2.features.fault_features_ext +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted11_structures +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted12_structures +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted13_structures dEQP-VK.api.info.vulkan1p3.features dEQP-VK.api.info.vulkan1p3.properties dEQP-VK.api.info.vulkan1p3.feature_extensions_consistency diff --git a/android/cts/main/vk-master/api.txt b/android/cts/main/vk-master/api.txt index 0236de7..19f96bc 100644 --- a/android/cts/main/vk-master/api.txt +++ b/android/cts/main/vk-master/api.txt @@ -1980,6 +1980,9 @@ dEQP-VK.api.info.get_physical_device_properties2.features.attachment_feedback_lo dEQP-VK.api.info.get_physical_device_properties2.features.depth_clamp_zero_one_features_ext dEQP-VK.api.info.get_physical_device_properties2.features.address_binding_report_features_ext dEQP-VK.api.info.get_physical_device_properties2.features.fault_features_ext +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted11_structures +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted12_structures +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted13_structures dEQP-VK.api.info.get_physical_device_properties2.properties.basic dEQP-VK.api.info.get_physical_device_properties2.format_properties.basic dEQP-VK.api.info.get_physical_device_properties2.queue_family_properties.basic diff --git a/external/vulkancts/framework/vulkan/generated/vulkan/vkDeviceFeatures2.inl b/external/vulkancts/framework/vulkan/generated/vulkan/vkDeviceFeatures2.inl index 294a206..4032cb2 100644 --- a/external/vulkancts/framework/vulkan/generated/vulkan/vkDeviceFeatures2.inl +++ b/external/vulkancts/framework/vulkan/generated/vulkan/vkDeviceFeatures2.inl @@ -4263,6 +4263,200 @@ tcu::TestStatus testPhysicalDeviceFeatureFaultFeaturesEXT (Context& context) return tcu::TestStatus::pass("Querying succeeded"); } +tcu::TestStatus createDeviceWithPromoted11Structures (Context& context) +{ + if (!context.contextSupports(vk::ApiVersion(0, 1, 1, 0))) + TCU_THROW(NotSupportedError, "Vulkan 1.1 is not supported"); + + const PlatformInterface& platformInterface = context.getPlatformInterface(); + const CustomInstance instance (createCustomInstanceFromContext(context)); + const InstanceDriver& instanceDriver (instance.getDriver()); + const VkPhysicalDevice physicalDevice = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine()); + const deUint32 queueFamilyIndex = 0; + const deUint32 queueCount = 1; + const deUint32 queueIndex = 0; + const float queuePriority = 1.0f; + + const vector queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice); + + const VkDeviceQueueCreateInfo deviceQueueCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, + DE_NULL, + (VkDeviceQueueCreateFlags)0u, + queueFamilyIndex, //queueFamilyIndex; + queueCount, //queueCount; + &queuePriority, //pQueuePriorities; + }; + + VkPhysicalDeviceMultiviewFeaturesKHR deviceMultiviewFeatures = initVulkanStructure(); + VkPhysicalDevice16BitStorageFeaturesKHR device16BitStorageFeatures = initVulkanStructure(&deviceMultiviewFeatures); + VkPhysicalDeviceVariablePointerFeaturesKHR deviceVariablePointersFeatures = initVulkanStructure(&device16BitStorageFeatures); + VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR deviceSamplerYcbcrConversionFeatures = initVulkanStructure(&deviceVariablePointersFeatures); + VkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&deviceSamplerYcbcrConversionFeatures); + + instanceDriver.getPhysicalDeviceFeatures2 (physicalDevice, &extFeatures); + + const VkDeviceCreateInfo deviceCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType; + &extFeatures, //pNext; + (VkDeviceCreateFlags)0u, + 1, //queueRecordCount; + &deviceQueueCreateInfo, //pRequestedQueues; + 0, //layerCount; + DE_NULL, //ppEnabledLayerNames; + 0, //extensionCount; + DE_NULL, //ppEnabledExtensionNames; + DE_NULL, //pEnabledFeatures; + }; + + const Unique device (createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), platformInterface, instance, instanceDriver, physicalDevice, &deviceCreateInfo)); + const DeviceDriver deviceDriver (platformInterface, instance, device.get()); + const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex); + + VK_CHECK(deviceDriver.queueWaitIdle(queue)); + + return tcu::TestStatus::pass("Pass"); +} + +tcu::TestStatus createDeviceWithPromoted12Structures (Context& context) +{ + if (!context.contextSupports(vk::ApiVersion(0, 1, 2, 0))) + TCU_THROW(NotSupportedError, "Vulkan 1.2 is not supported"); + + const PlatformInterface& platformInterface = context.getPlatformInterface(); + const CustomInstance instance (createCustomInstanceFromContext(context)); + const InstanceDriver& instanceDriver (instance.getDriver()); + const VkPhysicalDevice physicalDevice = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine()); + const deUint32 queueFamilyIndex = 0; + const deUint32 queueCount = 1; + const deUint32 queueIndex = 0; + const float queuePriority = 1.0f; + + const vector queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice); + + const VkDeviceQueueCreateInfo deviceQueueCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, + DE_NULL, + (VkDeviceQueueCreateFlags)0u, + queueFamilyIndex, //queueFamilyIndex; + queueCount, //queueCount; + &queuePriority, //pQueuePriorities; + }; + + VkPhysicalDeviceShaderFloat16Int8FeaturesKHR deviceShaderFloat16Int8Features = initVulkanStructure(); + VkPhysicalDeviceImagelessFramebufferFeaturesKHR deviceImagelessFramebufferFeatures = initVulkanStructure(&deviceShaderFloat16Int8Features); + VkPhysicalDeviceDescriptorIndexingFeaturesEXT deviceDescriptorIndexingFeatures = initVulkanStructure(&deviceImagelessFramebufferFeatures); + VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR deviceShaderSubgroupExtendedTypesFeatures = initVulkanStructure(&deviceDescriptorIndexingFeatures); + VkPhysicalDevice8BitStorageFeaturesKHR device8BitStorageFeatures = initVulkanStructure(&deviceShaderSubgroupExtendedTypesFeatures); + VkPhysicalDeviceShaderAtomicInt64FeaturesKHR deviceShaderAtomicInt64Features = initVulkanStructure(&device8BitStorageFeatures); + VkPhysicalDeviceTimelineSemaphoreFeaturesKHR deviceTimelineSemaphoreFeatures = initVulkanStructure(&deviceShaderAtomicInt64Features); + VkPhysicalDeviceVulkanMemoryModelFeaturesKHR deviceVulkanMemoryModelFeatures = initVulkanStructure(&deviceTimelineSemaphoreFeatures); + VkPhysicalDeviceScalarBlockLayoutFeaturesEXT deviceScalarBlockLayoutFeatures = initVulkanStructure(&deviceVulkanMemoryModelFeatures); + VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR deviceSeparateDepthStencilLayoutsFeatures = initVulkanStructure(&deviceScalarBlockLayoutFeatures); + VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR deviceUniformBufferStandardLayoutFeatures = initVulkanStructure(&deviceSeparateDepthStencilLayoutsFeatures); + VkPhysicalDeviceBufferDeviceAddressFeaturesKHR deviceBufferDeviceAddressFeatures = initVulkanStructure(&deviceUniformBufferStandardLayoutFeatures); + VkPhysicalDeviceHostQueryResetFeaturesEXT deviceHostQueryResetFeatures = initVulkanStructure(&deviceBufferDeviceAddressFeatures); + VkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&deviceHostQueryResetFeatures); + + instanceDriver.getPhysicalDeviceFeatures2 (physicalDevice, &extFeatures); + + const VkDeviceCreateInfo deviceCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType; + &extFeatures, //pNext; + (VkDeviceCreateFlags)0u, + 1, //queueRecordCount; + &deviceQueueCreateInfo, //pRequestedQueues; + 0, //layerCount; + DE_NULL, //ppEnabledLayerNames; + 0, //extensionCount; + DE_NULL, //ppEnabledExtensionNames; + DE_NULL, //pEnabledFeatures; + }; + + const Unique device (createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), platformInterface, instance, instanceDriver, physicalDevice, &deviceCreateInfo)); + const DeviceDriver deviceDriver (platformInterface, instance, device.get()); + const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex); + + VK_CHECK(deviceDriver.queueWaitIdle(queue)); + + return tcu::TestStatus::pass("Pass"); +} + +tcu::TestStatus createDeviceWithPromoted13Structures (Context& context) +{ + if (!context.contextSupports(vk::ApiVersion(0, 1, 3, 0))) + TCU_THROW(NotSupportedError, "Vulkan 1.3 is not supported"); + + const PlatformInterface& platformInterface = context.getPlatformInterface(); + const CustomInstance instance (createCustomInstanceFromContext(context)); + const InstanceDriver& instanceDriver (instance.getDriver()); + const VkPhysicalDevice physicalDevice = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine()); + const deUint32 queueFamilyIndex = 0; + const deUint32 queueCount = 1; + const deUint32 queueIndex = 0; + const float queuePriority = 1.0f; + + const vector queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice); + + const VkDeviceQueueCreateInfo deviceQueueCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, + DE_NULL, + (VkDeviceQueueCreateFlags)0u, + queueFamilyIndex, //queueFamilyIndex; + queueCount, //queueCount; + &queuePriority, //pQueuePriorities; + }; + + VkPhysicalDeviceDynamicRenderingFeaturesKHR deviceDynamicRenderingFeatures = initVulkanStructure(); + VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT deviceTextureCompressionASTCHDRFeatures = initVulkanStructure(&deviceDynamicRenderingFeatures); + VkPhysicalDeviceInlineUniformBlockFeaturesEXT deviceInlineUniformBlockFeatures = initVulkanStructure(&deviceTextureCompressionASTCHDRFeatures); + VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR deviceShaderTerminateInvocationFeatures = initVulkanStructure(&deviceInlineUniformBlockFeatures); + VkPhysicalDeviceSubgroupSizeControlFeaturesEXT deviceSubgroupSizeControlFeatures = initVulkanStructure(&deviceShaderTerminateInvocationFeatures); + VkPhysicalDeviceExtendedDynamicStateFeaturesEXT deviceExtendedDynamicStateFeaturesEXT = initVulkanStructure(&deviceSubgroupSizeControlFeatures); + VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT deviceShaderDemoteToHelperInvocationFeatures = initVulkanStructure(&deviceExtendedDynamicStateFeaturesEXT); + VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR deviceShaderIntegerDotProductFeatures = initVulkanStructure(&deviceShaderDemoteToHelperInvocationFeatures); + VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT deviceTexelBufferAlignmentFeaturesEXT = initVulkanStructure(&deviceShaderIntegerDotProductFeatures); + VkPhysicalDevicePrivateDataFeaturesEXT devicePrivateDataFeatures = initVulkanStructure(&deviceTexelBufferAlignmentFeaturesEXT); + VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT devicePipelineCreationCacheControlFeatures = initVulkanStructure(&devicePrivateDataFeatures); + VkPhysicalDeviceSynchronization2FeaturesKHR deviceSynchronization2Features = initVulkanStructure(&devicePipelineCreationCacheControlFeatures); + VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR deviceZeroInitializeWorkgroupMemoryFeatures = initVulkanStructure(&deviceSynchronization2Features); + VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT deviceYcbcr2Plane444FormatsFeaturesEXT = initVulkanStructure(&deviceZeroInitializeWorkgroupMemoryFeatures); + VkPhysicalDeviceImageRobustnessFeaturesEXT deviceImageRobustnessFeatures = initVulkanStructure(&deviceYcbcr2Plane444FormatsFeaturesEXT); + VkPhysicalDevice4444FormatsFeaturesEXT device4444FormatsFeaturesEXT = initVulkanStructure(&deviceImageRobustnessFeatures); + VkPhysicalDeviceExtendedDynamicState2FeaturesEXT deviceExtendedDynamicState2FeaturesEXT = initVulkanStructure(&device4444FormatsFeaturesEXT); + VkPhysicalDeviceMaintenance4FeaturesKHR deviceMaintenance4Features = initVulkanStructure(&deviceExtendedDynamicState2FeaturesEXT); + VkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&deviceMaintenance4Features); + + instanceDriver.getPhysicalDeviceFeatures2 (physicalDevice, &extFeatures); + + const VkDeviceCreateInfo deviceCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType; + &extFeatures, //pNext; + (VkDeviceCreateFlags)0u, + 1, //queueRecordCount; + &deviceQueueCreateInfo, //pRequestedQueues; + 0, //layerCount; + DE_NULL, //ppEnabledLayerNames; + 0, //extensionCount; + DE_NULL, //ppEnabledExtensionNames; + DE_NULL, //pEnabledFeatures; + }; + + const Unique device (createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), platformInterface, instance, instanceDriver, physicalDevice, &deviceCreateInfo)); + const DeviceDriver deviceDriver (platformInterface, instance, device.get()); + const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex); + + VK_CHECK(deviceDriver.queueWaitIdle(queue)); + + return tcu::TestStatus::pass("Pass"); +} + void addSeparateFeatureTests (tcu::TestCaseGroup* testGroup) { addFunctionCase(testGroup, "private_data_features", "VkPhysicalDevicePrivateDataFeatures", testPhysicalDeviceFeaturePrivateDataFeatures); @@ -4374,5 +4568,8 @@ void addSeparateFeatureTests (tcu::TestCaseGroup* testGroup) addFunctionCase(testGroup, "depth_clamp_zero_one_features_ext", "VkPhysicalDeviceDepthClampZeroOneFeaturesEXT", testPhysicalDeviceFeatureDepthClampZeroOneFeaturesEXT); addFunctionCase(testGroup, "address_binding_report_features_ext", "VkPhysicalDeviceAddressBindingReportFeaturesEXT", testPhysicalDeviceFeatureAddressBindingReportFeaturesEXT); addFunctionCase(testGroup, "fault_features_ext", "VkPhysicalDeviceFaultFeaturesEXT", testPhysicalDeviceFeatureFaultFeaturesEXT); + addFunctionCase(testGroup, "create_device_with_promoted11_structures", "", createDeviceWithPromoted11Structures); + addFunctionCase(testGroup, "create_device_with_promoted12_structures", "", createDeviceWithPromoted12Structures); + addFunctionCase(testGroup, "create_device_with_promoted13_structures", "", createDeviceWithPromoted13Structures); } diff --git a/external/vulkancts/mustpass/main/vk-default/api.txt b/external/vulkancts/mustpass/main/vk-default/api.txt index 6755d6a..a1d7c7e 100644 --- a/external/vulkancts/mustpass/main/vk-default/api.txt +++ b/external/vulkancts/mustpass/main/vk-default/api.txt @@ -1980,6 +1980,9 @@ dEQP-VK.api.info.get_physical_device_properties2.features.attachment_feedback_lo dEQP-VK.api.info.get_physical_device_properties2.features.depth_clamp_zero_one_features_ext dEQP-VK.api.info.get_physical_device_properties2.features.address_binding_report_features_ext dEQP-VK.api.info.get_physical_device_properties2.features.fault_features_ext +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted11_structures +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted12_structures +dEQP-VK.api.info.get_physical_device_properties2.features.create_device_with_promoted13_structures dEQP-VK.api.info.get_physical_device_properties2.properties.basic dEQP-VK.api.info.get_physical_device_properties2.format_properties.basic dEQP-VK.api.info.get_physical_device_properties2.queue_family_properties.basic diff --git a/external/vulkancts/scripts/gen_framework.py b/external/vulkancts/scripts/gen_framework.py index 8e9ba28..2eaefe1 100755 --- a/external/vulkancts/scripts/gen_framework.py +++ b/external/vulkancts/scripts/gen_framework.py @@ -2121,10 +2121,95 @@ def writeDeviceFeatures2(api, filename): stream.append('\treturn tcu::TestStatus::pass("Querying succeeded");') stream.append("}\n") + allApiVersions = [f.number for f in api.features] + promotedTests = [] + for version in allApiVersions: + major = version[0] + minor = version[-1] + promotedFeatures = [] + for ext in api.extensions: + if ext.promotedto == "VK_VERSION_" + version.replace('.', '_'): + for req in ext.requirementsList: + for type in req.newTypes: + matchedStructType = re.search(f'VkPhysicalDevice(\w+)Features(\w+)', type.name, re.IGNORECASE) + if matchedStructType: + promotedFeatures.append(type) + break + + if promotedFeatures: + testName = "createDeviceWithPromoted" + version.replace('.', '') + "Structures" + promotedTests.append(testName) + stream.append("tcu::TestStatus " + testName + " (Context& context)") + stream.append("{") + stream.append( + ' if (!context.contextSupports(vk::ApiVersion(0, ' + major + ', ' + minor + ', 0)))\n' + ' TCU_THROW(NotSupportedError, "Vulkan ' + major + '.' + minor + ' is not supported");') + stream.append(""" + const PlatformInterface& platformInterface = context.getPlatformInterface(); + const CustomInstance instance (createCustomInstanceFromContext(context)); + const InstanceDriver& instanceDriver (instance.getDriver()); + const VkPhysicalDevice physicalDevice = chooseDevice(instanceDriver, instance, context.getTestContext().getCommandLine()); + const deUint32 queueFamilyIndex = 0; + const deUint32 queueCount = 1; + const deUint32 queueIndex = 0; + const float queuePriority = 1.0f; + + const vector queueFamilyProperties = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice); + + const VkDeviceQueueCreateInfo deviceQueueCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, + DE_NULL, + (VkDeviceQueueCreateFlags)0u, + queueFamilyIndex, //queueFamilyIndex; + queueCount, //queueCount; + &queuePriority, //pQueuePriorities; + }; +""") + lastFeature = '' + for feature in promotedFeatures: + for struct in testedStructureDetail: + if feature.name in struct.nameList: + if lastFeature: + stream.append("\t" + feature.name + " " + struct.instanceName + " = initVulkanStructure(&" + lastFeature + ");") + else: + stream.append("\t" + feature.name + " " + struct.instanceName + " = initVulkanStructure();") + lastFeature = struct.instanceName + break + stream.append("\tVkPhysicalDeviceFeatures2 extFeatures = initVulkanStructure(&" + lastFeature + ");") + stream.append(""" + instanceDriver.getPhysicalDeviceFeatures2 (physicalDevice, &extFeatures); + + const VkDeviceCreateInfo deviceCreateInfo = + { + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType; + &extFeatures, //pNext; + (VkDeviceCreateFlags)0u, + 1, //queueRecordCount; + &deviceQueueCreateInfo, //pRequestedQueues; + 0, //layerCount; + DE_NULL, //ppEnabledLayerNames; + 0, //extensionCount; + DE_NULL, //ppEnabledExtensionNames; + DE_NULL, //pEnabledFeatures; + }; + + const Unique device (createCustomDevice(context.getTestContext().getCommandLine().isValidationEnabled(), platformInterface, instance, instanceDriver, physicalDevice, &deviceCreateInfo)); + const DeviceDriver deviceDriver (platformInterface, instance, device.get()); + const VkQueue queue = getDeviceQueue(deviceDriver, *device, queueFamilyIndex, queueIndex); + + VK_CHECK(deviceDriver.queueWaitIdle(queue)); + + return tcu::TestStatus::pass("Pass"); +} +""") + # function to create tests stream.append("void addSeparateFeatureTests (tcu::TestCaseGroup* testGroup)\n{") for x in testedStructureDetail: stream.append('\taddFunctionCase(testGroup, "' + camelToSnake(x.instanceName[len('device'):]) + '", "' + x.nameList[0] + '", testPhysicalDeviceFeature' + x.instanceName[len('device'):] + ');') + for x in promotedTests: + stream.append('\taddFunctionCase(testGroup, "' + camelToSnake(x) + '", "", ' + x + ');') stream.append('}\n') # write out