diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c
index a7bc1378be2..0feb5997388 100644
--- a/src/amd/vulkan/radv_instance.c
+++ b/src/amd/vulkan/radv_instance.c
@@ -193,6 +193,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_LOWER_TERMINATE_TO_DISCARD(false)
DRI_CONF_RADV_APP_LAYER()
DRI_CONF_RADV_EMULATE_RT(false)
+ DRI_CONF_RADV_ENABLE_FLOAT16_GFX8(false)
DRI_CONF_SECTION_END
};
// clang-format on
@@ -289,6 +290,8 @@ radv_init_dri_options(struct radv_instance *instance)
driQueryOptionb(&instance->drirc.options, "radv_lower_terminate_to_discard");
instance->drirc.emulate_rt = driQueryOptionb(&instance->drirc.options, "radv_emulate_rt");
+
+ instance->drirc.expose_float16_gfx8 = driQueryOptionb(&instance->drirc.options, "radv_enable_float16_gfx8");
}
static const struct vk_instance_extension_table radv_instance_extensions_supported = {
diff --git a/src/amd/vulkan/radv_instance.h b/src/amd/vulkan/radv_instance.h
index 59b1db105ef..d0f23404285 100644
--- a/src/amd/vulkan/radv_instance.h
+++ b/src/amd/vulkan/radv_instance.h
@@ -73,6 +73,7 @@ struct radv_instance {
bool disable_dcc_stores;
bool lower_terminate_to_discard;
bool emulate_rt;
+ bool expose_float16_gfx8;
char *app_layer;
uint8_t override_graphics_shader_version;
uint8_t override_compute_shader_version;
diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c
index 0e62afeee1b..49ef44184ae 100644
--- a/src/amd/vulkan/radv_physical_device.c
+++ b/src/amd/vulkan/radv_physical_device.c
@@ -827,7 +827,8 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc
.storagePushConstant8 = true,
.shaderBufferInt64Atomics = true,
.shaderSharedInt64Atomics = true,
- .shaderFloat16 = pdev->info.has_packed_math_16bit,
+ .shaderFloat16 = pdev->info.has_packed_math_16bit ||
+ (pdev->info.gfx_level == GFX8 && instance->drirc.expose_float16_gfx8),
.shaderInt8 = true,
.descriptorIndexing = true,
diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf
index c17fdc010ee..d2a4fdb409d 100644
--- a/src/util/00-radv-defaults.conf
+++ b/src/util/00-radv-defaults.conf
@@ -115,6 +115,7 @@ Application bugs worked around in this file:
+
diff --git a/src/util/driconf.h b/src/util/driconf.h
index 9d4ba7499fe..28d0bb6515f 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -802,6 +802,10 @@
DRI_CONF_OPT_B(radv_emulate_rt, def, \
"Expose RT extensions on GFX10 and below through software emulation.")
+#define DRI_CONF_RADV_ENABLE_FLOAT16_GFX8(def) \
+ DRI_CONF_OPT_B(radv_enable_float16_gfx8, def, \
+ "Expose float16 on GFX8, where it's supported but usually not beneficial.")
+
/**
* \brief ANV specific configuration options
*/