From de9d8a23d2a34f6970db9262e034211440681728 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 3 Jan 2025 02:20:09 -0800 Subject: [PATCH] radv: add a helper to report if cooperative matrix is enabled To avoid duplicating checks. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_physical_device.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index dfdb7276988..de2911852d4 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -108,6 +108,12 @@ radv_filter_minmax_enabled(const struct radv_physical_device *pdev) return !(pdev->info.family == CHIP_TAHITI || pdev->info.family == CHIP_VERDE); } +static bool +radv_cooperative_matrix_enabled(const struct radv_physical_device *pdev) +{ + return pdev->info.gfx_level >= GFX11 && !pdev->use_llvm; +} + bool radv_enable_rt(const struct radv_physical_device *pdev) { @@ -536,7 +542,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device .KHR_acceleration_structure = radv_enable_rt(pdev), .KHR_calibrated_timestamps = radv_calibrated_timestamps_enabled(pdev), .KHR_compute_shader_derivatives = true, - .KHR_cooperative_matrix = pdev->info.gfx_level >= GFX11 && !pdev->use_llvm, + .KHR_cooperative_matrix = radv_cooperative_matrix_enabled(pdev), .KHR_bind_memory2 = true, .KHR_buffer_device_address = true, .KHR_copy_commands2 = true, @@ -1242,8 +1248,8 @@ radv_physical_device_get_features(const struct radv_physical_device *pdev, struc .maintenance5 = true, /* VK_KHR_cooperative_matrix */ - .cooperativeMatrix = pdev->info.gfx_level >= GFX11 && !pdev->use_llvm, - .cooperativeMatrixRobustBufferAccess = pdev->info.gfx_level >= GFX11 && !pdev->use_llvm, + .cooperativeMatrix = radv_cooperative_matrix_enabled(pdev), + .cooperativeMatrixRobustBufferAccess = radv_cooperative_matrix_enabled(pdev), /* VK_EXT_image_compression_control */ .imageCompressionControl = true,