From: Samuel Pitoiset Date: Mon, 20 Jul 2020 16:38:17 +0000 (+0200) Subject: radv: advertise VK_EXT_shader_atomic_float X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c1108d25b46ddf7789b2c9f9f7b0a79b3e279a0;p=mesa.git radv: advertise VK_EXT_shader_atomic_float No hw support for float atomic add for buffer and (sparse) images. Signed-off-by: Samuel Pitoiset Reviewed-by: Daniel Schürmann Part-of: --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index b9969e4e5eb..c474c78eb21 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1340,6 +1340,24 @@ void radv_GetPhysicalDeviceFeatures2( features->robustImageAccess = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: { + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *features = + (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *)ext; + features->shaderBufferFloat32Atomics = true; + features->shaderBufferFloat32AtomicAdd = false; + features->shaderBufferFloat64Atomics = true; + features->shaderBufferFloat64AtomicAdd = false; + features->shaderSharedFloat32Atomics = true; + features->shaderSharedFloat32AtomicAdd = pdevice->rad_info.chip_class >= GFX8 && + (!pdevice->use_llvm || LLVM_VERSION_MAJOR >= 10); + features->shaderSharedFloat64Atomics = true; + features->shaderSharedFloat64AtomicAdd = false; + features->shaderImageFloat32Atomics = true; + features->shaderImageFloat32AtomicAdd = false; + features->sparseImageFloat32Atomics = false; + features->sparseImageFloat32AtomicAdd = false; + break; + } default: break; } diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 90b5ef41e83..2a3e995e309 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -153,6 +153,7 @@ EXTENSIONS = [ Extension('VK_EXT_sample_locations', 1, 'device->rad_info.chip_class < GFX10'), Extension('VK_EXT_sampler_filter_minmax', 1, True), Extension('VK_EXT_scalar_block_layout', 1, 'device->rad_info.chip_class >= GFX7'), + Extension('VK_EXT_shader_atomic_float', 1, True), Extension('VK_EXT_shader_demote_to_helper_invocation',1, 'LLVM_VERSION_MAJOR >= 9 || !device->use_llvm'), Extension('VK_EXT_shader_viewport_index_layer', 1, True), Extension('VK_EXT_shader_stencil_export', 1, True), diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index 2e753f47be8..9360fb31bcc 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -749,7 +749,9 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical VK_FORMAT_FEATURE_TRANSFER_DST_BIT; } - if (format == VK_FORMAT_R32_UINT || format == VK_FORMAT_R32_SINT) { + if (format == VK_FORMAT_R32_UINT || + format == VK_FORMAT_R32_SINT || + format == VK_FORMAT_R32_SFLOAT) { buffer |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT; linear |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT; tiled |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 072201fe66b..3af15d4e844 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -377,6 +377,7 @@ radv_shader_compile_to_nir(struct radv_device *device, .draw_parameters = true, .float_controls = true, .float16 = device->physical_device->rad_info.has_packed_math_16bit, + .float32_atomic_add = true, .float64 = true, .geometry_streams = true, .image_ms_array = true,