anv: Advertise support for VK_EXT_shader_atomic_float
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 19 May 2020 15:26:58 +0000 (10:26 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Jul 2020 05:01:34 +0000 (05:01 +0000)
We already have all of the shader code for load/store/exchange.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5992>

docs/relnotes/new_features.txt
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_extensions.py
src/intel/vulkan/anv_formats.c

index ae71cc97b60b782cc4189931a41e9bbd1ec4e11e..4726f0f146e7e8d834ae67cd0193505d6ee27b15 100644 (file)
@@ -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
index 401b00895abdf02c8acc993e3682a771c4611275..b68b81f94ddebe762451746c5e76b25eeccb672c 100644 (file)
@@ -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);
index 5f9278201a808d9d48692d11ded4c69971c49a9f..ce587ef3cb070227c9b84b96b549a4720c615db7 100644 (file)
@@ -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),
index b7cac527ac5c0d160924933e1b56ac6bf7491316..2f512baa024ec2317816e66102a9a4268560bdce 100644 (file)
@@ -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) {