Skip to content

Commit 02f11df

Browse files
committed
Merge branch 'master' of github.com:odin-lang/Odin
2 parents 303d86a + 50374d9 commit 02f11df

File tree

6 files changed

+1224
-1209
lines changed

6 files changed

+1224
-1209
lines changed

base/runtime/core.odin

+9
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,15 @@ Raw_Soa_Pointer :: struct {
470470
index: int,
471471
}
472472

473+
Raw_Complex32 :: struct {real, imag: f16}
474+
Raw_Complex64 :: struct {real, imag: f32}
475+
Raw_Complex128 :: struct {real, imag: f64}
476+
Raw_Quaternion64 :: struct {imag, jmag, kmag: f16, real: f16}
477+
Raw_Quaternion128 :: struct {imag, jmag, kmag: f32, real: f32}
478+
Raw_Quaternion256 :: struct {imag, jmag, kmag: f64, real: f64}
479+
Raw_Quaternion64_Vector_Scalar :: struct {vector: [3]f16, scalar: f16}
480+
Raw_Quaternion128_Vector_Scalar :: struct {vector: [3]f32, scalar: f32}
481+
Raw_Quaternion256_Vector_Scalar :: struct {vector: [3]f64, scalar: f64}
473482

474483

475484
/*

core/math/linalg/general.odin

+10-15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package linalg
33
import "core:math"
44
import "base:builtin"
55
import "base:intrinsics"
6+
import "base:runtime"
67

78
// Generic
89

@@ -223,33 +224,27 @@ quaternion_mul_quaternion :: proc "contextless" (q1, q2: $Q) -> Q where IS_QUATE
223224

224225
@(require_results)
225226
quaternion64_mul_vector3 :: proc "contextless" (q: $Q/quaternion64, v: $V/[3]$F/f16) -> V {
226-
Raw_Quaternion :: struct {xyz: [3]f16, r: f16}
227-
228-
q := transmute(Raw_Quaternion)q
227+
q := transmute(runtime.Raw_Quaternion64_Vector_Scalar)q
229228
v := v
230229

231-
t := cross(2*q.xyz, v)
232-
return V(v + q.r*t + cross(q.xyz, t))
230+
t := cross(2*q.vector, v)
231+
return V(v + q.scalar*t + cross(q.vector, t))
233232
}
234233
@(require_results)
235234
quaternion128_mul_vector3 :: proc "contextless" (q: $Q/quaternion128, v: $V/[3]$F/f32) -> V {
236-
Raw_Quaternion :: struct {xyz: [3]f32, r: f32}
237-
238-
q := transmute(Raw_Quaternion)q
235+
q := transmute(runtime.Raw_Quaternion128_Vector_Scalar)q
239236
v := v
240237

241-
t := cross(2*q.xyz, v)
242-
return V(v + q.r*t + cross(q.xyz, t))
238+
t := cross(2*q.vector, v)
239+
return V(v + q.scalar*t + cross(q.vector, t))
243240
}
244241
@(require_results)
245242
quaternion256_mul_vector3 :: proc "contextless" (q: $Q/quaternion256, v: $V/[3]$F/f64) -> V {
246-
Raw_Quaternion :: struct {xyz: [3]f64, r: f64}
247-
248-
q := transmute(Raw_Quaternion)q
243+
q := transmute(runtime.Raw_Quaternion256_Vector_Scalar)q
249244
v := v
250245

251-
t := cross(2*q.xyz, v)
252-
return V(v + q.r*t + cross(q.xyz, t))
246+
t := cross(2*q.vector, v)
247+
return V(v + q.scalar*t + cross(q.vector, t))
253248
}
254249
quaternion_mul_vector3 :: proc{quaternion64_mul_vector3, quaternion128_mul_vector3, quaternion256_mul_vector3}
255250

core/mem/raw.odin

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ Raw_Dynamic_Array :: runtime.Raw_Dynamic_Array
1111
Raw_Map :: runtime.Raw_Map
1212
Raw_Soa_Pointer :: runtime.Raw_Soa_Pointer
1313

14-
Raw_Complex64 :: struct {real, imag: f32}
15-
Raw_Complex128 :: struct {real, imag: f64}
16-
Raw_Quaternion128 :: struct {imag, jmag, kmag: f32, real: f32}
17-
Raw_Quaternion256 :: struct {imag, jmag, kmag: f64, real: f64}
18-
Raw_Quaternion128_Vector_Scalar :: struct {vector: [3]f32, scalar: f32}
19-
Raw_Quaternion256_Vector_Scalar :: struct {vector: [3]f64, scalar: f64}
14+
Raw_Complex32 :: runtime.Raw_Complex32
15+
Raw_Complex64 :: runtime.Raw_Complex64
16+
Raw_Complex128 :: runtime.Raw_Complex128
17+
Raw_Quaternion64 :: runtime.Raw_Quaternion64
18+
Raw_Quaternion128 :: runtime.Raw_Quaternion128
19+
Raw_Quaternion256 :: runtime.Raw_Quaternion256
20+
Raw_Quaternion64_Vector_Scalar :: runtime.Raw_Quaternion64_Vector_Scalar
21+
Raw_Quaternion128_Vector_Scalar :: runtime.Raw_Quaternion128_Vector_Scalar
22+
Raw_Quaternion256_Vector_Scalar :: runtime.Raw_Quaternion256_Vector_Scalar
2023

2124
make_any :: proc "contextless" (data: rawptr, id: typeid) -> any {
2225
return transmute(any)Raw_Any{data, id}

core/os/os_darwin.odin

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ F_GETPATH :: 50 // return the full path of the fd
442442
foreign libc {
443443
@(link_name="__error") __error :: proc() -> ^c.int ---
444444

445-
@(link_name="open") _unix_open :: proc(path: cstring, flags: i32, mode: u16) -> Handle ---
445+
@(link_name="open") _unix_open :: proc(path: cstring, flags: i32, #c_vararg args: ..any) -> Handle ---
446446
@(link_name="close") _unix_close :: proc(handle: Handle) -> c.int ---
447447
@(link_name="read") _unix_read :: proc(handle: Handle, buffer: rawptr, count: c.size_t) -> int ---
448448
@(link_name="write") _unix_write :: proc(handle: Handle, buffer: rawptr, count: c.size_t) -> int ---

vendor/egl/egl.odin

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ foreign egl {
4747
GetDisplay :: proc(display: NativeDisplayType) -> Display ---
4848
Initialize :: proc(display: Display, major: ^i32, minor: ^i32) -> i32 ---
4949
BindAPI :: proc(api: u32) -> i32 ---
50-
ChooseConfig :: proc(display: Display, attrib_list: ^i32, configs: ^Context, config_size: i32, num_config: ^i32) -> i32 ---
50+
ChooseConfig :: proc(display: Display, attrib_list: ^i32, configs: ^Config, config_size: i32, num_config: ^i32) -> i32 ---
5151
CreateWindowSurface :: proc(display: Display, config: Config, native_window: NativeWindowType, attrib_list: ^i32) -> Surface ---
5252
CreateContext :: proc(display: Display, config: Config, share_context: Context, attrib_list: ^i32) -> Context ---
5353
MakeCurrent :: proc(display: Display, draw: Surface, read: Surface, ctx: Context) -> i32 ---

0 commit comments

Comments
 (0)