From: Michal Pawlowski Date: Fri, 10 Jul 2020 11:03:30 +0000 (+0200) Subject: Support for VkPhysicalDeviceVulkan1{1,2}Properties in framework X-Git-Tag: upstream/1.3.5~1292 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d4965484d1894f7b2b4c65235383d5853f9f8aa;p=platform%2Fupstream%2FVK-GL-CTS.git Support for VkPhysicalDeviceVulkan1{1,2}Properties in framework Use VkPhysicalDeviceVulkan11Properties and VkPhysicalDeviceVulkan12Properties in DefaultDevice chain. Components: Framework VK-GL-CTS issue: 2425 Change-Id: I0858509ccd33e394249d1355ae9c87d0e6735898 Affects: dEQP-VK.* --- diff --git a/external/vulkancts/framework/vulkan/vkDeviceFeatures.cpp b/external/vulkancts/framework/vulkan/vkDeviceFeatures.cpp index cb3c08f..4be44d0 100644 --- a/external/vulkancts/framework/vulkan/vkDeviceFeatures.cpp +++ b/external/vulkancts/framework/vulkan/vkDeviceFeatures.cpp @@ -98,7 +98,7 @@ DeviceFeatures::DeviceFeatures (const InstanceInterface& vki, // fill data from VkPhysicalDeviceVulkan1{1,2}Features if (vk12Supported) { - AllBlobs allBlobs = + AllFeaturesBlobs allBlobs = { m_vulkan11Features, m_vulkan12Features, @@ -106,7 +106,7 @@ DeviceFeatures::DeviceFeatures (const InstanceInterface& vki, }; for (auto feature : featuresToFillFromBlob) - feature->initializeFromBlob(allBlobs); + feature->initializeFeatureFromBlob(allBlobs); } } else diff --git a/external/vulkancts/framework/vulkan/vkDeviceFeatures.hpp b/external/vulkancts/framework/vulkan/vkDeviceFeatures.hpp index 0301978..8278394 100644 --- a/external/vulkancts/framework/vulkan/vkDeviceFeatures.hpp +++ b/external/vulkancts/framework/vulkan/vkDeviceFeatures.hpp @@ -44,7 +44,7 @@ struct FeatureDesc }; // Structure containg all feature blobs - this simplifies generated code -struct AllBlobs +struct AllFeaturesBlobs { VkPhysicalDeviceVulkan11Features& vk11; VkPhysicalDeviceVulkan12Features& vk12; @@ -56,7 +56,7 @@ class FeatureStructWrapperBase { public: virtual ~FeatureStructWrapperBase (void) {} - virtual void initializeFromBlob (const AllBlobs& allBlobs) = 0; + virtual void initializeFeatureFromBlob (const AllFeaturesBlobs& allFeaturesBlobs) = 0; virtual deUint32 getFeatureTypeId (void) const = 0; virtual FeatureDesc getFeatureDesc (void) const = 0; virtual void** getFeatureTypeNext (void) = 0; @@ -81,12 +81,12 @@ FeatureStructWrapperBase* createFeatureStructWrapper (void) } template -void initFromBlob(FeatureType& featureType, const AllBlobs& allBlobs); +void initFeatureFromBlob(FeatureType& featureType, const AllFeaturesBlobs& allFeaturesBlobs); template -void initFromBlobWrapper(FeatureType& featureType, const AllBlobs& allBlobs) +void initFeatureFromBlobWrapper(FeatureType& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - initFromBlob(featureType, allBlobs); + initFeatureFromBlob(featureType, allFeaturesBlobs); } class DeviceFeatures @@ -162,9 +162,9 @@ public: m_featureType.sType = featureDesc.sType; } - void initializeFromBlob (const AllBlobs& allBlobs) + void initializeFeatureFromBlob (const AllFeaturesBlobs& allFeaturesBlobs) { - initFromBlobWrapper(m_featureType, allBlobs); + initFeatureFromBlobWrapper(m_featureType, allFeaturesBlobs); } deUint32 getFeatureTypeId (void) const { return m_featureDesc.typeId; } diff --git a/external/vulkancts/framework/vulkan/vkDeviceFeatures.inl b/external/vulkancts/framework/vulkan/vkDeviceFeatures.inl index 8a0f9d4..2a3da86 100644 --- a/external/vulkancts/framework/vulkan/vkDeviceFeatures.inl +++ b/external/vulkancts/framework/vulkan/vkDeviceFeatures.inl @@ -72,163 +72,163 @@ namespace vk #define VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME "VK_EXT_ycbcr_image_arrays" -template<> void initFromBlob(VkPhysicalDevice16BitStorageFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDevice16BitStorageFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.storageBuffer16BitAccess = allBlobs.vk11.storageBuffer16BitAccess; - featureType.uniformAndStorageBuffer16BitAccess = allBlobs.vk11.uniformAndStorageBuffer16BitAccess; - featureType.storagePushConstant16 = allBlobs.vk11.storagePushConstant16; - featureType.storageInputOutput16 = allBlobs.vk11.storageInputOutput16; + featureType.storageBuffer16BitAccess = allFeaturesBlobs.vk11.storageBuffer16BitAccess; + featureType.uniformAndStorageBuffer16BitAccess = allFeaturesBlobs.vk11.uniformAndStorageBuffer16BitAccess; + featureType.storagePushConstant16 = allFeaturesBlobs.vk11.storagePushConstant16; + featureType.storageInputOutput16 = allFeaturesBlobs.vk11.storageInputOutput16; } -template<> void initFromBlob(VkPhysicalDeviceMultiviewFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceMultiviewFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.multiview = allBlobs.vk11.multiview; - featureType.multiviewGeometryShader = allBlobs.vk11.multiviewGeometryShader; - featureType.multiviewTessellationShader = allBlobs.vk11.multiviewTessellationShader; + featureType.multiview = allFeaturesBlobs.vk11.multiview; + featureType.multiviewGeometryShader = allFeaturesBlobs.vk11.multiviewGeometryShader; + featureType.multiviewTessellationShader = allFeaturesBlobs.vk11.multiviewTessellationShader; } -template<> void initFromBlob(VkPhysicalDeviceVariablePointersFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceVariablePointersFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.variablePointersStorageBuffer = allBlobs.vk11.variablePointersStorageBuffer; - featureType.variablePointers = allBlobs.vk11.variablePointers; + featureType.variablePointersStorageBuffer = allFeaturesBlobs.vk11.variablePointersStorageBuffer; + featureType.variablePointers = allFeaturesBlobs.vk11.variablePointers; } -template<> void initFromBlob(VkPhysicalDeviceProtectedMemoryFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceProtectedMemoryFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.protectedMemory = allBlobs.vk11.protectedMemory; + featureType.protectedMemory = allFeaturesBlobs.vk11.protectedMemory; } -template<> void initFromBlob(VkPhysicalDeviceSamplerYcbcrConversionFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceSamplerYcbcrConversionFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.samplerYcbcrConversion = allBlobs.vk11.samplerYcbcrConversion; + featureType.samplerYcbcrConversion = allFeaturesBlobs.vk11.samplerYcbcrConversion; } -template<> void initFromBlob(VkPhysicalDeviceShaderDrawParametersFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderDrawParametersFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.shaderDrawParameters = allBlobs.vk11.shaderDrawParameters; + featureType.shaderDrawParameters = allFeaturesBlobs.vk11.shaderDrawParameters; } -template<> void initFromBlob(VkPhysicalDevice8BitStorageFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDevice8BitStorageFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.storageBuffer8BitAccess = allBlobs.vk12.storageBuffer8BitAccess; - featureType.uniformAndStorageBuffer8BitAccess = allBlobs.vk12.uniformAndStorageBuffer8BitAccess; - featureType.storagePushConstant8 = allBlobs.vk12.storagePushConstant8; + featureType.storageBuffer8BitAccess = allFeaturesBlobs.vk12.storageBuffer8BitAccess; + featureType.uniformAndStorageBuffer8BitAccess = allFeaturesBlobs.vk12.uniformAndStorageBuffer8BitAccess; + featureType.storagePushConstant8 = allFeaturesBlobs.vk12.storagePushConstant8; } -template<> void initFromBlob(VkPhysicalDeviceShaderAtomicInt64Features& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderAtomicInt64Features& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.shaderBufferInt64Atomics = allBlobs.vk12.shaderBufferInt64Atomics; - featureType.shaderSharedInt64Atomics = allBlobs.vk12.shaderSharedInt64Atomics; + featureType.shaderBufferInt64Atomics = allFeaturesBlobs.vk12.shaderBufferInt64Atomics; + featureType.shaderSharedInt64Atomics = allFeaturesBlobs.vk12.shaderSharedInt64Atomics; } -template<> void initFromBlob(VkPhysicalDeviceShaderFloat16Int8Features& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderFloat16Int8Features& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.shaderFloat16 = allBlobs.vk12.shaderFloat16; - featureType.shaderInt8 = allBlobs.vk12.shaderInt8; + featureType.shaderFloat16 = allFeaturesBlobs.vk12.shaderFloat16; + featureType.shaderInt8 = allFeaturesBlobs.vk12.shaderInt8; } -template<> void initFromBlob(VkPhysicalDeviceDescriptorIndexingFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceDescriptorIndexingFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.shaderInputAttachmentArrayDynamicIndexing = allBlobs.vk12.shaderInputAttachmentArrayDynamicIndexing; - featureType.shaderUniformTexelBufferArrayDynamicIndexing = allBlobs.vk12.shaderUniformTexelBufferArrayDynamicIndexing; - featureType.shaderStorageTexelBufferArrayDynamicIndexing = allBlobs.vk12.shaderStorageTexelBufferArrayDynamicIndexing; - featureType.shaderUniformBufferArrayNonUniformIndexing = allBlobs.vk12.shaderUniformBufferArrayNonUniformIndexing; - featureType.shaderSampledImageArrayNonUniformIndexing = allBlobs.vk12.shaderSampledImageArrayNonUniformIndexing; - featureType.shaderStorageBufferArrayNonUniformIndexing = allBlobs.vk12.shaderStorageBufferArrayNonUniformIndexing; - featureType.shaderStorageImageArrayNonUniformIndexing = allBlobs.vk12.shaderStorageImageArrayNonUniformIndexing; - featureType.shaderInputAttachmentArrayNonUniformIndexing = allBlobs.vk12.shaderInputAttachmentArrayNonUniformIndexing; - featureType.shaderUniformTexelBufferArrayNonUniformIndexing = allBlobs.vk12.shaderUniformTexelBufferArrayNonUniformIndexing; - featureType.shaderStorageTexelBufferArrayNonUniformIndexing = allBlobs.vk12.shaderStorageTexelBufferArrayNonUniformIndexing; - featureType.descriptorBindingUniformBufferUpdateAfterBind = allBlobs.vk12.descriptorBindingUniformBufferUpdateAfterBind; - featureType.descriptorBindingSampledImageUpdateAfterBind = allBlobs.vk12.descriptorBindingSampledImageUpdateAfterBind; - featureType.descriptorBindingStorageImageUpdateAfterBind = allBlobs.vk12.descriptorBindingStorageImageUpdateAfterBind; - featureType.descriptorBindingStorageBufferUpdateAfterBind = allBlobs.vk12.descriptorBindingStorageBufferUpdateAfterBind; - featureType.descriptorBindingUniformTexelBufferUpdateAfterBind = allBlobs.vk12.descriptorBindingUniformTexelBufferUpdateAfterBind; - featureType.descriptorBindingStorageTexelBufferUpdateAfterBind = allBlobs.vk12.descriptorBindingStorageTexelBufferUpdateAfterBind; - featureType.descriptorBindingUpdateUnusedWhilePending = allBlobs.vk12.descriptorBindingUpdateUnusedWhilePending; - featureType.descriptorBindingPartiallyBound = allBlobs.vk12.descriptorBindingPartiallyBound; - featureType.descriptorBindingVariableDescriptorCount = allBlobs.vk12.descriptorBindingVariableDescriptorCount; - featureType.runtimeDescriptorArray = allBlobs.vk12.runtimeDescriptorArray; + featureType.shaderInputAttachmentArrayDynamicIndexing = allFeaturesBlobs.vk12.shaderInputAttachmentArrayDynamicIndexing; + featureType.shaderUniformTexelBufferArrayDynamicIndexing = allFeaturesBlobs.vk12.shaderUniformTexelBufferArrayDynamicIndexing; + featureType.shaderStorageTexelBufferArrayDynamicIndexing = allFeaturesBlobs.vk12.shaderStorageTexelBufferArrayDynamicIndexing; + featureType.shaderUniformBufferArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderUniformBufferArrayNonUniformIndexing; + featureType.shaderSampledImageArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderSampledImageArrayNonUniformIndexing; + featureType.shaderStorageBufferArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderStorageBufferArrayNonUniformIndexing; + featureType.shaderStorageImageArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderStorageImageArrayNonUniformIndexing; + featureType.shaderInputAttachmentArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderInputAttachmentArrayNonUniformIndexing; + featureType.shaderUniformTexelBufferArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderUniformTexelBufferArrayNonUniformIndexing; + featureType.shaderStorageTexelBufferArrayNonUniformIndexing = allFeaturesBlobs.vk12.shaderStorageTexelBufferArrayNonUniformIndexing; + featureType.descriptorBindingUniformBufferUpdateAfterBind = allFeaturesBlobs.vk12.descriptorBindingUniformBufferUpdateAfterBind; + featureType.descriptorBindingSampledImageUpdateAfterBind = allFeaturesBlobs.vk12.descriptorBindingSampledImageUpdateAfterBind; + featureType.descriptorBindingStorageImageUpdateAfterBind = allFeaturesBlobs.vk12.descriptorBindingStorageImageUpdateAfterBind; + featureType.descriptorBindingStorageBufferUpdateAfterBind = allFeaturesBlobs.vk12.descriptorBindingStorageBufferUpdateAfterBind; + featureType.descriptorBindingUniformTexelBufferUpdateAfterBind = allFeaturesBlobs.vk12.descriptorBindingUniformTexelBufferUpdateAfterBind; + featureType.descriptorBindingStorageTexelBufferUpdateAfterBind = allFeaturesBlobs.vk12.descriptorBindingStorageTexelBufferUpdateAfterBind; + featureType.descriptorBindingUpdateUnusedWhilePending = allFeaturesBlobs.vk12.descriptorBindingUpdateUnusedWhilePending; + featureType.descriptorBindingPartiallyBound = allFeaturesBlobs.vk12.descriptorBindingPartiallyBound; + featureType.descriptorBindingVariableDescriptorCount = allFeaturesBlobs.vk12.descriptorBindingVariableDescriptorCount; + featureType.runtimeDescriptorArray = allFeaturesBlobs.vk12.runtimeDescriptorArray; } -template<> void initFromBlob(VkPhysicalDeviceScalarBlockLayoutFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceScalarBlockLayoutFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.scalarBlockLayout = allBlobs.vk12.scalarBlockLayout; + featureType.scalarBlockLayout = allFeaturesBlobs.vk12.scalarBlockLayout; } -template<> void initFromBlob(VkPhysicalDeviceVulkanMemoryModelFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceVulkanMemoryModelFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.vulkanMemoryModel = allBlobs.vk12.vulkanMemoryModel; - featureType.vulkanMemoryModelDeviceScope = allBlobs.vk12.vulkanMemoryModelDeviceScope; - featureType.vulkanMemoryModelAvailabilityVisibilityChains = allBlobs.vk12.vulkanMemoryModelAvailabilityVisibilityChains; + featureType.vulkanMemoryModel = allFeaturesBlobs.vk12.vulkanMemoryModel; + featureType.vulkanMemoryModelDeviceScope = allFeaturesBlobs.vk12.vulkanMemoryModelDeviceScope; + featureType.vulkanMemoryModelAvailabilityVisibilityChains = allFeaturesBlobs.vk12.vulkanMemoryModelAvailabilityVisibilityChains; } -template<> void initFromBlob(VkPhysicalDeviceImagelessFramebufferFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceImagelessFramebufferFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.imagelessFramebuffer = allBlobs.vk12.imagelessFramebuffer; + featureType.imagelessFramebuffer = allFeaturesBlobs.vk12.imagelessFramebuffer; } -template<> void initFromBlob(VkPhysicalDeviceUniformBufferStandardLayoutFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceUniformBufferStandardLayoutFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.uniformBufferStandardLayout = allBlobs.vk12.uniformBufferStandardLayout; + featureType.uniformBufferStandardLayout = allFeaturesBlobs.vk12.uniformBufferStandardLayout; } -template<> void initFromBlob(VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.shaderSubgroupExtendedTypes = allBlobs.vk12.shaderSubgroupExtendedTypes; + featureType.shaderSubgroupExtendedTypes = allFeaturesBlobs.vk12.shaderSubgroupExtendedTypes; } -template<> void initFromBlob(VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.separateDepthStencilLayouts = allBlobs.vk12.separateDepthStencilLayouts; + featureType.separateDepthStencilLayouts = allFeaturesBlobs.vk12.separateDepthStencilLayouts; } -template<> void initFromBlob(VkPhysicalDeviceHostQueryResetFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceHostQueryResetFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.hostQueryReset = allBlobs.vk12.hostQueryReset; + featureType.hostQueryReset = allFeaturesBlobs.vk12.hostQueryReset; } -template<> void initFromBlob(VkPhysicalDeviceTimelineSemaphoreFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceTimelineSemaphoreFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.timelineSemaphore = allBlobs.vk12.timelineSemaphore; + featureType.timelineSemaphore = allFeaturesBlobs.vk12.timelineSemaphore; } -template<> void initFromBlob(VkPhysicalDeviceBufferDeviceAddressFeatures& featureType, const AllBlobs& allBlobs) +template<> void initFeatureFromBlob(VkPhysicalDeviceBufferDeviceAddressFeatures& featureType, const AllFeaturesBlobs& allFeaturesBlobs) { - featureType.bufferDeviceAddress = allBlobs.vk12.bufferDeviceAddress; - featureType.bufferDeviceAddressCaptureReplay = allBlobs.vk12.bufferDeviceAddressCaptureReplay; - featureType.bufferDeviceAddressMultiDevice = allBlobs.vk12.bufferDeviceAddressMultiDevice; + featureType.bufferDeviceAddress = allFeaturesBlobs.vk12.bufferDeviceAddress; + featureType.bufferDeviceAddressCaptureReplay = allFeaturesBlobs.vk12.bufferDeviceAddressCaptureReplay; + featureType.bufferDeviceAddressMultiDevice = allFeaturesBlobs.vk12.bufferDeviceAddressMultiDevice; } // generic template is not enough for some compilers -template<> void initFromBlob(VkPhysicalDevicePerformanceQueryFeaturesKHR&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShaderClockFeaturesKHR&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceTransformFeedbackFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceCornerSampledImageFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceASTCDecodeFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceConditionalRenderingFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceDepthClipEnableFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceInlineUniformBlockFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShaderSMBuiltinsFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShadingRateImageFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceComputeShaderDerivativesFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceMeshShaderFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShaderImageFootprintFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceExclusiveScissorFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceFragmentDensityMapFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceSubgroupSizeControlFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceCoherentMemoryFeaturesAMD&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceMemoryPriorityFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceBufferDeviceAddressFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceCooperativeMatrixFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceCoverageReductionModeFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceYcbcrImageArraysFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceLineRasterizationFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShaderAtomicFloatFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceIndexTypeUint8FeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceExtendedDynamicStateFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceRobustness2FeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceCustomBorderColorFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDevicePrivateDataFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceDiagnosticsConfigFeaturesNV&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceFragmentDensityMap2FeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceImageRobustnessFeaturesEXT&, const AllBlobs&) {} -template<> void initFromBlob(VkPhysicalDeviceRayTracingFeaturesKHR&, const AllBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDevicePerformanceQueryFeaturesKHR&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderClockFeaturesKHR&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceTransformFeedbackFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceCornerSampledImageFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceASTCDecodeFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceConditionalRenderingFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceDepthClipEnableFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceInlineUniformBlockFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderSMBuiltinsFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShadingRateImageFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceComputeShaderDerivativesFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceMeshShaderFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderImageFootprintFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceExclusiveScissorFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceFragmentDensityMapFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceSubgroupSizeControlFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceCoherentMemoryFeaturesAMD&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceMemoryPriorityFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceBufferDeviceAddressFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceCooperativeMatrixFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceCoverageReductionModeFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceYcbcrImageArraysFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceLineRasterizationFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderAtomicFloatFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceIndexTypeUint8FeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceExtendedDynamicStateFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceRobustness2FeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceCustomBorderColorFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDevicePrivateDataFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceDiagnosticsConfigFeaturesNV&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceFragmentDensityMap2FeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceImageRobustnessFeaturesEXT&, const AllFeaturesBlobs&) {} +template<> void initFeatureFromBlob(VkPhysicalDeviceRayTracingFeaturesKHR&, const AllFeaturesBlobs&) {} template<> FeatureDesc makeFeatureDesc(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, VK_KHR_16BIT_STORAGE_EXTENSION_NAME, VK_KHR_16BIT_STORAGE_SPEC_VERSION, 65}; } diff --git a/external/vulkancts/framework/vulkan/vkDeviceProperties.cpp b/external/vulkancts/framework/vulkan/vkDeviceProperties.cpp index a5a27df..903e072 100644 --- a/external/vulkancts/framework/vulkan/vkDeviceProperties.cpp +++ b/external/vulkancts/framework/vulkan/vkDeviceProperties.cpp @@ -32,81 +32,137 @@ DeviceProperties::DeviceProperties (const InstanceInterface& vki, const std::vector& instanceExtensions, const std::vector& deviceExtensions) { - m_coreProperties2 = initVulkanStructure(); + m_coreProperties2 = initVulkanStructure(); + m_vulkan11Properties = initVulkanStructure(); + m_vulkan12Properties = initVulkanStructure(); if (isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2")) { const std::vector deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL); void** nextPtr = &m_coreProperties2.pNext; + std::vector propertiesToFillFromBlob; + std::vector propertiesAddedWithVK; + bool vk11Supported = (apiVersion >= VK_MAKE_VERSION(1, 1, 0)); + bool vk12Supported = (apiVersion >= VK_MAKE_VERSION(1, 2, 0)); - for (size_t i = 0; i < DE_LENGTH_OF_ARRAY(propertyStructCreatorMap); ++i) + // there are 3 properies structures that were added with vk11 (without being first part of extension) + if (vk11Supported) { - const char* propertyName = propertyStructCreatorMap[i].name; + propertiesAddedWithVK = + { + createPropertyStructWrapper(), + createPropertyStructWrapper(), + createPropertyStructWrapper() + }; - if (deStringEqual(propertyName, "core_property") || de::contains(deviceExtensions.begin(), deviceExtensions.end(), propertyName)) + for (auto pAddedWithVK : propertiesAddedWithVK) { - PropertyStruct* p = propertyStructCreatorMap[i].creator(); + m_properties.push_back(pAddedWithVK); + + if (!vk12Supported) + addToChainStructWrapper(&nextPtr, pAddedWithVK); + } + } + + // in vk12 we have blob structures combining properties of couple previously + // available property structures, that now in vk12 must be removed from chain + if (vk12Supported) + { + addToChainVulkanStructure(&nextPtr, m_vulkan11Properties); + addToChainVulkanStructure(&nextPtr, m_vulkan12Properties); + } + + // iterate over data for all property that are defined in specification + for (const auto& propertyStructCreationData : propertyStructCreationArray) + { + const char* propertyName = propertyStructCreationData.name; - if (p) + // check if this property is available on current device + if (de::contains(deviceExtensions.begin(), deviceExtensions.end(), propertyName)) + { + PropertyStructWrapperBase* p = (*propertyStructCreationData.creatorFunction)(); + if (p == DE_NULL) + continue; + + // if property struct is part of VkPhysicalDeviceVulkan1{1,2}Properties + // we dont add it to the chain but store and fill later from blob data + bool propertyFilledFromBlob = false; + if (vk12Supported) + propertyFilledFromBlob = isPartOfBlobProperties(p->getPropertyDesc().sType); + + if (propertyFilledFromBlob) + propertiesToFillFromBlob.push_back(p); + else { - *nextPtr = p->getPropertyTypeRaw(); - nextPtr = p->getPropertyTypeNext(); - m_properties.push_back(p); + // add to chain + addToChainStructWrapper(&nextPtr, p); } + m_properties.push_back(p); } } vki.getPhysicalDeviceProperties2(physicalDevice, &m_coreProperties2); + + // fill data from VkPhysicalDeviceVulkan1{1,2}Properties + if (vk12Supported) + { + AllPropertiesBlobs allBlobs = + { + m_vulkan11Properties, + m_vulkan12Properties, + // add blobs from future vulkan versions here + }; + + // three properties that were added with vk11 in vk12 were merged to VkPhysicalDeviceVulkan11Properties + propertiesToFillFromBlob.insert(propertiesToFillFromBlob.end(), propertiesAddedWithVK.begin(), propertiesAddedWithVK.end()); + + for (auto property : propertiesToFillFromBlob) + property->initializePropertyFromBlob(allBlobs); + } } else m_coreProperties2.properties = getPhysicalDeviceProperties(vki, physicalDevice); } -bool DeviceProperties::contains (const std::string& property, bool throwIfNotExists) const +void DeviceProperties::addToChainStructWrapper(void*** chainPNextPtr, PropertyStructWrapperBase* structWrapper) { - const size_t typesSize = m_properties.size(); + DE_ASSERT(chainPNextPtr != DE_NULL); + + (**chainPNextPtr) = structWrapper->getPropertyTypeRaw(); + (*chainPNextPtr) = structWrapper->getPropertyTypeNext(); +} - for (size_t typeIdx = 0; typeIdx < typesSize; ++typeIdx) +bool DeviceProperties::contains (const std::string& property, bool throwIfNotExists) const +{ + for (const auto f : m_properties) { - if (deStringEqual(m_properties[typeIdx]->getPropertyDesc().name, property.c_str())) - { + if (deStringEqual(f->getPropertyDesc().name, property.c_str())) return true; - } } if (throwIfNotExists) - { - std::string msg("Property " + property + " is not supported"); - - TCU_THROW(NotSupportedError, msg); - } + TCU_THROW(NotSupportedError, "Property " + property + " is not supported"); return false; } bool DeviceProperties::isDevicePropertyInitialized (VkStructureType sType) const { - return findStructureInChain(&m_coreProperties2, sType) != DE_NULL; + for (const auto f : m_properties) + { + if (f->getPropertyDesc().sType == sType) + return true; + } + return false; } DeviceProperties::~DeviceProperties (void) { - for (size_t i = 0; i < m_properties.size(); ++i) - delete m_properties[i]; + for (auto p : m_properties) + delete p; m_properties.clear(); } -PropertyStruct* DeviceProperties::createPropertyStructWrapper (const std::string& s) -{ - for (size_t i = 0; i < DE_LENGTH_OF_ARRAY(propertyStructCreatorMap); ++i) - { - if (deStringEqual(propertyStructCreatorMap[i].name, s.c_str())) - return (*propertyStructCreatorMap[i].creator)(); - } - - return DE_NULL; -} - } // vk diff --git a/external/vulkancts/framework/vulkan/vkDeviceProperties.hpp b/external/vulkancts/framework/vulkan/vkDeviceProperties.hpp index 8254587..0f8ed13 100644 --- a/external/vulkancts/framework/vulkan/vkDeviceProperties.hpp +++ b/external/vulkancts/framework/vulkan/vkDeviceProperties.hpp @@ -34,145 +34,151 @@ namespace vk { +// Structure describing vulkan property structure struct PropertyDesc { - PropertyDesc (VkStructureType sType_, const char* name_, deUint32 specVersion_, deUint32 typeId_) - : name (name_) - , sType (sType_) - , specVersion (specVersion_) - , typeId (typeId_) - {} - - const char* name; VkStructureType sType; + const char* name; const deUint32 specVersion; const deUint32 typeId; }; -struct PropertyStruct +// Structure containg all property blobs - this simplifies generated code +struct AllPropertiesBlobs { - virtual deUint32 getPropertyTypeId (void) const = 0; - virtual PropertyDesc getPropertyDesc (void) const = 0; - virtual void** getPropertyTypeNext (void) = 0; - virtual void* getPropertyTypeRaw (void) = 0; - virtual ~PropertyStruct (void) {} + VkPhysicalDeviceVulkan11Properties& vk11; + VkPhysicalDeviceVulkan12Properties& vk12; + // add blobs from future vulkan versions here }; +// Base class for all PropertyStructWrapper specialization +struct PropertyStructWrapperBase +{ + virtual ~PropertyStructWrapperBase (void) {} + virtual void initializePropertyFromBlob (const AllPropertiesBlobs& allPropertiesBlobs) = 0; + virtual deUint32 getPropertyTypeId (void) const = 0; + virtual PropertyDesc getPropertyDesc (void) const = 0; + virtual void** getPropertyTypeNext (void) = 0; + virtual void* getPropertyTypeRaw (void) = 0; +}; -struct PropertyStructMapItem +using PropertyStructWrapperCreator = PropertyStructWrapperBase* (*) (void); +struct PropertyStructCreationData { - PropertyStruct* (*creator)(void); - const char* name; - deUint32 specVersion; + PropertyStructWrapperCreator creatorFunction; + const char* name; + deUint32 specVersion; }; -template struct PropertyStructWrapper; +template class PropertyStructWrapper; template PropertyDesc makePropertyDesc (void); template -PropertyStruct* createPropertyStructWrapper (void) +PropertyStructWrapperBase* createPropertyStructWrapper (void) { return new PropertyStructWrapper(makePropertyDesc()); } +template +void initPropertyFromBlob(PropertyType& propertyType, const AllPropertiesBlobs& allPropertiesBlobs); + +template +void initPropertyFromBlobWrapper(PropertyType& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + initPropertyFromBlob(propertyType, allPropertiesBlobs); +} + class DeviceProperties { public: - DeviceProperties (const InstanceInterface& vki, - const deUint32 apiVersion, - const VkPhysicalDevice physicalDevice, - const std::vector& instanceExtensions, - const std::vector& deviceExtensions); + DeviceProperties (const InstanceInterface& vki, + const deUint32 apiVersion, + const VkPhysicalDevice physicalDevice, + const std::vector& instanceExtensions, + const std::vector& deviceExtensions); - ~DeviceProperties (void); + ~DeviceProperties (void); template - bool getPropertyType (PropertyType& propertyType) const - { - typedef PropertyStructWrapper *PropertyWrapperPtr; - - const VkStructureType sType = makePropertyDesc().sType; - const size_t propCount = m_properties.size(); - - for (size_t propIdx = 0; propIdx < propCount; ++propIdx) - { - if (sType == m_properties[propIdx]->getPropertyDesc().sType) - { - propertyType = static_cast(m_properties[propIdx])->getPropertyTypeRef(); - return true; - } - } - return false; - } + const PropertyType& getPropertyType (void) const; - template - const PropertyType& getPropertyType (void) const - { - typedef PropertyStructWrapper *PropertyWrapperPtr; + const VkPhysicalDeviceProperties2& getCoreProperties2 (void) const { return m_coreProperties2; } + const VkPhysicalDeviceVulkan11Properties& getVulkan11Properties (void) const { return m_vulkan11Properties; } + const VkPhysicalDeviceVulkan12Properties& getVulkan12Properties (void) const { return m_vulkan12Properties; } - const PropertyDesc propDesc = makePropertyDesc(); - const VkStructureType sType = propDesc.sType; - const size_t propCount = m_properties.size(); + bool contains (const std::string& property, bool throwIfNotExists = false) const; - for (size_t propIdx = 0; propIdx < propCount; ++propIdx) - { - if (sType == m_properties[propIdx]->getPropertyDesc().sType) - return static_cast(m_properties[propIdx])->getPropertyTypeRef(); - } + bool isDevicePropertyInitialized (VkStructureType sType) const; - const deUint32 propertyId = propDesc.typeId; +private: - for (size_t propIdx = 0; propIdx < propCount; ++propIdx) - { - if (propertyId == m_properties[propIdx]->getPropertyTypeId()) - return static_cast(m_properties[propIdx])->getPropertyTypeRef(); - } + static void addToChainStructWrapper(void*** chainPNextPtr, PropertyStructWrapperBase* structWrapper); - PropertyStruct* p = vk::createPropertyStructWrapper(); - m_properties.push_back(p); +private: - return static_cast(p)->getPropertyTypeRef(); - } + VkPhysicalDeviceProperties2 m_coreProperties2; + mutable std::vector m_properties; + VkPhysicalDeviceVulkan11Properties m_vulkan11Properties; + VkPhysicalDeviceVulkan12Properties m_vulkan12Properties; +}; - const VkPhysicalDeviceProperties2& getCoreProperties2 (void) const { return m_coreProperties2; } +template +const PropertyType& DeviceProperties::getPropertyType(void) const +{ + typedef PropertyStructWrapper* PropertyWrapperPtr; - bool contains (const std::string& property, bool throwIfNotExists = false) const; + const PropertyDesc propDesc = makePropertyDesc(); + const VkStructureType sType = propDesc.sType; - bool isDevicePropertyInitialized (VkStructureType sType) const; + // try to find property by sType + for (auto property : m_properties) + { + if (sType == property->getPropertyDesc().sType) + return static_cast(property)->getPropertyTypeRef(); + } -private: - static PropertyStruct* createPropertyStructWrapper (const std::string& s); + // try to find property by id that was assigned by gen_framework script + const deUint32 propertyId = propDesc.typeId; + for (auto property : m_properties) + { + if (propertyId == property->getPropertyTypeId()) + return static_cast(property)->getPropertyTypeRef(); + } - VkPhysicalDeviceProperties2 m_coreProperties2; - mutable std::vector m_properties; -}; + // if initialized property structure was not found create empty one and return it + m_properties.push_back(vk::createPropertyStructWrapper()); + return static_cast(m_properties.back())->getPropertyTypeRef(); +} template -struct PropertyStructWrapper : PropertyStruct +class PropertyStructWrapper : public PropertyStructWrapperBase { +public: + PropertyStructWrapper (const PropertyDesc& propertyDesc) + : m_propertyDesc(propertyDesc) + { + deMemset(&m_propertyType, 0, sizeof(m_propertyType)); + m_propertyType.sType = propertyDesc.sType; + } + + void initializePropertyFromBlob (const AllPropertiesBlobs& allPropertiesBlobs) + { + initPropertyFromBlobWrapper(m_propertyType, allPropertiesBlobs); + } + + deUint32 getPropertyTypeId (void) const { return m_propertyDesc.typeId; } + PropertyDesc getPropertyDesc (void) const { return m_propertyDesc; } + void** getPropertyTypeNext (void) { return &m_propertyType.pNext; } + void* getPropertyTypeRaw (void) { return &m_propertyType; } + PropertyType& getPropertyTypeRef (void) { return m_propertyType; } + +public: + // metadata about property structure const PropertyDesc m_propertyDesc; - PropertyType m_propertyType; - - PropertyStructWrapper (void) - : m_propertyDesc (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, DE_NULL, ~0u, 0u) - { - deMemset(&m_propertyType, 0, sizeof(m_propertyType)); - } - - PropertyStructWrapper (const PropertyDesc& propertyDesc) - : m_propertyDesc (propertyDesc) - { - deMemset(&m_propertyType, 0, sizeof(m_propertyType)); - m_propertyType.sType = propertyDesc.sType; - } - - deUint32 getPropertyTypeId (void) const { return m_propertyDesc.typeId; } - PropertyDesc getPropertyDesc (void) const { return m_propertyDesc; } - void** getPropertyTypeNext (void) { return &m_propertyType.pNext; } - void* getPropertyTypeRaw (void) { return &m_propertyType; } - PropertyType& getPropertyTypeRef (void) { return m_propertyType; } -}; + // actual vulkan property structure + PropertyType m_propertyType; +}; } // vk #endif // _VKDEVICEPROPERTIES_HPP diff --git a/external/vulkancts/framework/vulkan/vkDeviceProperties.inl b/external/vulkancts/framework/vulkan/vkDeviceProperties.inl index c638287..8cf68d3 100644 --- a/external/vulkancts/framework/vulkan/vkDeviceProperties.inl +++ b/external/vulkancts/framework/vulkan/vkDeviceProperties.inl @@ -18,6 +18,7 @@ namespace vk #define VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME "VK_KHR_shader_float_controls" #define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map" #define VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME "VK_EXT_fragment_density_map2" +#define DECL_ID_EXTENSION_NAME "core_property" #define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block" #define VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME "VK_EXT_line_rasterization" #define VK_KHR_MAINTENANCE3_EXTENSION_NAME "VK_KHR_maintenance3" @@ -44,46 +45,188 @@ namespace vk #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT, VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION, 37); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT, VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION, 36); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV, VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME, VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION, 35); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION, 34); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION, 33); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION, 32); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV, VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION, 31); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION, 30); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION, 29); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION, 28); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION, 27); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION, 26); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT, VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION, 25); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT, VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION, 24); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, VK_EXT_LINE_RASTERIZATION_SPEC_VERSION, 23); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, VK_KHR_MAINTENANCE3_EXTENSION_NAME, VK_KHR_MAINTENANCE3_SPEC_VERSION, 22); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV, VK_NV_MESH_SHADER_EXTENSION_NAME, VK_NV_MESH_SHADER_SPEC_VERSION, 21); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, VK_KHR_MULTIVIEW_EXTENSION_NAME, VK_KHR_MULTIVIEW_SPEC_VERSION, 20); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX, VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME, VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION, 19); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR, VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME, VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION, 18); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, VK_KHR_MAINTENANCE2_EXTENSION_NAME, VK_KHR_MAINTENANCE2_SPEC_VERSION, 17); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES, DECL_PROTECTED_MEMORY_EXTENSION_NAME, 0, 16); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION, 15); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_KHR, VK_KHR_RAY_TRACING_EXTENSION_NAME, VK_KHR_RAY_TRACING_SPEC_VERSION, 14); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV, VK_NV_RAY_TRACING_EXTENSION_NAME, VK_NV_RAY_TRACING_SPEC_VERSION, 13); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT, VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, VK_EXT_ROBUSTNESS_2_SPEC_VERSION, 12); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES, VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION, 11); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT, VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION, 10); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD, VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME, VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION, 9); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD, VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME, VK_AMD_SHADER_CORE_PROPERTIES_2_SPEC_VERSION, 8); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV, VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME, VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION, 7); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES, DECL_SUBGROUP_EXTENSION_NAME, 0, 6); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION, 5); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT, VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME, VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION, 4); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION, 3); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION, 2); } -template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION, 1); } +template<> void initPropertyFromBlob(VkPhysicalDeviceSubgroupProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.subgroupSize = allPropertiesBlobs.vk11.subgroupSize; + propertyType.supportedStages = allPropertiesBlobs.vk11.subgroupSupportedStages; + propertyType.supportedOperations = allPropertiesBlobs.vk11.subgroupSupportedOperations; + propertyType.quadOperationsInAllStages = allPropertiesBlobs.vk11.subgroupQuadOperationsInAllStages; +} +template<> void initPropertyFromBlob(VkPhysicalDevicePointClippingProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.pointClippingBehavior = allPropertiesBlobs.vk11.pointClippingBehavior; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceMultiviewProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.maxMultiviewViewCount = allPropertiesBlobs.vk11.maxMultiviewViewCount; + propertyType.maxMultiviewInstanceIndex = allPropertiesBlobs.vk11.maxMultiviewInstanceIndex; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceProtectedMemoryProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.protectedNoFault = allPropertiesBlobs.vk11.protectedNoFault; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceIDProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + memcpy(propertyType.deviceUUID, allPropertiesBlobs.vk11.deviceUUID, sizeof(deUint8) * VK_UUID_SIZE); + memcpy(propertyType.driverUUID, allPropertiesBlobs.vk11.driverUUID, sizeof(deUint8) * VK_UUID_SIZE); + memcpy(propertyType.deviceLUID, allPropertiesBlobs.vk11.deviceLUID, sizeof(deUint8) * VK_LUID_SIZE); + propertyType.deviceNodeMask = allPropertiesBlobs.vk11.deviceNodeMask; + propertyType.deviceLUIDValid = allPropertiesBlobs.vk11.deviceLUIDValid; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceMaintenance3Properties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.maxPerSetDescriptors = allPropertiesBlobs.vk11.maxPerSetDescriptors; + propertyType.maxMemoryAllocationSize = allPropertiesBlobs.vk11.maxMemoryAllocationSize; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceDriverProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.driverID = allPropertiesBlobs.vk12.driverID; + memcpy(propertyType.driverName, allPropertiesBlobs.vk12.driverName, sizeof(char) * VK_MAX_DRIVER_NAME_SIZE); + memcpy(propertyType.driverInfo, allPropertiesBlobs.vk12.driverInfo, sizeof(char) * VK_MAX_DRIVER_INFO_SIZE); + propertyType.conformanceVersion = allPropertiesBlobs.vk12.conformanceVersion; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceFloatControlsProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.denormBehaviorIndependence = allPropertiesBlobs.vk12.denormBehaviorIndependence; + propertyType.roundingModeIndependence = allPropertiesBlobs.vk12.roundingModeIndependence; + propertyType.shaderSignedZeroInfNanPreserveFloat16 = allPropertiesBlobs.vk12.shaderSignedZeroInfNanPreserveFloat16; + propertyType.shaderSignedZeroInfNanPreserveFloat32 = allPropertiesBlobs.vk12.shaderSignedZeroInfNanPreserveFloat32; + propertyType.shaderSignedZeroInfNanPreserveFloat64 = allPropertiesBlobs.vk12.shaderSignedZeroInfNanPreserveFloat64; + propertyType.shaderDenormPreserveFloat16 = allPropertiesBlobs.vk12.shaderDenormPreserveFloat16; + propertyType.shaderDenormPreserveFloat32 = allPropertiesBlobs.vk12.shaderDenormPreserveFloat32; + propertyType.shaderDenormPreserveFloat64 = allPropertiesBlobs.vk12.shaderDenormPreserveFloat64; + propertyType.shaderDenormFlushToZeroFloat16 = allPropertiesBlobs.vk12.shaderDenormFlushToZeroFloat16; + propertyType.shaderDenormFlushToZeroFloat32 = allPropertiesBlobs.vk12.shaderDenormFlushToZeroFloat32; + propertyType.shaderDenormFlushToZeroFloat64 = allPropertiesBlobs.vk12.shaderDenormFlushToZeroFloat64; + propertyType.shaderRoundingModeRTEFloat16 = allPropertiesBlobs.vk12.shaderRoundingModeRTEFloat16; + propertyType.shaderRoundingModeRTEFloat32 = allPropertiesBlobs.vk12.shaderRoundingModeRTEFloat32; + propertyType.shaderRoundingModeRTEFloat64 = allPropertiesBlobs.vk12.shaderRoundingModeRTEFloat64; + propertyType.shaderRoundingModeRTZFloat16 = allPropertiesBlobs.vk12.shaderRoundingModeRTZFloat16; + propertyType.shaderRoundingModeRTZFloat32 = allPropertiesBlobs.vk12.shaderRoundingModeRTZFloat32; + propertyType.shaderRoundingModeRTZFloat64 = allPropertiesBlobs.vk12.shaderRoundingModeRTZFloat64; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceDescriptorIndexingProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.maxUpdateAfterBindDescriptorsInAllPools = allPropertiesBlobs.vk12.maxUpdateAfterBindDescriptorsInAllPools; + propertyType.shaderUniformBufferArrayNonUniformIndexingNative = allPropertiesBlobs.vk12.shaderUniformBufferArrayNonUniformIndexingNative; + propertyType.shaderSampledImageArrayNonUniformIndexingNative = allPropertiesBlobs.vk12.shaderSampledImageArrayNonUniformIndexingNative; + propertyType.shaderStorageBufferArrayNonUniformIndexingNative = allPropertiesBlobs.vk12.shaderStorageBufferArrayNonUniformIndexingNative; + propertyType.shaderStorageImageArrayNonUniformIndexingNative = allPropertiesBlobs.vk12.shaderStorageImageArrayNonUniformIndexingNative; + propertyType.shaderInputAttachmentArrayNonUniformIndexingNative = allPropertiesBlobs.vk12.shaderInputAttachmentArrayNonUniformIndexingNative; + propertyType.robustBufferAccessUpdateAfterBind = allPropertiesBlobs.vk12.robustBufferAccessUpdateAfterBind; + propertyType.quadDivergentImplicitLod = allPropertiesBlobs.vk12.quadDivergentImplicitLod; + propertyType.maxPerStageDescriptorUpdateAfterBindSamplers = allPropertiesBlobs.vk12.maxPerStageDescriptorUpdateAfterBindSamplers; + propertyType.maxPerStageDescriptorUpdateAfterBindUniformBuffers = allPropertiesBlobs.vk12.maxPerStageDescriptorUpdateAfterBindUniformBuffers; + propertyType.maxPerStageDescriptorUpdateAfterBindStorageBuffers = allPropertiesBlobs.vk12.maxPerStageDescriptorUpdateAfterBindStorageBuffers; + propertyType.maxPerStageDescriptorUpdateAfterBindSampledImages = allPropertiesBlobs.vk12.maxPerStageDescriptorUpdateAfterBindSampledImages; + propertyType.maxPerStageDescriptorUpdateAfterBindStorageImages = allPropertiesBlobs.vk12.maxPerStageDescriptorUpdateAfterBindStorageImages; + propertyType.maxPerStageDescriptorUpdateAfterBindInputAttachments = allPropertiesBlobs.vk12.maxPerStageDescriptorUpdateAfterBindInputAttachments; + propertyType.maxPerStageUpdateAfterBindResources = allPropertiesBlobs.vk12.maxPerStageUpdateAfterBindResources; + propertyType.maxDescriptorSetUpdateAfterBindSamplers = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindSamplers; + propertyType.maxDescriptorSetUpdateAfterBindUniformBuffers = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindUniformBuffers; + propertyType.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic; + propertyType.maxDescriptorSetUpdateAfterBindStorageBuffers = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindStorageBuffers; + propertyType.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic; + propertyType.maxDescriptorSetUpdateAfterBindSampledImages = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindSampledImages; + propertyType.maxDescriptorSetUpdateAfterBindStorageImages = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindStorageImages; + propertyType.maxDescriptorSetUpdateAfterBindInputAttachments = allPropertiesBlobs.vk12.maxDescriptorSetUpdateAfterBindInputAttachments; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceDepthStencilResolveProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.supportedDepthResolveModes = allPropertiesBlobs.vk12.supportedDepthResolveModes; + propertyType.supportedStencilResolveModes = allPropertiesBlobs.vk12.supportedStencilResolveModes; + propertyType.independentResolveNone = allPropertiesBlobs.vk12.independentResolveNone; + propertyType.independentResolve = allPropertiesBlobs.vk12.independentResolve; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceSamplerFilterMinmaxProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.filterMinmaxSingleComponentFormats = allPropertiesBlobs.vk12.filterMinmaxSingleComponentFormats; + propertyType.filterMinmaxImageComponentMapping = allPropertiesBlobs.vk12.filterMinmaxImageComponentMapping; +} +template<> void initPropertyFromBlob(VkPhysicalDeviceTimelineSemaphoreProperties& propertyType, const AllPropertiesBlobs& allPropertiesBlobs) +{ + propertyType.maxTimelineSemaphoreValueDifference = allPropertiesBlobs.vk12.maxTimelineSemaphoreValueDifference; +} + +// generic template is not enough for some compilers +template<> void initPropertyFromBlob(VkPhysicalDeviceMemoryProperties&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceSparseProperties&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceGroupProperties&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceMemoryProperties2&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDevicePushDescriptorPropertiesKHR&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDevicePerformanceQueryPropertiesKHR&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceTransformFeedbackPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceDiscardRectanglePropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceConservativeRasterizationPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceInlineUniformBlockPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceSampleLocationsPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceShaderSMBuiltinsPropertiesNV&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceShadingRateImagePropertiesNV&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceRayTracingPropertiesNV&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceExternalMemoryHostPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceShaderCorePropertiesAMD&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceMeshShaderPropertiesNV&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDevicePCIBusInfoPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceFragmentDensityMapPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceSubgroupSizeControlPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceShaderCoreProperties2AMD&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceMemoryBudgetPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceToolPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceCooperativeMatrixPropertiesNV&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceLineRasterizationPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceRobustness2PropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceCustomBorderColorPropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceFragmentDensityMap2PropertiesEXT&, const AllPropertiesBlobs&) {} +template<> void initPropertyFromBlob(VkPhysicalDeviceRayTracingPropertiesKHR&, const AllPropertiesBlobs&) {} + +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT, VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION, 38}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT, VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION, 37}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV, VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME, VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION, 36}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION, 35}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION, 34}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION, 33}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV, VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION, 32}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION, 31}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION, 30}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION, 29}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION, 28}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION, 27}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT, VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION, 26}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, DECL_ID_EXTENSION_NAME, 0, 25}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT, VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION, 24}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, VK_EXT_LINE_RASTERIZATION_SPEC_VERSION, 23}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, VK_KHR_MAINTENANCE3_EXTENSION_NAME, VK_KHR_MAINTENANCE3_SPEC_VERSION, 22}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV, VK_NV_MESH_SHADER_EXTENSION_NAME, VK_NV_MESH_SHADER_SPEC_VERSION, 21}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, VK_KHR_MULTIVIEW_EXTENSION_NAME, VK_KHR_MULTIVIEW_SPEC_VERSION, 20}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX, VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME, VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION, 19}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR, VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME, VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION, 18}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, VK_KHR_MAINTENANCE2_EXTENSION_NAME, VK_KHR_MAINTENANCE2_SPEC_VERSION, 17}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES, DECL_PROTECTED_MEMORY_EXTENSION_NAME, 0, 16}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION, 15}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_KHR, VK_KHR_RAY_TRACING_EXTENSION_NAME, VK_KHR_RAY_TRACING_SPEC_VERSION, 14}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV, VK_NV_RAY_TRACING_EXTENSION_NAME, VK_NV_RAY_TRACING_SPEC_VERSION, 13}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT, VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, VK_EXT_ROBUSTNESS_2_SPEC_VERSION, 12}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES, VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION, 11}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT, VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION, 10}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD, VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME, VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION, 9}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD, VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME, VK_AMD_SHADER_CORE_PROPERTIES_2_SPEC_VERSION, 8}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV, VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME, VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION, 7}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES, DECL_SUBGROUP_EXTENSION_NAME, 0, 6}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION, 5}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT, VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME, VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION, 4}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION, 3}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION, 2}; } +template<> PropertyDesc makePropertyDesc(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION, 1}; } -static const PropertyStructMapItem propertyStructCreatorMap[] = + +static const PropertyStructCreationData propertyStructCreationArray[] = { { createPropertyStructWrapper, VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION }, { createPropertyStructWrapper, VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION }, @@ -98,6 +241,7 @@ static const PropertyStructMapItem propertyStructCreatorMap[] = { createPropertyStructWrapper, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION }, { createPropertyStructWrapper, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION }, { createPropertyStructWrapper, VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION }, + { createPropertyStructWrapper, DECL_ID_EXTENSION_NAME, 0 }, { createPropertyStructWrapper, VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION }, { createPropertyStructWrapper, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, VK_EXT_LINE_RASTERIZATION_SPEC_VERSION }, { createPropertyStructWrapper, VK_KHR_MAINTENANCE3_EXTENSION_NAME, VK_KHR_MAINTENANCE3_SPEC_VERSION }, @@ -123,5 +267,27 @@ static const PropertyStructMapItem propertyStructCreatorMap[] = { createPropertyStructWrapper, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION }, { createPropertyStructWrapper, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION }, }; + +bool isPartOfBlobProperties (VkStructureType sType) +{ + const std::vector sTypeVect = { + // Vulkan11 + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES, + // Vulkan12 + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, + }; + return de::contains(sTypeVect.begin(), sTypeVect.end(), sType); +} + } // vk diff --git a/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDecl.inl b/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDecl.inl index 47bdc26..aed829e 100644 --- a/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDecl.inl +++ b/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDecl.inl @@ -14,6 +14,7 @@ const vk::VkPhysicalDeviceExternalMemoryHostPropertiesEXT& getExternalMemoryHo const vk::VkPhysicalDeviceFloatControlsProperties& getFloatControlsProperties (void) const; const vk::VkPhysicalDeviceFragmentDensityMapPropertiesEXT& getFragmentDensityMapPropertiesEXT (void) const; const vk::VkPhysicalDeviceFragmentDensityMap2PropertiesEXT& getFragmentDensityMap2PropertiesEXT (void) const; +const vk::VkPhysicalDeviceIDProperties& getIDProperties (void) const; const vk::VkPhysicalDeviceInlineUniformBlockPropertiesEXT& getInlineUniformBlockPropertiesEXT (void) const; const vk::VkPhysicalDeviceLineRasterizationPropertiesEXT& getLineRasterizationPropertiesEXT (void) const; const vk::VkPhysicalDeviceMaintenance3Properties& getMaintenance3Properties (void) const; diff --git a/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDefs.inl b/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDefs.inl index 2fdf2f8..a5fbd6a 100644 --- a/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDefs.inl +++ b/external/vulkancts/framework/vulkan/vkDevicePropertiesForContextDefs.inl @@ -14,6 +14,7 @@ const vk::VkPhysicalDeviceExternalMemoryHostPropertiesEXT& Context::getExterna const vk::VkPhysicalDeviceFloatControlsProperties& Context::getFloatControlsProperties (void) const { return m_device->getFloatControlsProperties(); } const vk::VkPhysicalDeviceFragmentDensityMapPropertiesEXT& Context::getFragmentDensityMapPropertiesEXT (void) const { return m_device->getFragmentDensityMapPropertiesEXT(); } const vk::VkPhysicalDeviceFragmentDensityMap2PropertiesEXT& Context::getFragmentDensityMap2PropertiesEXT (void) const { return m_device->getFragmentDensityMap2PropertiesEXT(); } +const vk::VkPhysicalDeviceIDProperties& Context::getIDProperties (void) const { return m_device->getIDProperties(); } const vk::VkPhysicalDeviceInlineUniformBlockPropertiesEXT& Context::getInlineUniformBlockPropertiesEXT (void) const { return m_device->getInlineUniformBlockPropertiesEXT(); } const vk::VkPhysicalDeviceLineRasterizationPropertiesEXT& Context::getLineRasterizationPropertiesEXT (void) const { return m_device->getLineRasterizationPropertiesEXT(); } const vk::VkPhysicalDeviceMaintenance3Properties& Context::getMaintenance3Properties (void) const { return m_device->getMaintenance3Properties(); } diff --git a/external/vulkancts/framework/vulkan/vkDevicePropertiesForDefaultDeviceDefs.inl b/external/vulkancts/framework/vulkan/vkDevicePropertiesForDefaultDeviceDefs.inl index 85d932f..8877cb4 100644 --- a/external/vulkancts/framework/vulkan/vkDevicePropertiesForDefaultDeviceDefs.inl +++ b/external/vulkancts/framework/vulkan/vkDevicePropertiesForDefaultDeviceDefs.inl @@ -1,40 +1,41 @@ /* WARNING: This is auto-generated file. Do not modify, since changes will * be lost! Modify the generating script instead. */ -const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT& getBlendOperationAdvancedPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceConservativeRasterizationPropertiesEXT& getConservativeRasterizationPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceCooperativeMatrixPropertiesNV& getCooperativeMatrixProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceCustomBorderColorPropertiesEXT& getCustomBorderColorPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceDepthStencilResolveProperties& getDepthStencilResolveProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceDescriptorIndexingProperties& getDescriptorIndexingProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV& getDeviceGeneratedCommandsProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceDiscardRectanglePropertiesEXT& getDiscardRectanglePropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceDriverProperties& getDriverProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& getExternalMemoryHostPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceFloatControlsProperties& getFloatControlsProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceFragmentDensityMapPropertiesEXT& getFragmentDensityMapPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT& getFragmentDensityMap2PropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceInlineUniformBlockPropertiesEXT& getInlineUniformBlockPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceLineRasterizationPropertiesEXT& getLineRasterizationPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceMaintenance3Properties& getMaintenance3Properties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceMeshShaderPropertiesNV& getMeshShaderProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceMultiviewProperties& getMultiviewProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX& getMultiviewPerViewAttributesPropertiesX (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDevicePerformanceQueryPropertiesKHR& getPerformanceQueryProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDevicePointClippingProperties& getPointClippingProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceProtectedMemoryProperties& getProtectedMemoryProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDevicePushDescriptorPropertiesKHR& getPushDescriptorProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceRayTracingPropertiesKHR& getRayTracingProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceRayTracingPropertiesNV& getRayTracingPropertiesNV (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceRobustness2PropertiesEXT& getRobustness2PropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceSamplerFilterMinmaxProperties& getSamplerFilterMinmaxProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceSampleLocationsPropertiesEXT& getSampleLocationsPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceShaderCorePropertiesAMD& getShaderCorePropertiesAMD (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceShaderCoreProperties2AMD& getShaderCoreProperties2AMD (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceShadingRateImagePropertiesNV& getShadingRateImageProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceSubgroupProperties& getSubgroupProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT& getSubgroupSizeControlPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT& getTexelBufferAlignmentPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceTimelineSemaphoreProperties& getTimelineSemaphoreProperties (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceTransformFeedbackPropertiesEXT& getTransformFeedbackPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } -const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& getVertexAttributeDivisorPropertiesEXT (void) const { return m_devicePropertiesFull.getPropertyType(); } +const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT& getBlendOperationAdvancedPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceConservativeRasterizationPropertiesEXT& getConservativeRasterizationPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceCooperativeMatrixPropertiesNV& getCooperativeMatrixProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceCustomBorderColorPropertiesEXT& getCustomBorderColorPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceDepthStencilResolveProperties& getDepthStencilResolveProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceDescriptorIndexingProperties& getDescriptorIndexingProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV& getDeviceGeneratedCommandsProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceDiscardRectanglePropertiesEXT& getDiscardRectanglePropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceDriverProperties& getDriverProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceExternalMemoryHostPropertiesEXT& getExternalMemoryHostPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceFloatControlsProperties& getFloatControlsProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceFragmentDensityMapPropertiesEXT& getFragmentDensityMapPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceFragmentDensityMap2PropertiesEXT& getFragmentDensityMap2PropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceIDProperties& getIDProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceInlineUniformBlockPropertiesEXT& getInlineUniformBlockPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceLineRasterizationPropertiesEXT& getLineRasterizationPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceMaintenance3Properties& getMaintenance3Properties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceMeshShaderPropertiesNV& getMeshShaderProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceMultiviewProperties& getMultiviewProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX& getMultiviewPerViewAttributesPropertiesX (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDevicePerformanceQueryPropertiesKHR& getPerformanceQueryProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDevicePointClippingProperties& getPointClippingProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceProtectedMemoryProperties& getProtectedMemoryProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDevicePushDescriptorPropertiesKHR& getPushDescriptorProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceRayTracingPropertiesKHR& getRayTracingProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceRayTracingPropertiesNV& getRayTracingPropertiesNV (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceRobustness2PropertiesEXT& getRobustness2PropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceSamplerFilterMinmaxProperties& getSamplerFilterMinmaxProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceSampleLocationsPropertiesEXT& getSampleLocationsPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceShaderCorePropertiesAMD& getShaderCorePropertiesAMD (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceShaderCoreProperties2AMD& getShaderCoreProperties2AMD (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceShadingRateImagePropertiesNV& getShadingRateImageProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceSubgroupProperties& getSubgroupProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT& getSubgroupSizeControlPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT& getTexelBufferAlignmentPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceTimelineSemaphoreProperties& getTimelineSemaphoreProperties (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceTransformFeedbackPropertiesEXT& getTransformFeedbackPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } +const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT& getVertexAttributeDivisorPropertiesEXT (void) const { return m_deviceProperties.getPropertyType(); } diff --git a/external/vulkancts/modules/vulkan/vktTestCase.cpp b/external/vulkancts/modules/vulkan/vktTestCase.cpp index c481d96..52c7c97 100644 --- a/external/vulkancts/modules/vulkan/vktTestCase.cpp +++ b/external/vulkancts/modules/vulkan/vktTestCase.cpp @@ -290,27 +290,29 @@ public: DefaultDevice (const PlatformInterface& vkPlatform, const tcu::CommandLine& cmdLine); ~DefaultDevice (void); - VkInstance getInstance (void) const { return *m_instance; } - const InstanceInterface& getInstanceInterface (void) const { return m_instanceInterface; } - deUint32 getMaximumFrameworkVulkanVersion (void) const { return m_maximumFrameworkVulkanVersion; } - deUint32 getAvailableInstanceVersion (void) const { return m_availableInstanceVersion; } - deUint32 getUsedInstanceVersion (void) const { return m_usedInstanceVersion; } - const vector& getInstanceExtensions (void) const { return m_instanceExtensions; } + VkInstance getInstance (void) const { return *m_instance; } + const InstanceInterface& getInstanceInterface (void) const { return m_instanceInterface; } + deUint32 getMaximumFrameworkVulkanVersion (void) const { return m_maximumFrameworkVulkanVersion; } + deUint32 getAvailableInstanceVersion (void) const { return m_availableInstanceVersion; } + deUint32 getUsedInstanceVersion (void) const { return m_usedInstanceVersion; } + const vector& getInstanceExtensions (void) const { return m_instanceExtensions; } - VkPhysicalDevice getPhysicalDevice (void) const { return m_physicalDevice; } - deUint32 getDeviceVersion (void) const { return m_deviceVersion; } + VkPhysicalDevice getPhysicalDevice (void) const { return m_physicalDevice; } + deUint32 getDeviceVersion (void) const { return m_deviceVersion; } bool isDeviceFeatureInitialized (VkStructureType sType) const { return m_deviceFeatures.isDeviceFeatureInitialized(sType); } - const VkPhysicalDeviceFeatures& getDeviceFeatures (void) const { return m_deviceFeatures.getCoreFeatures2().features; } - const VkPhysicalDeviceFeatures2& getDeviceFeatures2 (void) const { return m_deviceFeatures.getCoreFeatures2(); } - const VkPhysicalDeviceVulkan11Features& getVulkan11Features (void) const { return m_deviceFeatures.getVulkan11Features(); } - const VkPhysicalDeviceVulkan12Features& getVulkan12Features (void) const { return m_deviceFeatures.getVulkan12Features(); } + const VkPhysicalDeviceFeatures& getDeviceFeatures (void) const { return m_deviceFeatures.getCoreFeatures2().features; } + const VkPhysicalDeviceFeatures2& getDeviceFeatures2 (void) const { return m_deviceFeatures.getCoreFeatures2(); } + const VkPhysicalDeviceVulkan11Features& getVulkan11Features (void) const { return m_deviceFeatures.getVulkan11Features(); } + const VkPhysicalDeviceVulkan12Features& getVulkan12Features (void) const { return m_deviceFeatures.getVulkan12Features(); } #include "vkDeviceFeaturesForDefaultDeviceDefs.inl" - bool isDevicePropertyInitialized (VkStructureType sType) const { return m_devicePropertiesFull.isDevicePropertyInitialized(sType); } - const VkPhysicalDeviceProperties& getDeviceProperties (void) const { return m_deviceProperties; } - const VkPhysicalDeviceProperties2& getDeviceProperties2 (void) const { return m_devicePropertiesFull.getCoreProperties2(); } + bool isDevicePropertyInitialized (VkStructureType sType) const { return m_deviceProperties.isDevicePropertyInitialized(sType); } + const VkPhysicalDeviceProperties& getDeviceProperties (void) const { return m_deviceProperties.getCoreProperties2().properties; } + const VkPhysicalDeviceProperties2& getDeviceProperties2 (void) const { return m_deviceProperties.getCoreProperties2(); } + const VkPhysicalDeviceVulkan11Properties& getVulkan11Properties (void) const { return m_deviceProperties.getVulkan11Properties(); } + const VkPhysicalDeviceVulkan12Properties& getVulkan12Properties (void) const { return m_deviceProperties.getVulkan12Properties(); } #include "vkDevicePropertiesForDefaultDeviceDefs.inl" @@ -344,8 +346,7 @@ private: const deUint32 m_universalQueueFamilyIndex; const deUint32 m_sparseQueueFamilyIndex; - const VkPhysicalDeviceProperties m_deviceProperties; - const DeviceProperties m_devicePropertiesFull; + const DeviceProperties m_deviceProperties; const Unique m_device; const DeviceDriver m_deviceInterface; @@ -374,8 +375,7 @@ DefaultDevice::DefaultDevice (const PlatformInterface& vkPlatform, const tcu::Co , m_deviceFeatures (m_instanceInterface, m_usedApiVersion, m_physicalDevice, m_instanceExtensions, m_deviceExtensions) , m_universalQueueFamilyIndex (findQueueFamilyIndexWithCaps(m_instanceInterface, m_physicalDevice, VK_QUEUE_GRAPHICS_BIT|VK_QUEUE_COMPUTE_BIT)) , m_sparseQueueFamilyIndex (m_deviceFeatures.getCoreFeatures2().features.sparseBinding ? findQueueFamilyIndexWithCaps(m_instanceInterface, m_physicalDevice, VK_QUEUE_SPARSE_BINDING_BIT) : 0) - , m_deviceProperties (getPhysicalDeviceProperties(m_instanceInterface, m_physicalDevice)) - , m_devicePropertiesFull (m_instanceInterface, m_usedApiVersion, m_physicalDevice, m_instanceExtensions, m_deviceExtensions) + , m_deviceProperties (m_instanceInterface, m_usedApiVersion, m_physicalDevice, m_instanceExtensions, m_deviceExtensions) , m_device (createDefaultDevice(vkPlatform, *m_instance, m_instanceInterface, m_physicalDevice, m_usedApiVersion, m_universalQueueFamilyIndex, m_sparseQueueFamilyIndex, m_deviceFeatures.getCoreFeatures2(), m_deviceExtensions, cmdLine)) , m_deviceInterface (vkPlatform, *m_instance, *m_device) { diff --git a/external/vulkancts/scripts/gen_framework.py b/external/vulkancts/scripts/gen_framework.py index 4feb9ad..569d157 100755 --- a/external/vulkancts/scripts/gen_framework.py +++ b/external/vulkancts/scripts/gen_framework.py @@ -1855,7 +1855,11 @@ def generateDevicePropertiesDefs(src): if suffixStart > 0: sVerSuffix = sSuffix[:suffixStart] sExtSuffix = sSuffix[suffixStart:] - structName = re.sub("[_0-9][a-z]", lambda match: match.group(0).upper(), sType.capitalize()).replace('_', '') + # handle special case + if sType == "ID": + structName = sType + else: + structName = re.sub("[_0-9][a-z]", lambda match: match.group(0).upper(), sType.capitalize()).replace('_', '') ptrnStructName = r'\s*typedef\s+struct\s+(VkPhysicalDevice' + structName + 'Properties' + sSuffix.replace('_', '') + ')' matchStructName = re.search(ptrnStructName, src, re.M) if matchStructName: @@ -1923,9 +1927,9 @@ def writeDeviceFeatures(api, dfDefs, filename): # add specialization for this feature structure memberCopying = "" for member in structureMembers: - memberCopying += "\tfeatureType.{0} = allBlobs.vk{1}.{0};\n".format(member.name, blobName) + memberCopying += "\tfeatureType.{0} = allFeaturesBlobs.vk{1}.{0};\n".format(member.name, blobName) wholeFunction = \ - "template<> void initFromBlob<{0}>({0}& featureType, const AllBlobs& allBlobs)\n" \ + "template<> void initFeatureFromBlob<{0}>({0}& featureType, const AllFeaturesBlobs& allFeaturesBlobs)\n" \ "{{\n" \ "{1}" \ "}}".format(structureType.name, memberCopying) @@ -1936,7 +1940,7 @@ def writeDeviceFeatures(api, dfDefs, filename): # add empty template definition as on Fedora there are issue with # linking using just generic template - all specializations are needed if notPartOfBlob: - emptyFunction = "template<> void initFromBlob<{0}>({0}&, const AllBlobs&) {{}}" + emptyFunction = "template<> void initFeatureFromBlob<{0}>({0}&, const AllFeaturesBlobs&) {{}}" emptyInitDefinitions.append(emptyFunction.format(structureType.name)) extensionDefines = [] makeFeatureDescDefinitions = [] @@ -2010,11 +2014,76 @@ def writeDeviceFeatures(api, dfDefs, filename): stream.append('} // vk\n') writeInlFile(filename, INL_HEADER, stream) -def writeDeviceProperties(dfDefs, filename): +def writeDeviceProperties(api, dpDefs, filename): + # find VkPhysicalDeviceVulkan[1-9][0-9]Features blob structurs + # and construct dictionary with all of their attributes + blobMembers = {} + blobStructs = {} + blobPattern = re.compile("^VkPhysicalDeviceVulkan([1-9][0-9])Properties[0-9]*$") + for structureType in api.compositeTypes: + match = blobPattern.match(structureType.name) + if match: + allMembers = [member.name for member in structureType.members] + vkVersion = match.group(1) + blobMembers[vkVersion] = allMembers[2:] + blobStructs[vkVersion] = set() + initFromBlobDefinitions = [] + emptyInitDefinitions = [] + # iterate over all property structures + allPropertiesPattern = re.compile("^VkPhysicalDevice\w+Properties[1-9]*") + nonExtPropertiesPattern = re.compile("^VkPhysicalDevice\w+Properties[1-9]*$") + for structureType in api.compositeTypes: + # skip structures that are not property structures + if not allPropertiesPattern.match(structureType.name): + continue + # skip structures that were previously identified as blobs + if blobPattern.match(structureType.name): + continue + if structureType.isAlias: + continue + # skip sType and pNext and just grab third and next attributes + structureMembers = structureType.members[2:] + notPartOfBlob = True + if nonExtPropertiesPattern.match(structureType.name): + # check if this member is part of any of the blobs + for blobName, blobMemberList in blobMembers.items(): + # if just one member is not part of this blob go to the next blob + # (we asume that all members are part of blob - no need to check all) + if structureMembers[0].name not in blobMemberList: + continue + # add another property structure name to this blob + blobStructs[blobName].add(structureType) + # add specialization for this property structure + memberCopying = "" + for member in structureMembers: + if not member.arraySize: + # handle special case + if structureType.name == "VkPhysicalDeviceSubgroupProperties" and "subgroup" not in member.name : + blobMemberName = "subgroup" + member.name[0].capitalize() + member.name[1:] + memberCopying += "\tpropertyType.{0} = allPropertiesBlobs.vk{1}.{2};\n".format(member.name, blobName, blobMemberName) + # end handling special case + else: + memberCopying += "\tpropertyType.{0} = allPropertiesBlobs.vk{1}.{0};\n".format(member.name, blobName) + else: + memberCopying += "\tmemcpy(propertyType.{0}, allPropertiesBlobs.vk{1}.{0}, sizeof({2}) * {3});\n".format(member.name, blobName, member.type[0], member.arraySize[1:-1]) + wholeFunction = \ + "template<> void initPropertyFromBlob<{0}>({0}& propertyType, const AllPropertiesBlobs& allPropertiesBlobs)\n" \ + "{{\n" \ + "{1}" \ + "}}".format(structureType.name, memberCopying) + initFromBlobDefinitions.append(wholeFunction) + notPartOfBlob = False + # assuming that all members are part of blob, goto next + break + # add empty template definition as on Fedora there are issue with + # linking using just generic template - all specializations are needed + if notPartOfBlob: + emptyFunction = "template<> void initPropertyFromBlob<{0}>({0}&, const AllPropertiesBlobs&) {{}}" + emptyInitDefinitions.append(emptyFunction.format(structureType.name)) extensionDefines = [] makePropertyDescDefinitions = [] propertyStructWrappers = [] - for idx, (sType, sVerSuffix, sExtSuffix, extStruct, extLine, extName, specVer) in enumerate(dfDefs): + for idx, (sType, sVerSuffix, sExtSuffix, extStruct, extLine, extName, specVer) in enumerate(dpDefs): extensionNameDefinition = extName if not extensionNameDefinition: extensionNameDefinition = 'DECL{0}_{1}_EXTENSION_NAME'.format((sExtSuffix if sExtSuffix else ''), sType) @@ -2026,20 +2095,47 @@ def writeDeviceProperties(dfDefs, filename): # construct makePropertyDesc template function definitions sTypeName = "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_{0}_PROPERTIES{1}".format(sType, sVerSuffix + sExtSuffix) makePropertyDescDefinitions.append("template<> PropertyDesc makePropertyDesc<{0}>(void) " \ - "{{ return PropertyDesc({1}, {2}, {3}, {4}); }}".format(extStruct, sTypeName, extensionNameDefinition, specVer, len(dfDefs)-idx)) + "{{ return PropertyDesc{{{1}, {2}, {3}, {4}}}; }}".format(extStruct, sTypeName, extensionNameDefinition, specVer, len(dpDefs)-idx)) # construct CreateProperty struct wrapper block propertyStructWrappers.append("\t{{ createPropertyStructWrapper<{0}>, {1}, {2} }},".format(extStruct, extensionNameDefinition, specVer)) + # construct method that will check if structure sType is part of blob + blobChecker = "bool isPartOfBlobProperties (VkStructureType sType)\n{\n" \ + "\tconst std::vector sTypeVect =" \ + "\t{\n" + # iterate over blobs with list of structures + for blobName in sorted(blobStructs.keys()): + blobChecker += "\t\t// Vulkan{0}\n".format(blobName) + # iterate over all feature structures in current blob + structuresList = list(blobStructs[blobName]) + structuresList = sorted(structuresList, key=lambda s: s.name) + for structType in structuresList: + # find definition of this structure in dpDefs + structName = structType.name + structDef = [s for s in dpDefs if s[3] == structName][0] + sType = structDef[0] + sSuffix = structDef[1] + structDef[2] + sTypeName = "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_{0}_PROPERTIES{1}".format(sType, sSuffix) + blobChecker += "\t\t{0},\n".format(sTypeName) + blobChecker += "\t};\n" \ + "\treturn de::contains(sTypeVect.begin(), sTypeVect.end(), sType);\n" \ + "}\n" # combine all definition lists stream = [ '#include "vkDeviceProperties.hpp"\n', 'namespace vk\n{'] stream.extend(extensionDefines) stream.append('\n') + stream.extend(initFromBlobDefinitions) + stream.append('\n// generic template is not enough for some compilers') + stream.extend(emptyInitDefinitions) + stream.append('\n') stream.extend(makePropertyDescDefinitions) stream.append('\n') - stream.append('static const PropertyStructMapItem propertyStructCreatorMap[] =\n{') + stream.append('static const PropertyStructCreationData propertyStructCreationArray[] =\n{') stream.extend(propertyStructWrappers) - stream.append('};\n} // vk\n') + stream.append('};\n') + stream.append(blobChecker) + stream.append('} // vk\n') writeInlFile(filename, INL_HEADER, stream) def genericDeviceFeaturesWriter(dfDefs, pattern, filename): @@ -2071,7 +2167,7 @@ def genericDevicePropertiesWriter(dfDefs, pattern, filename): writeInlFile(filename, INL_HEADER, indentLines(stream)) def writeDevicePropertiesDefaultDeviceDefs(dfDefs, filename): - pattern = "const {0}&\tget{1}\t(void) const {{ return m_devicePropertiesFull.getPropertyType<{0}>();\t}}" + pattern = "const {0}&\tget{1}\t(void) const {{ return m_deviceProperties.getPropertyType<{0}>();\t}}" genericDevicePropertiesWriter(dfDefs, pattern, filename) def writeDevicePropertiesContextDecl(dfDefs, filename): @@ -2227,7 +2323,7 @@ if __name__ == "__main__": writeDeviceFeaturesContextDefs (dfd, os.path.join(VULKAN_DIR, "vkDeviceFeaturesForContextDefs.inl")) dpd = generateDevicePropertiesDefs(src) - writeDeviceProperties (dpd, os.path.join(VULKAN_DIR, "vkDeviceProperties.inl")) + writeDeviceProperties (api, dpd, os.path.join(VULKAN_DIR, "vkDeviceProperties.inl")) writeDevicePropertiesDefaultDeviceDefs (dpd, os.path.join(VULKAN_DIR, "vkDevicePropertiesForDefaultDeviceDefs.inl")) writeDevicePropertiesContextDecl (dpd, os.path.join(VULKAN_DIR, "vkDevicePropertiesForContextDecl.inl"))