radv: add radv_has_shader_buffer_float_minmax
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 5 May 2022 11:35:09 +0000 (12:35 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 6 May 2022 15:15:13 +0000 (15:15 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16203>

src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h

index 34a8bba..9796cd2 100644 (file)
@@ -1624,10 +1624,7 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: {
          VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *features =
             (VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT *)ext;
-         bool has_shader_buffer_float_minmax = ((pdevice->rad_info.chip_class == GFX6 ||
-                                                 pdevice->rad_info.chip_class == GFX7) &&
-                                                !pdevice->use_llvm) ||
-                                               pdevice->rad_info.chip_class >= GFX10;
+         bool has_shader_buffer_float_minmax = radv_has_shader_buffer_float_minmax(pdevice);
          bool has_shader_image_float_minmax = pdevice->rad_info.chip_class != GFX8 &&
                                               pdevice->rad_info.chip_class != GFX9;
          features->shaderBufferFloat16Atomics = false;
index bbaccfc..15ebed4 100644 (file)
@@ -2938,6 +2938,13 @@ radv_use_llvm_for_stage(struct radv_device *device, UNUSED gl_shader_stage stage
    return device->physical_device->use_llvm;
 }
 
+static inline bool
+radv_has_shader_buffer_float_minmax(const struct radv_physical_device *pdevice)
+{
+   return (pdevice->rad_info.chip_class <= GFX7 && !pdevice->use_llvm) ||
+          pdevice->rad_info.chip_class >= GFX10;
+}
+
 struct radv_acceleration_structure {
    struct vk_object_base base;