From 4d44848c470c9d214c03906d8decd8056829c4ce Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 19 May 2020 10:26:58 -0500 Subject: [PATCH] anv: Advertise support for VK_EXT_shader_atomic_float We already have all of the shader code for load/store/exchange. Reviewed-by: Lionel Landwerlin Part-of: --- docs/relnotes/new_features.txt | 1 + src/intel/vulkan/anv_device.c | 17 +++++++++++++++++ src/intel/vulkan/anv_extensions.py | 1 + src/intel/vulkan/anv_formats.c | 3 ++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index ae71cc97b60..4726f0f146e 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -20,3 +20,4 @@ GL_ARB_spirv_extensions on nvc0/nir. RADV now uses ACO per default as backend RADV_DEBUG=llvm option to enable LLVM backend for RADV VK_EXT_image_robustness for ANV +VK_EXT_shader_atomic_float on ANV diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 401b00895ab..b68b81f94dd 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1321,6 +1321,23 @@ void anv_GetPhysicalDeviceFeatures2( break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: { + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *features = (void *)ext; + features->shaderBufferFloat32Atomics = true; + features->shaderBufferFloat32AtomicAdd = false; + features->shaderBufferFloat64Atomics = false; + features->shaderBufferFloat64AtomicAdd = false; + features->shaderSharedFloat32Atomics = true; + features->shaderSharedFloat32AtomicAdd = false; + features->shaderSharedFloat64Atomics = false; + features->shaderSharedFloat64AtomicAdd = false; + features->shaderImageFloat32Atomics = true; + features->shaderImageFloat32AtomicAdd = false; + features->sparseImageFloat32Atomics = false; + features->sparseImageFloat32AtomicAdd = false; + break; + } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: { VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *features = (void *)ext; CORE_FEATURE(1, 2, shaderBufferInt64Atomics); diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 5f9278201a8..ce587ef3cb0 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -152,6 +152,7 @@ EXTENSIONS = [ Extension('VK_EXT_sampler_filter_minmax', 1, 'device->info.gen >= 9'), Extension('VK_EXT_scalar_block_layout', 1, True), Extension('VK_EXT_separate_stencil_usage', 1, True), + Extension('VK_EXT_shader_atomic_float', 1, True), Extension('VK_EXT_shader_demote_to_helper_invocation', 1, True), Extension('VK_EXT_shader_stencil_export', 1, 'device->info.gen >= 9'), Extension('VK_EXT_shader_subgroup_ballot', 1, True), diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index b7cac527ac5..2f512baa024 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -610,7 +610,8 @@ anv_get_image_format_features(const struct gen_device_info *devinfo, flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT; if (base_isl_format == ISL_FORMAT_R32_SINT || - base_isl_format == ISL_FORMAT_R32_UINT) + base_isl_format == ISL_FORMAT_R32_UINT || + base_isl_format == ISL_FORMAT_R32_FLOAT) flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT; if (flags) { -- 2.30.2