mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge branch 'master' into filename-merge
This commit is contained in:
@@ -39,9 +39,7 @@ jobs:
|
|||||||
make
|
make
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
- name: Odin issues tests
|
- name: Odin issues tests
|
||||||
run: |
|
run: tests/issues/run.sh
|
||||||
cd tests/issues
|
|
||||||
./run.sh
|
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
- name: Odin check examples/all for Linux i386
|
- name: Odin check examples/all for Linux i386
|
||||||
run: ./odin check examples/all -vet -strict-style -target:linux_i386
|
run: ./odin check examples/all -vet -strict-style -target:linux_i386
|
||||||
@@ -93,9 +91,7 @@ jobs:
|
|||||||
make
|
make
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
- name: Odin issues tests
|
- name: Odin issues tests
|
||||||
run: |
|
run: tests/issues/run.sh
|
||||||
cd tests/issues
|
|
||||||
./run.sh
|
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
- name: Odin check examples/all for Darwin arm64
|
- name: Odin check examples/all for Darwin arm64
|
||||||
run: ./odin check examples/all -vet -strict-style -target:darwin_arm64
|
run: ./odin check examples/all -vet -strict-style -target:darwin_arm64
|
||||||
@@ -167,8 +163,7 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
||||||
cd tests\issues
|
call tests\issues\run.bat
|
||||||
call run.bat
|
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
- name: Odin check examples/all for Windows 32bits
|
- name: Odin check examples/all for Windows 32bits
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package util
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
_ :: mem
|
|
||||||
|
|
||||||
// @note(bp): this can replace the other two
|
// @note(bp): this can replace the other two
|
||||||
cast_slice :: #force_inline proc "contextless" ($D: typeid/[]$DE, src: $S/[]$SE) -> D {
|
cast_slice :: #force_inline proc "contextless" ($D: typeid/[]$DE, src: $S/[]$SE) -> D {
|
||||||
|
|||||||
@@ -479,21 +479,21 @@ angle_from_quaternion_f16 :: proc(q: Quaternionf16) -> f16 {
|
|||||||
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
|
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
return math.cos(q.x) * 2
|
return math.acos(q.w) * 2
|
||||||
}
|
}
|
||||||
angle_from_quaternion_f32 :: proc(q: Quaternionf32) -> f32 {
|
angle_from_quaternion_f32 :: proc(q: Quaternionf32) -> f32 {
|
||||||
if abs(q.w) > math.SQRT_THREE*0.5 {
|
if abs(q.w) > math.SQRT_THREE*0.5 {
|
||||||
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
|
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
return math.cos(q.x) * 2
|
return math.acos(q.w) * 2
|
||||||
}
|
}
|
||||||
angle_from_quaternion_f64 :: proc(q: Quaternionf64) -> f64 {
|
angle_from_quaternion_f64 :: proc(q: Quaternionf64) -> f64 {
|
||||||
if abs(q.w) > math.SQRT_THREE*0.5 {
|
if abs(q.w) > math.SQRT_THREE*0.5 {
|
||||||
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
|
return math.asin(q.x*q.x + q.y*q.y + q.z*q.z) * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
return math.cos(q.x) * 2
|
return math.acos(q.w) * 2
|
||||||
}
|
}
|
||||||
angle_from_quaternion :: proc{
|
angle_from_quaternion :: proc{
|
||||||
angle_from_quaternion_f16,
|
angle_from_quaternion_f16,
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ alloc_from_memory_block :: proc(block: ^Memory_Block, min_size, alignment: int)
|
|||||||
do_commit_if_necessary :: proc(block: ^Memory_Block, size: uint) -> (err: Allocator_Error) {
|
do_commit_if_necessary :: proc(block: ^Memory_Block, size: uint) -> (err: Allocator_Error) {
|
||||||
if block.committed - block.used < size {
|
if block.committed - block.used < size {
|
||||||
pmblock := (^Platform_Memory_Block)(block)
|
pmblock := (^Platform_Memory_Block)(block)
|
||||||
base_offset := uint(uintptr(block) - uintptr(pmblock))
|
base_offset := uint(uintptr(pmblock.block.base) - uintptr(pmblock))
|
||||||
platform_total_commit := base_offset + block.used + size
|
platform_total_commit := base_offset + block.used + size
|
||||||
|
|
||||||
assert(pmblock.committed <= pmblock.reserved)
|
assert(pmblock.committed <= pmblock.reserved)
|
||||||
|
|||||||
@@ -626,6 +626,9 @@ with open("../core.odin", 'w', encoding='utf-8') as f:
|
|||||||
f.write(BASE)
|
f.write(BASE)
|
||||||
f.write("""
|
f.write("""
|
||||||
API_VERSION_1_0 :: (1<<22) | (0<<12) | (0)
|
API_VERSION_1_0 :: (1<<22) | (0<<12) | (0)
|
||||||
|
API_VERSION_1_1 :: (1<<22) | (1<<12) | (0)
|
||||||
|
API_VERSION_1_2 :: (1<<22) | (2<<12) | (0)
|
||||||
|
API_VERSION_1_3 :: (1<<22) | (3<<12) | (0)
|
||||||
|
|
||||||
MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
|
MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
|
||||||
return (major<<22) | (minor<<12) | (patch)
|
return (major<<22) | (minor<<12) | (patch)
|
||||||
|
|||||||
Vendored
+3
@@ -3,6 +3,9 @@
|
|||||||
//
|
//
|
||||||
package vulkan
|
package vulkan
|
||||||
API_VERSION_1_0 :: (1<<22) | (0<<12) | (0)
|
API_VERSION_1_0 :: (1<<22) | (0<<12) | (0)
|
||||||
|
API_VERSION_1_1 :: (1<<22) | (1<<12) | (0)
|
||||||
|
API_VERSION_1_2 :: (1<<22) | (2<<12) | (0)
|
||||||
|
API_VERSION_1_3 :: (1<<22) | (3<<12) | (0)
|
||||||
|
|
||||||
MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
|
MAKE_VERSION :: proc(major, minor, patch: u32) -> u32 {
|
||||||
return (major<<22) | (minor<<12) | (patch)
|
return (major<<22) | (minor<<12) | (patch)
|
||||||
|
|||||||
Reference in New Issue
Block a user