From: Samuel Pitoiset Date: Sun, 5 Apr 2020 07:42:50 +0000 (+0200) Subject: radv: only expose fp16 control features for chips with double rate fp16 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63f07a30477d3a8cb80e8344c8315a4eb0b4a8a5;p=mesa.git radv: only expose fp16 control features for chips with double rate fp16 This disables all fp16 shader control features on GFX8 because only GFX9+ supports double rate packed math. This improves consistency regarding other AMD Vulkan drivers. Signed-off-by: Samuel Pitoiset Acked-by: Daniel Schürmann Reviewed-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index db992d6867a..a57071bab5a 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1512,8 +1512,13 @@ radv_get_physical_device_properties_1_2(struct radv_physical_device *pdevice, /* On AMD hardware, denormals and rounding modes for fp16/fp64 are * controlled by the same config register. */ - p->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR; - p->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR; + if (pdevice->rad_info.has_double_rate_fp16) { + p->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR; + p->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY_KHR; + } else { + p->denormBehaviorIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR; + p->roundingModeIndependence = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR; + } /* Do not allow both preserving and flushing denorms because different * shaders in the same pipeline can have different settings and this @@ -1530,10 +1535,10 @@ radv_get_physical_device_properties_1_2(struct radv_physical_device *pdevice, p->shaderSignedZeroInfNanPreserveFloat32 = true; p->shaderDenormFlushToZeroFloat16 = false; - p->shaderDenormPreserveFloat16 = pdevice->rad_info.chip_class >= GFX8; - p->shaderRoundingModeRTEFloat16 = pdevice->rad_info.chip_class >= GFX8; + p->shaderDenormPreserveFloat16 = pdevice->rad_info.has_double_rate_fp16; + p->shaderRoundingModeRTEFloat16 = pdevice->rad_info.has_double_rate_fp16; p->shaderRoundingModeRTZFloat16 = false; - p->shaderSignedZeroInfNanPreserveFloat16 = pdevice->rad_info.chip_class >= GFX8; + p->shaderSignedZeroInfNanPreserveFloat16 = pdevice->rad_info.has_double_rate_fp16; p->shaderDenormFlushToZeroFloat64 = false; p->shaderDenormPreserveFloat64 = pdevice->rad_info.chip_class >= GFX8;