radv: advertise VK_NV_cooperative_matrix2/cooperativeMatrixConversions behind an env var

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34793>
This commit is contained in:
Georg Lehmann 2025-04-23 17:25:13 +02:00 committed by Marge Bot
parent 249ccc6b4c
commit 8256097c0c
5 changed files with 33 additions and 0 deletions

View file

@ -196,6 +196,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_EMULATE_RT(false)
DRI_CONF_RADV_ENABLE_FLOAT16_GFX8(false)
DRI_CONF_RADV_DISABLE_HIZ_HIS_GFX12(false)
DRI_CONF_RADV_COOPERATIVE_MATRIX2_NV(false)
DRI_CONF_SECTION_END
};
// clang-format on
@ -300,6 +301,8 @@ radv_init_dri_options(struct radv_instance *instance)
instance->drirc.expose_float16_gfx8 = driQueryOptionb(&instance->drirc.options, "radv_enable_float16_gfx8");
instance->drirc.disable_hiz_his_gfx12 = driQueryOptionb(&instance->drirc.options, "radv_disable_hiz_his_gfx12");
instance->drirc.cooperative_matrix2_nv = driQueryOptionb(&instance->drirc.options, "radv_cooperative_matrix2_nv");
}
static const struct vk_instance_extension_table radv_instance_extensions_supported = {

View file

@ -74,6 +74,7 @@ struct radv_instance {
bool emulate_rt;
bool expose_float16_gfx8;
bool disable_hiz_his_gfx12;
bool cooperative_matrix2_nv;
char *app_layer;
uint8_t override_graphics_shader_version;
uint8_t override_compute_shader_version;

View file

@ -140,6 +140,17 @@ radv_cooperative_matrix_enabled(const struct radv_physical_device *pdev)
return pdev->info.gfx_level >= GFX11 && !pdev->use_llvm;
}
static bool
radv_cooperative_matrix2_nv_enabled(const struct radv_physical_device *pdev)
{
if (!radv_cooperative_matrix_enabled(pdev))
return false;
const struct radv_instance *instance = radv_physical_device_instance(pdev);
return instance->drirc.cooperative_matrix2_nv;
}
bool
radv_enable_rt(const struct radv_physical_device *pdev)
{
@ -764,6 +775,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
.INTEL_shader_integer_functions2 = true,
.MESA_image_alignment_control = pdev->info.gfx_level >= GFX9,
.NV_compute_shader_derivatives = true,
.NV_cooperative_matrix2 = radv_cooperative_matrix2_nv_enabled(pdev),
.VALVE_mutable_descriptor_type = true,
};
*out_ext = ext;
@ -1345,6 +1357,9 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc
/* VK_EXT_shader_float8 */
.shaderFloat8 = true,
.shaderFloat8CooperativeMatrix = radv_cooperative_matrix_enabled(pdev),
/* VK_NV_cooperative_matrix2 */
.cooperativeMatrixConversions = true,
};
}
@ -2988,3 +3003,12 @@ radv_GetPhysicalDeviceCooperativeMatrixPropertiesKHR(VkPhysicalDevice physicalDe
return vk_outarray_status(&out);
}
VKAPI_ATTR VkResult VKAPI_CALL
radv_GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(
VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount,
VkCooperativeMatrixFlexibleDimensionsPropertiesNV *pProperties)
{
*pPropertyCount = 0;
return VK_SUCCESS;
}

View file

@ -42,6 +42,7 @@ Application bugs worked around in this file:
<option name="radv_zero_vram" value="true" />
<option name="radv_disable_aniso_single_level" value="true" />
<option name="radv_disable_trunc_coord" value="true" />
<option name="radv_cooperative_matrix2_nv" value="true" />
</engine>
<engine engine_name_match="DXVK">

View file

@ -788,6 +788,10 @@
DRI_CONF_OPT_B(radv_disable_hiz_his_gfx12, def, \
"Disable HiZ/HiS on GFX12 (RDNA4) to workaround a hw bug that causes random GPU hangs")
#define DRI_CONF_RADV_COOPERATIVE_MATRIX2_NV(def) \
DRI_CONF_OPT_B(radv_cooperative_matrix2_nv, def, \
"Expose VK_NV_cooperative_matrix2 on supported hardware.")
/**
* \brief ANV specific configuration options
*/