Mesa (master): radv: only expose shaderFloat16 for chips with double rate fp16

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 9 11:53:38 UTC 2020


Module: Mesa
Branch: master
Commit: 1d74c6565d74188efea8bdef3dd33c1e4aa21f60
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d74c6565d74188efea8bdef3dd33c1e4aa21f60

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Sun Apr  5 09:25:18 2020 +0200

radv: only expose shaderFloat16 for chips with double rate fp16

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 <samuel.pitoiset at gmail.com>
Acked-by: Daniel Schürmann <daniel at schuermann.dev>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4453>

---

 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,



More information about the mesa-commit mailing list