spirv: implement CooperativeMatrixConversionsNV
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34793>
This commit is contained in:
@@ -68,6 +68,7 @@ static const struct spirv_capabilities implemented_capabilities = {
|
||||
.ComputeDerivativeGroupLinearKHR = true,
|
||||
.ComputeDerivativeGroupQuadsKHR = true,
|
||||
.CooperativeMatrixKHR = true,
|
||||
.CooperativeMatrixConversionsNV = true,
|
||||
.CullDistance = true,
|
||||
.DemoteToHelperInvocation = true,
|
||||
.DenormFlushToZero = true,
|
||||
@@ -6862,6 +6863,8 @@ vtn_handle_body_instruction(struct vtn_builder *b, SpvOp opcode,
|
||||
case SpvOpCooperativeMatrixStoreKHR:
|
||||
case SpvOpCooperativeMatrixLengthKHR:
|
||||
case SpvOpCooperativeMatrixMulAddKHR:
|
||||
case SpvOpCooperativeMatrixConvertNV:
|
||||
case SpvOpCooperativeMatrixTransposeNV:
|
||||
vtn_handle_cooperative_instruction(b, opcode, w, count);
|
||||
break;
|
||||
|
||||
|
||||
@@ -179,6 +179,26 @@ vtn_handle_cooperative_instruction(struct vtn_builder *b, SpvOp opcode,
|
||||
break;
|
||||
}
|
||||
|
||||
case SpvOpCooperativeMatrixConvertNV: {
|
||||
struct vtn_type *dst_type = vtn_get_type(b, w[1]);
|
||||
nir_deref_instr *src = vtn_get_cmat_deref(b, w[3]);
|
||||
|
||||
nir_deref_instr *dst = vtn_create_cmat_temporary(b, dst_type->type, "cmat_convert_nv");
|
||||
nir_cmat_convert(&b->nb, &dst->def, &src->def);
|
||||
vtn_push_var_ssa(b, w[2], dst->var);
|
||||
break;
|
||||
}
|
||||
|
||||
case SpvOpCooperativeMatrixTransposeNV: {
|
||||
struct vtn_type *dst_type = vtn_get_type(b, w[1]);
|
||||
nir_deref_instr *src = vtn_get_cmat_deref(b, w[3]);
|
||||
|
||||
nir_deref_instr *dst = vtn_create_cmat_temporary(b, dst_type->type, "cmat_transpose_nv");
|
||||
nir_cmat_transpose(&b->nb, &dst->def, &src->def);
|
||||
vtn_push_var_ssa(b, w[2], dst->var);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
unreachable("Unexpected opcode for cooperative matrix instruction");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user