Mesa (main): radv: add radv_has_shader_buffer_float_minmax
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri May 6 15:35:33 UTC 2022
Module: Mesa
Branch: main
Commit: 28a87dee6060f775cede7741534944a65aaad601
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=28a87dee6060f775cede7741534944a65aaad601
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Thu May 5 12:35:09 2022 +0100
radv: add radv_has_shader_buffer_float_minmax
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16203>
---
src/amd/vulkan/radv_device.c | 5 +----
src/amd/vulkan/radv_private.h | 7 +++++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 34a8bba2942..9796cd2dea1 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -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;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index bbaccfc5cdf..15ebed4f6d8 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -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;
More information about the mesa-commit
mailing list