mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
anv: Enable KHR_shader_integer_dot_product
For now, only mark the 4x8BitPacked variants as accelerated. Applications are unlikely to use the "add with saturate" opcodes from VK_INTEL_shader_integer_functions2, so, technically, all of the AccumulatingSaturating variants "[provide] a performance advantage over user-provided code composed from elementary instructions..." on all Intel platforms. If we encounter an application that cares, we can do things differently then. Ditto for the non-packed 8Bit, 4-element vector variants. v2: Don't memset props as this also zeros sType and pNext. Noticed by Georg Lehmann in !12617. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12624>
This commit is contained in:
parent
24b8fc38c3
commit
f2c69f8306
1 changed files with 46 additions and 0 deletions
|
|
@ -222,6 +222,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
|||
.KHR_shader_draw_parameters = true,
|
||||
.KHR_shader_float16_int8 = device->info.ver >= 8,
|
||||
.KHR_shader_float_controls = device->info.ver >= 8,
|
||||
.KHR_shader_integer_dot_product = true,
|
||||
.KHR_shader_non_semantic_info = true,
|
||||
.KHR_shader_subgroup_extended_types = device->info.ver >= 8,
|
||||
.KHR_shader_subgroup_uniform_control_flow = true,
|
||||
|
|
@ -1772,6 +1773,13 @@ 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_EXTENDED_TYPES_FEATURES_KHR: {
|
||||
VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR *features =
|
||||
(VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR *)ext;
|
||||
|
|
@ -2578,6 +2586,44 @@ 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_PROPERTIES: {
|
||||
VkPhysicalDeviceSubgroupProperties *properties = (void *)ext;
|
||||
CORE_PROPERTY(1, 1, subgroupSize);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue