anv: Enable cooperativeMatrixPerElementOperations

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39904>
This commit is contained in:
Caio Oliveira 2026-02-13 20:56:57 -08:00 committed by Marge Bot
parent ffc3219d57
commit 3debca7dc6
2 changed files with 19 additions and 0 deletions

View file

@ -148,6 +148,7 @@ get_device_extensions(const struct anv_physical_device *device,
.KHR_calibrated_timestamps = device->has_reg_timestamp,
.KHR_compute_shader_derivatives = true,
.KHR_cooperative_matrix = device->has_cooperative_matrix,
.NV_cooperative_matrix2 = device->has_cooperative_matrix,
.KHR_copy_commands2 = true,
.KHR_create_renderpass2 = true,
.KHR_dedicated_allocation = true,
@ -883,6 +884,9 @@ get_features(const struct anv_physical_device *pdevice,
/* VK_KHR_cooperative_matrix */
.cooperativeMatrix = pdevice->has_cooperative_matrix,
/* VK_NV_cooperative_matrix2 */
.cooperativeMatrixPerElementOperations = pdevice->has_cooperative_matrix,
/* VK_KHR_shader_maximal_reconvergence */
.shaderMaximalReconvergence = true,

View file

@ -1404,6 +1404,21 @@ anv_shader_lower_nir(struct anv_device *device,
nir->info.cs.has_cooperative_matrix) {
anv_fixup_subgroup_size(device, nir);
NIR_PASS(_, nir, brw_nir_lower_cmat, nir->info.api_subgroup_size);
/* Lowering of nir_instr_type_cmat_call will produce new
* nir_instr_type_call instructions that need to be inlined.
*/
bool inlined = false;
NIR_PASS(_, nir, nir_opt_dce);
NIR_PASS(inlined, nir, nir_inline_functions);
nir_remove_non_entrypoints(nir);
if (inlined) {
NIR_PASS(_, nir, nir_opt_copy_prop_vars);
NIR_PASS(_, nir, nir_opt_copy_prop);
}
NIR_PASS(_, nir, nir_opt_deref);
NIR_PASS(_, nir, nir_opt_dce);
NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees,
nir_var_function_temp, 16);
}