mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 22:00:26 +01:00
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:
parent
8c4225b99b
commit
bdd2c7b9f2
2 changed files with 23 additions and 0 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue