mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-14 14:23:43 +00:00
Just change the type when transposing #row_major to #column_major matrix types
This commit is contained in:
@@ -819,6 +819,13 @@ gb_internal lbValue lb_emit_matrix_transpose(lbProcedure *p, lbValue m, Type *ty
|
||||
|
||||
Type *rt = base_type(type);
|
||||
if (rt->kind == Type_Matrix && rt->Matrix.is_row_major != mt->Matrix.is_row_major) {
|
||||
if (rt->Matrix.row_count == mt->Matrix.column_count &&
|
||||
rt->Matrix.column_count == mt->Matrix.row_count) {
|
||||
lbValue res = m;
|
||||
res.type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
GB_PANIC("TODO: transpose with changing layout");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user