From: Jason Ekstrand Date: Wed, 12 Jan 2022 20:17:27 +0000 (-0800) Subject: anv: Implement 1.3 features/properties X-Git-Tag: upstream/22.3.5~13377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e730167a4ac9d26ef1d698e6e57e75e55095905;p=platform%2Fupstream%2Fmesa.git anv: Implement 1.3 features/properties Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index f0995a8..df942f2 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1406,6 +1406,29 @@ anv_get_physical_device_features_1_2(struct anv_physical_device *pdevice, f->subgroupBroadcastDynamicId = true; } +static void +anv_get_physical_device_features_1_3(struct anv_physical_device *pdevice, + VkPhysicalDeviceVulkan13Features *f) +{ + assert(f->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES); + + f->robustImageAccess = true; + f->inlineUniformBlock = true; + f->descriptorBindingInlineUniformBlockUpdateAfterBind = true; + f->pipelineCreationCacheControl = true; + f->privateData = true; + f->shaderDemoteToHelperInvocation = true; + f->shaderTerminateInvocation = true; + f->subgroupSizeControl = true; + f->computeFullSubgroups = true; + f->synchronization2 = true; + f->textureCompressionASTC_HDR = false; + f->shaderZeroInitializeWorkgroupMemory = true; + f->dynamicRendering = true; + f->shaderIntegerDotProduct = true; + f->maintenance4 = true; +} + void anv_GetPhysicalDeviceFeatures2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) @@ -1423,11 +1446,18 @@ void anv_GetPhysicalDeviceFeatures2( }; anv_get_physical_device_features_1_2(pdevice, &core_1_2); + VkPhysicalDeviceVulkan13Features core_1_3 = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES, + }; + anv_get_physical_device_features_1_3(pdevice, &core_1_3); + vk_foreach_struct(ext, pFeatures->pNext) { if (vk_get_physical_device_core_1_1_feature_ext(ext, &core_1_1)) continue; if (vk_get_physical_device_core_1_2_feature_ext(ext, &core_1_2)) continue; + if (vk_get_physical_device_core_1_3_feature_ext(ext, &core_1_3)) + continue; switch (ext->sType) { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: { @@ -1438,7 +1468,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: { VkPhysicalDeviceAccelerationStructureFeaturesKHR *features = (void *)ext; features->accelerationStructure = false; @@ -1528,13 +1557,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT: { - VkPhysicalDeviceImageRobustnessFeaturesEXT *features = - (VkPhysicalDeviceImageRobustnessFeaturesEXT *)ext; - features->robustImageAccess = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: { VkPhysicalDeviceIndexTypeUint8FeaturesEXT *features = (VkPhysicalDeviceIndexTypeUint8FeaturesEXT *)ext; @@ -1542,14 +1564,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: { - VkPhysicalDeviceInlineUniformBlockFeaturesEXT *features = - (VkPhysicalDeviceInlineUniformBlockFeaturesEXT *)ext; - features->inlineUniformBlock = true; - features->descriptorBindingInlineUniformBlockUpdateAfterBind = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: { VkPhysicalDeviceLineRasterizationFeaturesEXT *features = (VkPhysicalDeviceLineRasterizationFeaturesEXT *)ext; @@ -1593,13 +1607,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT: { - VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT *features = - (VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT *)ext; - features->pipelineCreationCacheControl = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: { VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *features = (VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR *)ext; @@ -1607,12 +1614,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: { - VkPhysicalDevicePrivateDataFeaturesEXT *features = (void *)ext; - features->privateData = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: { VkPhysicalDeviceProvokingVertexFeaturesEXT *features = (VkPhysicalDeviceProvokingVertexFeaturesEXT *)ext; @@ -1663,12 +1664,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: { - VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *features = (void *)ext; - features->shaderDemoteToHelperInvocation = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: { VkPhysicalDeviceShaderClockFeaturesKHR *features = (VkPhysicalDeviceShaderClockFeaturesKHR *)ext; @@ -1684,13 +1679,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR: { - VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR *features = - (VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR *)ext; - features->shaderIntegerDotProduct = true; - break; - }; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: { VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *features = (VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR *)ext; @@ -1698,28 +1686,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: { - VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *features = - (VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *)ext; - features->shaderTerminateInvocation = true; - break; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: { - VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *features = - (VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *)ext; - features->subgroupSizeControl = true; - features->computeFullSubgroups = true; - break; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR: { - VkPhysicalDeviceSynchronization2FeaturesKHR *features = - (VkPhysicalDeviceSynchronization2FeaturesKHR *)ext; - features->synchronization2 = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: { VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *features = (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)ext; @@ -1776,13 +1742,6 @@ void anv_GetPhysicalDeviceFeatures2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR: { - VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR *features = - (VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR *)ext; - features->shaderZeroInitializeWorkgroupMemory = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: { VkPhysicalDeviceMultiDrawFeaturesEXT *features = (VkPhysicalDeviceMultiDrawFeaturesEXT *)ext; features->multiDraw = true; @@ -2166,6 +2125,86 @@ anv_get_physical_device_properties_1_2(struct anv_physical_device *pdevice, isl_device_get_sample_counts(&pdevice->isl_dev); } +static void +anv_get_physical_device_properties_1_3(struct anv_physical_device *pdevice, + VkPhysicalDeviceVulkan13Properties *p) +{ + assert(p->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES); + + p->minSubgroupSize = 8; + p->maxSubgroupSize = 32; + p->maxComputeWorkgroupSubgroups = pdevice->info.max_cs_workgroup_threads; + p->requiredSubgroupSizeStages = VK_SHADER_STAGE_COMPUTE_BIT; + + p->maxInlineUniformBlockSize = MAX_INLINE_UNIFORM_BLOCK_SIZE; + p->maxPerStageDescriptorInlineUniformBlocks = + MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; + p->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = + MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; + p->maxDescriptorSetInlineUniformBlocks = + MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; + p->maxDescriptorSetUpdateAfterBindInlineUniformBlocks = + MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; + p->maxInlineUniformTotalSize = UINT16_MAX; + + p->integerDotProduct8BitUnsignedAccelerated = false; + p->integerDotProduct8BitSignedAccelerated = false; + p->integerDotProduct8BitMixedSignednessAccelerated = false; + p->integerDotProduct4x8BitPackedUnsignedAccelerated = pdevice->info.ver >= 12; + p->integerDotProduct4x8BitPackedSignedAccelerated = pdevice->info.ver >= 12; + p->integerDotProduct4x8BitPackedMixedSignednessAccelerated = pdevice->info.ver >= 12; + p->integerDotProduct16BitUnsignedAccelerated = false; + p->integerDotProduct16BitSignedAccelerated = false; + p->integerDotProduct16BitMixedSignednessAccelerated = false; + p->integerDotProduct32BitUnsignedAccelerated = false; + p->integerDotProduct32BitSignedAccelerated = false; + p->integerDotProduct32BitMixedSignednessAccelerated = false; + p->integerDotProduct64BitUnsignedAccelerated = false; + p->integerDotProduct64BitSignedAccelerated = false; + p->integerDotProduct64BitMixedSignednessAccelerated = false; + p->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = false; + p->integerDotProductAccumulatingSaturating8BitSignedAccelerated = false; + p->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = false; + p->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = pdevice->info.ver >= 12; + p->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = pdevice->info.ver >= 12; + p->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = pdevice->info.ver >= 12; + p->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = false; + p->integerDotProductAccumulatingSaturating16BitSignedAccelerated = false; + p->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = false; + p->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = false; + p->integerDotProductAccumulatingSaturating32BitSignedAccelerated = false; + p->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = false; + p->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = false; + p->integerDotProductAccumulatingSaturating64BitSignedAccelerated = false; + p->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = false; + + /* From the SKL PRM Vol. 2d, docs for RENDER_SURFACE_STATE::Surface + * Base Address: + * + * "For SURFTYPE_BUFFER non-rendertarget surfaces, this field + * specifies the base address of the first element of the surface, + * computed in software by adding the surface base address to the + * byte offset of the element in the buffer. The base address must + * be aligned to element size." + * + * The typed dataport messages require that things be texel aligned. + * Otherwise, we may just load/store the wrong data or, in the worst + * case, there may be hangs. + */ + p->storageTexelBufferOffsetAlignmentBytes = 16; + p->storageTexelBufferOffsetSingleTexelAlignment = true; + + /* The sampler, however, is much more forgiving and it can handle + * arbitrary byte alignment for linear and buffer surfaces. It's + * hard to find a good PRM citation for this but years of empirical + * experience demonstrate that this is true. + */ + p->uniformTexelBufferOffsetAlignmentBytes = 1; + p->uniformTexelBufferOffsetSingleTexelAlignment = false; + + p->maxBufferSize = pdevice->isl_dev.max_buffer_size; +} + void anv_GetPhysicalDeviceProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) @@ -2184,11 +2223,18 @@ void anv_GetPhysicalDeviceProperties2( }; anv_get_physical_device_properties_1_2(pdevice, &core_1_2); + VkPhysicalDeviceVulkan13Properties core_1_3 = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES, + }; + anv_get_physical_device_properties_1_3(pdevice, &core_1_3); + vk_foreach_struct(ext, pProperties->pNext) { if (vk_get_physical_device_core_1_1_property_ext(ext, &core_1_1)) continue; if (vk_get_physical_device_core_1_2_property_ext(ext, &core_1_2)) continue; + if (vk_get_physical_device_core_1_3_property_ext(ext, &core_1_3)) + continue; switch (ext->sType) { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: { @@ -2238,7 +2284,6 @@ void anv_GetPhysicalDeviceProperties2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: { VkPhysicalDeviceFragmentShadingRatePropertiesKHR *props = (VkPhysicalDeviceFragmentShadingRatePropertiesKHR *)ext; @@ -2289,21 +2334,6 @@ void anv_GetPhysicalDeviceProperties2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: { - VkPhysicalDeviceInlineUniformBlockPropertiesEXT *props = - (VkPhysicalDeviceInlineUniformBlockPropertiesEXT *)ext; - props->maxInlineUniformBlockSize = MAX_INLINE_UNIFORM_BLOCK_SIZE; - props->maxPerStageDescriptorInlineUniformBlocks = - MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; - props->maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = - MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; - props->maxDescriptorSetInlineUniformBlocks = - MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; - props->maxDescriptorSetUpdateAfterBindInlineUniformBlocks = - MAX_INLINE_UNIFORM_BLOCK_DESCRIPTORS; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: { VkPhysicalDeviceLineRasterizationPropertiesEXT *props = (VkPhysicalDeviceLineRasterizationPropertiesEXT *)ext; @@ -2384,55 +2414,6 @@ void anv_GetPhysicalDeviceProperties2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR: { - VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR *props = - (VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR *)ext; - - props->integerDotProduct8BitUnsignedAccelerated = false; - props->integerDotProduct8BitSignedAccelerated = false; - props->integerDotProduct8BitMixedSignednessAccelerated = false; - props->integerDotProduct4x8BitPackedUnsignedAccelerated = pdevice->info.ver >= 12; - props->integerDotProduct4x8BitPackedSignedAccelerated = pdevice->info.ver >= 12; - props->integerDotProduct4x8BitPackedMixedSignednessAccelerated = pdevice->info.ver >= 12; - props->integerDotProduct16BitUnsignedAccelerated = false; - props->integerDotProduct16BitSignedAccelerated = false; - props->integerDotProduct16BitMixedSignednessAccelerated = false; - props->integerDotProduct32BitUnsignedAccelerated = false; - props->integerDotProduct32BitSignedAccelerated = false; - props->integerDotProduct32BitMixedSignednessAccelerated = false; - props->integerDotProduct64BitUnsignedAccelerated = false; - props->integerDotProduct64BitSignedAccelerated = false; - props->integerDotProduct64BitMixedSignednessAccelerated = false; - props->integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = false; - props->integerDotProductAccumulatingSaturating8BitSignedAccelerated = false; - props->integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = false; - props->integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = pdevice->info.ver >= 12; - props->integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = pdevice->info.ver >= 12; - props->integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = pdevice->info.ver >= 12; - props->integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = false; - props->integerDotProductAccumulatingSaturating16BitSignedAccelerated = false; - props->integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = false; - props->integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = false; - props->integerDotProductAccumulatingSaturating32BitSignedAccelerated = false; - props->integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = false; - props->integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = false; - props->integerDotProductAccumulatingSaturating64BitSignedAccelerated = false; - props->integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = false; - - break; - } - - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT: { - VkPhysicalDeviceSubgroupSizeControlPropertiesEXT *props = - (VkPhysicalDeviceSubgroupSizeControlPropertiesEXT *)ext; - STATIC_ASSERT(8 <= BRW_SUBGROUP_SIZE && BRW_SUBGROUP_SIZE <= 32); - props->minSubgroupSize = 8; - props->maxSubgroupSize = 32; - props->maxComputeWorkgroupSubgroups = pdevice->info.max_cs_workgroup_threads; - props->requiredSubgroupSizeStages = VK_SHADER_STAGE_COMPUTE_BIT; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: { VkPhysicalDeviceSampleLocationsPropertiesEXT *props = (VkPhysicalDeviceSampleLocationsPropertiesEXT *)ext; @@ -2452,36 +2433,6 @@ void anv_GetPhysicalDeviceProperties2( break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: { - VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *props = - (VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *)ext; - - /* From the SKL PRM Vol. 2d, docs for RENDER_SURFACE_STATE::Surface - * Base Address: - * - * "For SURFTYPE_BUFFER non-rendertarget surfaces, this field - * specifies the base address of the first element of the surface, - * computed in software by adding the surface base address to the - * byte offset of the element in the buffer. The base address must - * be aligned to element size." - * - * The typed dataport messages require that things be texel aligned. - * Otherwise, we may just load/store the wrong data or, in the worst - * case, there may be hangs. - */ - props->storageTexelBufferOffsetAlignmentBytes = 16; - props->storageTexelBufferOffsetSingleTexelAlignment = true; - - /* The sampler, however, is much more forgiving and it can handle - * arbitrary byte alignment for linear and buffer surfaces. It's - * hard to find a good PRM citation for this but years of empirical - * experience demonstrate that this is true. - */ - props->uniformTexelBufferOffsetAlignmentBytes = 1; - props->uniformTexelBufferOffsetSingleTexelAlignment = false; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: { VkPhysicalDeviceTransformFeedbackPropertiesEXT *props = (VkPhysicalDeviceTransformFeedbackPropertiesEXT *)ext;