Remove distinct from core:math/linalg/(glsl|hlsl) types

This commit is contained in:
gingerBill
2024-09-18 00:13:34 +01:00
parent 6ef779cd5c
commit e17dfcf7a2
2 changed files with 99 additions and 99 deletions

View File

@@ -22,9 +22,9 @@ F32_EPSILON :: 1e-7
F64_EPSILON :: 1e-15
// Odin matrices are stored internally as Column-Major, which matches OpenGL/GLSL by default
mat2 :: distinct matrix[2, 2]f32
mat3 :: distinct matrix[3, 3]f32
mat4 :: distinct matrix[4, 4]f32
mat2 :: matrix[2, 2]f32
mat3 :: matrix[3, 3]f32
mat4 :: matrix[4, 4]f32
mat2x2 :: mat2
mat3x3 :: mat3
mat4x4 :: mat4
@@ -33,52 +33,52 @@ mat4x4 :: mat4
// but they match how GLSL and OpenGL defines them in name
// Odin: matrix[R, C]f32
// GLSL: matCxR
mat3x2 :: distinct matrix[2, 3]f32
mat4x2 :: distinct matrix[2, 4]f32
mat2x3 :: distinct matrix[3, 2]f32
mat4x3 :: distinct matrix[3, 4]f32
mat2x4 :: distinct matrix[4, 2]f32
mat3x4 :: distinct matrix[4, 3]f32
mat3x2 :: matrix[2, 3]f32
mat4x2 :: matrix[2, 4]f32
mat2x3 :: matrix[3, 2]f32
mat4x3 :: matrix[3, 4]f32
mat2x4 :: matrix[4, 2]f32
mat3x4 :: matrix[4, 3]f32
vec2 :: distinct [2]f32
vec3 :: distinct [3]f32
vec4 :: distinct [4]f32
vec2 :: [2]f32
vec3 :: [3]f32
vec4 :: [4]f32
ivec2 :: distinct [2]i32
ivec3 :: distinct [3]i32
ivec4 :: distinct [4]i32
ivec2 :: [2]i32
ivec3 :: [3]i32
ivec4 :: [4]i32
uvec2 :: distinct [2]u32
uvec3 :: distinct [3]u32
uvec4 :: distinct [4]u32
uvec2 :: [2]u32
uvec3 :: [3]u32
uvec4 :: [4]u32
bvec2 :: distinct [2]bool
bvec3 :: distinct [3]bool
bvec4 :: distinct [4]bool
bvec2 :: [2]bool
bvec3 :: [3]bool
bvec4 :: [4]bool
quat :: distinct quaternion128
quat :: quaternion128
// Double Precision (f64) Floating Point Types
dmat2 :: distinct matrix[2, 2]f64
dmat3 :: distinct matrix[3, 3]f64
dmat4 :: distinct matrix[4, 4]f64
dmat2 :: matrix[2, 2]f64
dmat3 :: matrix[3, 3]f64
dmat4 :: matrix[4, 4]f64
dmat2x2 :: dmat2
dmat3x3 :: dmat3
dmat4x4 :: dmat4
dmat3x2 :: distinct matrix[2, 3]f64
dmat4x2 :: distinct matrix[2, 4]f64
dmat2x3 :: distinct matrix[3, 2]f64
dmat4x3 :: distinct matrix[3, 4]f64
dmat2x4 :: distinct matrix[4, 2]f64
dmat3x4 :: distinct matrix[4, 3]f64
dmat3x2 :: matrix[2, 3]f64
dmat4x2 :: matrix[2, 4]f64
dmat2x3 :: matrix[3, 2]f64
dmat4x3 :: matrix[3, 4]f64
dmat2x4 :: matrix[4, 2]f64
dmat3x4 :: matrix[4, 3]f64
dvec2 :: distinct [2]f64
dvec3 :: distinct [3]f64
dvec4 :: distinct [4]f64
dvec2 :: [2]f64
dvec3 :: [3]f64
dvec4 :: [4]f64
dquat :: distinct quaternion256
dquat :: quaternion256
cos :: proc{
cos_f32,

View File

@@ -21,89 +21,89 @@ LN10 :: 2.30258509299404568401799145468436421
FLOAT_EPSILON :: 1e-7
DOUBLE_EPSILON :: 1e-15
// Aliases (not distinct) of types
// Aliases (not distict) of types
float :: f32
double :: f64
int :: builtin.i32
uint :: builtin.u32
// Odin matrices are stored internally as Column-Major, which matches the internal layout of HLSL by default
float1x1 :: distinct matrix[1, 1]float
float2x2 :: distinct matrix[2, 2]float
float3x3 :: distinct matrix[3, 3]float
float4x4 :: distinct matrix[4, 4]float
float1x1 :: matrix[1, 1]float
float2x2 :: matrix[2, 2]float
float3x3 :: matrix[3, 3]float
float4x4 :: matrix[4, 4]float
float1x2 :: distinct matrix[1, 2]float
float1x3 :: distinct matrix[1, 3]float
float1x4 :: distinct matrix[1, 4]float
float2x1 :: distinct matrix[2, 1]float
float2x3 :: distinct matrix[2, 3]float
float2x4 :: distinct matrix[2, 4]float
float3x1 :: distinct matrix[3, 1]float
float3x2 :: distinct matrix[3, 2]float
float3x4 :: distinct matrix[3, 4]float
float4x1 :: distinct matrix[4, 1]float
float4x2 :: distinct matrix[4, 2]float
float4x3 :: distinct matrix[4, 3]float
float1x2 :: matrix[1, 2]float
float1x3 :: matrix[1, 3]float
float1x4 :: matrix[1, 4]float
float2x1 :: matrix[2, 1]float
float2x3 :: matrix[2, 3]float
float2x4 :: matrix[2, 4]float
float3x1 :: matrix[3, 1]float
float3x2 :: matrix[3, 2]float
float3x4 :: matrix[3, 4]float
float4x1 :: matrix[4, 1]float
float4x2 :: matrix[4, 2]float
float4x3 :: matrix[4, 3]float
float2 :: distinct [2]float
float3 :: distinct [3]float
float4 :: distinct [4]float
float2 :: [2]float
float3 :: [3]float
float4 :: [4]float
int2 :: distinct [2]int
int3 :: distinct [3]int
int4 :: distinct [4]int
int2 :: [2]int
int3 :: [3]int
int4 :: [4]int
uint2 :: distinct [2]uint
uint3 :: distinct [3]uint
uint4 :: distinct [4]uint
uint2 :: [2]uint
uint3 :: [3]uint
uint4 :: [4]uint
bool2 :: distinct [2]bool
bool3 :: distinct [3]bool
bool4 :: distinct [4]bool
bool2 :: [2]bool
bool3 :: [3]bool
bool4 :: [4]bool
// Double Precision (double) Floating Point Types
double1x1 :: distinct matrix[1, 1]double
double2x2 :: distinct matrix[2, 2]double
double3x3 :: distinct matrix[3, 3]double
double4x4 :: distinct matrix[4, 4]double
double1x1 :: matrix[1, 1]double
double2x2 :: matrix[2, 2]double
double3x3 :: matrix[3, 3]double
double4x4 :: matrix[4, 4]double
double1x2 :: distinct matrix[1, 2]double
double1x3 :: distinct matrix[1, 3]double
double1x4 :: distinct matrix[1, 4]double
double2x1 :: distinct matrix[2, 1]double
double2x3 :: distinct matrix[2, 3]double
double2x4 :: distinct matrix[2, 4]double
double3x1 :: distinct matrix[3, 1]double
double3x2 :: distinct matrix[3, 2]double
double3x4 :: distinct matrix[3, 4]double
double4x1 :: distinct matrix[4, 1]double
double4x2 :: distinct matrix[4, 2]double
double4x3 :: distinct matrix[4, 3]double
double1x2 :: matrix[1, 2]double
double1x3 :: matrix[1, 3]double
double1x4 :: matrix[1, 4]double
double2x1 :: matrix[2, 1]double
double2x3 :: matrix[2, 3]double
double2x4 :: matrix[2, 4]double
double3x1 :: matrix[3, 1]double
double3x2 :: matrix[3, 2]double
double3x4 :: matrix[3, 4]double
double4x1 :: matrix[4, 1]double
double4x2 :: matrix[4, 2]double
double4x3 :: matrix[4, 3]double
double2 :: distinct [2]double
double3 :: distinct [3]double
double4 :: distinct [4]double
double2 :: [2]double
double3 :: [3]double
double4 :: [4]double
int1x1 :: distinct matrix[1, 1]int
int2x2 :: distinct matrix[2, 2]int
int3x3 :: distinct matrix[3, 3]int
int4x4 :: distinct matrix[4, 4]int
int1x1 :: matrix[1, 1]int
int2x2 :: matrix[2, 2]int
int3x3 :: matrix[3, 3]int
int4x4 :: matrix[4, 4]int
int1x2 :: distinct matrix[1, 2]int
int1x3 :: distinct matrix[1, 3]int
int1x4 :: distinct matrix[1, 4]int
int2x1 :: distinct matrix[2, 1]int
int2x3 :: distinct matrix[2, 3]int
int2x4 :: distinct matrix[2, 4]int
int3x1 :: distinct matrix[3, 1]int
int3x2 :: distinct matrix[3, 2]int
int3x4 :: distinct matrix[3, 4]int
int4x1 :: distinct matrix[4, 1]int
int4x2 :: distinct matrix[4, 2]int
int4x3 :: distinct matrix[4, 3]int
int1x2 :: matrix[1, 2]int
int1x3 :: matrix[1, 3]int
int1x4 :: matrix[1, 4]int
int2x1 :: matrix[2, 1]int
int2x3 :: matrix[2, 3]int
int2x4 :: matrix[2, 4]int
int3x1 :: matrix[3, 1]int
int3x2 :: matrix[3, 2]int
int3x4 :: matrix[3, 4]int
int4x1 :: matrix[4, 1]int
int4x2 :: matrix[4, 2]int
int4x3 :: matrix[4, 3]int
cos :: proc{
cos_float,