mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 03:10:06 +00:00
Begin work on matrix type
This commit is contained in:
@@ -162,6 +162,13 @@ Type_Info_Relative_Slice :: struct {
|
||||
slice: ^Type_Info,
|
||||
base_integer: ^Type_Info,
|
||||
}
|
||||
Type_Info_Matrix :: struct {
|
||||
elem: ^Type_Info,
|
||||
elem_size: int,
|
||||
stride: int, // bytes
|
||||
row_count: int,
|
||||
column_count: int,
|
||||
}
|
||||
|
||||
Type_Info_Flag :: enum u8 {
|
||||
Comparable = 0,
|
||||
@@ -202,6 +209,7 @@ Type_Info :: struct {
|
||||
Type_Info_Simd_Vector,
|
||||
Type_Info_Relative_Pointer,
|
||||
Type_Info_Relative_Slice,
|
||||
Type_Info_Matrix,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -233,6 +241,7 @@ Typeid_Kind :: enum u8 {
|
||||
Simd_Vector,
|
||||
Relative_Pointer,
|
||||
Relative_Slice,
|
||||
Matrix,
|
||||
}
|
||||
#assert(len(Typeid_Kind) < 32)
|
||||
|
||||
|
||||
@@ -370,5 +370,13 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
|
||||
print_type(info.base_integer)
|
||||
print_string(") ")
|
||||
print_type(info.slice)
|
||||
|
||||
case Type_Info_Matrix:
|
||||
print_string("[")
|
||||
print_u64(u64(info.row_count))
|
||||
print_string("; ")
|
||||
print_u64(u64(info.column_count))
|
||||
print_string("]")
|
||||
print_type(info.elem)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user