From 1d74c6565d74188efea8bdef3dd33c1e4aa21f60 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Sun, 5 Apr 2020 09:25:18 +0200 Subject: [PATCH] radv: only expose shaderFloat16 for chips with double rate fp16 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This disables shaderFloat16 on GFX8 because only GFX9+ supports double rate packed math. This improves consistency regarding other AMD Vulkan drivers and it makes no sense to enable that feature without packed math. This also reduces performance with Wolfeinstein Youngblood if fp16 is forced enabled on GFX8, while it's similar on GFX9. We might re-introduce that feature in the future with ACO support if it ends up being faster and correct. Signed-off-by: Samuel Pitoiset Acked-by: Daniel Schürmann Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_device.c | 4 ++-- src/amd/vulkan/radv_shader.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 030fba00d11..097f54931b9 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1106,7 +1106,7 @@ void radv_GetPhysicalDeviceFeatures2( case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: { VkPhysicalDeviceShaderFloat16Int8Features *features = (VkPhysicalDeviceShaderFloat16Int8Features*)ext; - features->shaderFloat16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco; + features->shaderFloat16 = pdevice->rad_info.has_double_rate_fp16 && !pdevice->use_aco; features->shaderInt8 = !pdevice->use_aco; break; } @@ -1239,7 +1239,7 @@ void radv_GetPhysicalDeviceFeatures2( features->storagePushConstant8 = !pdevice->use_aco; features->shaderBufferInt64Atomics = LLVM_VERSION_MAJOR >= 9; features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9; - features->shaderFloat16 = pdevice->rad_info.chip_class >= GFX8 && !pdevice->use_aco; + features->shaderFloat16 = pdevice->rad_info.has_double_rate_fp16 && !pdevice->use_aco; features->shaderInt8 = !pdevice->use_aco; features->descriptorIndexing = true; features->shaderInputAttachmentArrayDynamicIndexing = true; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index bb88b368d05..b04da434660 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -350,7 +350,7 @@ radv_shader_compile_to_nir(struct radv_device *device, .device_group = true, .draw_parameters = true, .float_controls = true, - .float16 = !device->physical_device->use_aco, + .float16 = device->physical_device->rad_info.has_double_rate_fp16 && !device->physical_device->use_aco, .float64 = true, .geometry_streams = true, .image_ms_array = true, -- 2.30.2