Mercurial > games > semicongine
annotate semiconginev2/old/core/dynamic_arrays.nim @ 1239:69489a678141
add: better syncing, better swapchain access, correct font offset, two font-rendering tests
author | sam <sam@basx.dev> |
---|---|
date | Mon, 22 Jul 2024 00:46:10 +0700 |
parents | 56781cc0fc7c |
children |
rev | line source |
---|---|
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
1 import std/hashes |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
2 import std/tables |
868
252cbc10b25f
did: improve/refactor some of the material API
Sam <sam@basx.dev>
parents:
840
diff
changeset
|
3 import std/strformat |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
4 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
5 import ./gpu_types |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
6 import ./vector |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
7 import ./matrix |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
8 import ./utils |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
9 import ./imagetypes |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
10 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
11 type |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
12 DataList* = object |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
13 len*: int |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
14 case theType*: DataType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
15 of Float32: float32: ref seq[float32] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
16 of Float64: float64: ref seq[float64] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
17 of Int8: int8: ref seq[int8] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
18 of Int16: int16: ref seq[int16] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
19 of Int32: int32: ref seq[int32] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
20 of Int64: int64: ref seq[int64] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
21 of UInt8: uint8: ref seq[uint8] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
22 of UInt16: uint16: ref seq[uint16] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
23 of UInt32: uint32: ref seq[uint32] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
24 of UInt64: uint64: ref seq[uint64] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
25 of Vec2I32: vec2i32: ref seq[TVec2[int32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
26 of Vec2I64: vec2i64: ref seq[TVec2[int64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
27 of Vec3I32: vec3i32: ref seq[TVec3[int32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
28 of Vec3I64: vec3i64: ref seq[TVec3[int64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
29 of Vec4I32: vec4i32: ref seq[TVec4[int32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
30 of Vec4I64: vec4i64: ref seq[TVec4[int64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
31 of Vec2U32: vec2u32: ref seq[TVec2[uint32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
32 of Vec2U64: vec2u64: ref seq[TVec2[uint64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
33 of Vec3U32: vec3u32: ref seq[TVec3[uint32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
34 of Vec3U64: vec3u64: ref seq[TVec3[uint64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
35 of Vec4U32: vec4u32: ref seq[TVec4[uint32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
36 of Vec4U64: vec4u64: ref seq[TVec4[uint64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
37 of Vec2F32: vec2f32: ref seq[TVec2[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
38 of Vec2F64: vec2f64: ref seq[TVec2[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
39 of Vec3F32: vec3f32: ref seq[TVec3[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
40 of Vec3F64: vec3f64: ref seq[TVec3[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
41 of Vec4F32: vec4f32: ref seq[TVec4[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
42 of Vec4F64: vec4f64: ref seq[TVec4[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
43 of Mat2F32: mat2f32: ref seq[TMat2[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
44 of Mat2F64: mat2f64: ref seq[TMat2[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
45 of Mat23F32: mat23f32: ref seq[TMat23[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
46 of Mat23F64: mat23f64: ref seq[TMat23[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
47 of Mat32F32: mat32f32: ref seq[TMat32[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
48 of Mat32F64: mat32f64: ref seq[TMat32[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
49 of Mat3F32: mat3f32: ref seq[TMat3[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
50 of Mat3F64: mat3f64: ref seq[TMat3[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
51 of Mat34F32: mat34f32: ref seq[TMat34[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
52 of Mat34F64: mat34f64: ref seq[TMat34[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
53 of Mat43F32: mat43f32: ref seq[TMat43[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
54 of Mat43F64: mat43f64: ref seq[TMat43[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
55 of Mat4F32: mat4f32: ref seq[TMat4[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
56 of Mat4F64: mat4f64: ref seq[TMat4[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
57 of TextureType: texture: ref seq[Texture] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
58 |
1137 | 59 func Size*(value: DataList): uint64 = |
60 value.theType.Size * value.len.uint64 | |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
61 |
1138 | 62 func hash*(value: DataList): Hash = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
63 case value.theType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
64 of Float32: hash(value.float32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
65 of Float64: hash(value.float64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
66 of Int8: hash(value.int8) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
67 of Int16: hash(value.int16) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
68 of Int32: hash(value.int32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
69 of Int64: hash(value.int64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
70 of UInt8: hash(value.uint8) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
71 of UInt16: hash(value.uint16) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
72 of UInt32: hash(value.uint32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
73 of UInt64: hash(value.uint64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
74 of Vec2I32: hash(value.vec2i32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
75 of Vec2I64: hash(value.vec2i64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
76 of Vec3I32: hash(value.vec3i32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
77 of Vec3I64: hash(value.vec3i64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
78 of Vec4I32: hash(value.vec4i32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
79 of Vec4I64: hash(value.vec4i64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
80 of Vec2U32: hash(value.vec2u32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
81 of Vec2U64: hash(value.vec2u64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
82 of Vec3U32: hash(value.vec3u32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
83 of Vec3U64: hash(value.vec3u64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
84 of Vec4U32: hash(value.vec4u32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
85 of Vec4U64: hash(value.vec4u64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
86 of Vec2F32: hash(value.vec2f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
87 of Vec2F64: hash(value.vec2f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
88 of Vec3F32: hash(value.vec3f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
89 of Vec3F64: hash(value.vec3f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
90 of Vec4F32: hash(value.vec4f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
91 of Vec4F64: hash(value.vec4f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
92 of Mat2F32: hash(value.mat2f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
93 of Mat2F64: hash(value.mat2f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
94 of Mat23F32: hash(value.mat23f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
95 of Mat23F64: hash(value.mat23f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
96 of Mat32F32: hash(value.mat32f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
97 of Mat32F64: hash(value.mat32f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
98 of Mat3F32: hash(value.mat3f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
99 of Mat3F64: hash(value.mat3f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
100 of Mat34F32: hash(value.mat34f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
101 of Mat34F64: hash(value.mat34f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
102 of Mat43F32: hash(value.mat43f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
103 of Mat43F64: hash(value.mat43f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
104 of Mat4F32: hash(value.mat4f32) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
105 of Mat4F64: hash(value.mat4f64) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
106 of TextureType: hash(value.texture) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
107 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
108 func `==`*(a, b: DataList): bool = |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
109 if a.theType != b.theType: |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
110 return false |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
111 case a.theType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
112 of Float32: return a.float32 == b.float32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
113 of Float64: return a.float64 == b.float64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
114 of Int8: return a.int8 == b.int8 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
115 of Int16: return a.int16 == b.int16 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
116 of Int32: return a.int32 == b.int32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
117 of Int64: return a.int64 == b.int64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
118 of UInt8: return a.uint8 == b.uint8 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
119 of UInt16: return a.uint16 == b.uint16 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
120 of UInt32: return a.uint32 == b.uint32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
121 of UInt64: return a.uint64 == b.uint64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
122 of Vec2I32: return a.vec2i32 == b.vec2i32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
123 of Vec2I64: return a.vec2i64 == b.vec2i64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
124 of Vec3I32: return a.vec3i32 == b.vec3i32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
125 of Vec3I64: return a.vec3i64 == b.vec3i64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
126 of Vec4I32: return a.vec4i32 == b.vec4i32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
127 of Vec4I64: return a.vec4i64 == b.vec4i64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
128 of Vec2U32: return a.vec2u32 == b.vec2u32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
129 of Vec2U64: return a.vec2u64 == b.vec2u64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
130 of Vec3U32: return a.vec3u32 == b.vec3u32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
131 of Vec3U64: return a.vec3u64 == b.vec3u64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
132 of Vec4U32: return a.vec4u32 == b.vec4u32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
133 of Vec4U64: return a.vec4u64 == b.vec4u64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
134 of Vec2F32: return a.vec2f32 == b.vec2f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
135 of Vec2F64: return a.vec2f64 == b.vec2f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
136 of Vec3F32: return a.vec3f32 == b.vec3f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
137 of Vec3F64: return a.vec3f64 == b.vec3f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
138 of Vec4F32: return a.vec4f32 == b.vec4f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
139 of Vec4F64: return a.vec4f64 == b.vec4f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
140 of Mat2F32: return a.mat2f32 == b.mat2f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
141 of Mat2F64: return a.mat2f64 == b.mat2f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
142 of Mat23F32: return a.mat23f32 == b.mat23f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
143 of Mat23F64: return a.mat23f64 == b.mat23f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
144 of Mat32F32: return a.mat32f32 == b.mat32f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
145 of Mat32F64: return a.mat32f64 == b.mat32f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
146 of Mat3F32: return a.mat3f32 == b.mat3f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
147 of Mat3F64: return a.mat3f64 == b.mat3f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
148 of Mat34F32: return a.mat34f32 == b.mat34f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
149 of Mat34F64: return a.mat34f64 == b.mat34f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
150 of Mat43F32: return a.mat43f32 == b.mat43f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
151 of Mat43F64: return a.mat43f64 == b.mat43f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
152 of Mat4F32: return a.mat4f32 == b.mat4f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
153 of Mat4F64: return a.mat4f64 == b.mat4f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
154 of TextureType: a.texture == b.texture |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
155 |
1137 | 156 proc SetLen*(value: var DataList, len: int) = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
157 value.len = len |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
158 case value.theType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
159 of Float32: value.float32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
160 of Float64: value.float64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
161 of Int8: value.int8[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
162 of Int16: value.int16[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
163 of Int32: value.int32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
164 of Int64: value.int64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
165 of UInt8: value.uint8[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
166 of UInt16: value.uint16[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
167 of UInt32: value.uint32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
168 of UInt64: value.uint64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
169 of Vec2I32: value.vec2i32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
170 of Vec2I64: value.vec2i64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
171 of Vec3I32: value.vec3i32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
172 of Vec3I64: value.vec3i64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
173 of Vec4I32: value.vec4i32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
174 of Vec4I64: value.vec4i64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
175 of Vec2U32: value.vec2u32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
176 of Vec2U64: value.vec2u64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
177 of Vec3U32: value.vec3u32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
178 of Vec3U64: value.vec3u64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
179 of Vec4U32: value.vec4u32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
180 of Vec4U64: value.vec4u64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
181 of Vec2F32: value.vec2f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
182 of Vec2F64: value.vec2f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
183 of Vec3F32: value.vec3f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
184 of Vec3F64: value.vec3f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
185 of Vec4F32: value.vec4f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
186 of Vec4F64: value.vec4f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
187 of Mat2F32: value.mat2f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
188 of Mat2F64: value.mat2f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
189 of Mat23F32: value.mat23f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
190 of Mat23F64: value.mat23f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
191 of Mat32F32: value.mat32f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
192 of Mat32F64: value.mat32f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
193 of Mat3F32: value.mat3f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
194 of Mat3F64: value.mat3f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
195 of Mat34F32: value.mat34f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
196 of Mat34F64: value.mat34f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
197 of Mat43F32: value.mat43f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
198 of Mat43F64: value.mat43f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
199 of Mat4F32: value.mat4f32[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
200 of Mat4F64: value.mat4f64[].setLen(len) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
201 of TextureType: discard |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
202 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
203 |
904
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
204 proc setValues[T: GPUType|int|uint|float](value: var DataList, data: openArray[T]) = |
1137 | 205 value.SetLen(data.len) |
904
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
206 when T is float32: value.float32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
207 elif T is float64: value.float64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
208 elif T is int8: value.int8[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
209 elif T is int16: value.int16[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
210 elif T is int32: value.int32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
211 elif T is int64: value.int64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
212 elif T is uint8: value.uint8[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
213 elif T is uint16: value.uint16[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
214 elif T is uint32: value.uint32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
215 elif T is uint64: value.uint64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
216 elif T is int and sizeof(int) == sizeof(int32): value.int32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
217 elif T is int and sizeof(int) == sizeof(int64): value.int64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
218 elif T is uint and sizeof(uint) == sizeof(uint32): value.uint32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
219 elif T is uint and sizeof(uint) == sizeof(uint64): value.uint64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
220 elif T is float and sizeof(float) == sizeof(float32): value.float32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
221 elif T is float and sizeof(float) == sizeof(float64): value.float64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
222 elif T is TVec2[int32]: value.vec2i32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
223 elif T is TVec2[int64]: value.vec2i64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
224 elif T is TVec3[int32]: value.vec3i32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
225 elif T is TVec3[int64]: value.vec3i64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
226 elif T is TVec4[int32]: value.vec4i32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
227 elif T is TVec4[int64]: value.vec4i64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
228 elif T is TVec2[uint32]: value.vec2u32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
229 elif T is TVec2[uint64]: value.vec2u64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
230 elif T is TVec3[uint32]: value.vec3u32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
231 elif T is TVec3[uint64]: value.vec3u64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
232 elif T is TVec4[uint32]: value.vec4u32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
233 elif T is TVec4[uint64]: value.vec4u64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
234 elif T is TVec2[float32]: value.vec2f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
235 elif T is TVec2[float64]: value.vec2f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
236 elif T is TVec3[float32]: value.vec3f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
237 elif T is TVec3[float64]: value.vec3f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
238 elif T is TVec4[float32]: value.vec4f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
239 elif T is TVec4[float64]: value.vec4f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
240 elif T is TMat2[float32]: value.mat2f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
241 elif T is TMat2[float64]: value.mat2f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
242 elif T is TMat23[float32]: value.mat23f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
243 elif T is TMat23[float64]: value.mat23f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
244 elif T is TMat32[float32]: value.mat32f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
245 elif T is TMat32[float64]: value.mat32f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
246 elif T is TMat3[float32]: value.mat3f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
247 elif T is TMat3[float64]: value.mat3f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
248 elif T is TMat34[float32]: value.mat34f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
249 elif T is TMat34[float64]: value.mat34f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
250 elif T is TMat43[float32]: value.mat43f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
251 elif T is TMat43[float64]: value.mat43f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
252 elif T is TMat4[float32]: value.mat4f32[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
253 elif T is TMat4[float64]: value.mat4f64[] = @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
254 elif T is Texture: value.texture[] = @data |
902 | 255 else: {.error: "Virtual datatype has no values".} |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
256 |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
257 proc setValue[T: GPUType|int|uint|float](value: var DataList, i: int, data: T) = |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
258 assert i < value.len |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
259 when T is float32: value.float32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
260 elif T is float64: value.float64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
261 elif T is int8: value.int8[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
262 elif T is int16: value.int16[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
263 elif T is int32: value.int32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
264 elif T is int64: value.int64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
265 elif T is uint8: value.uint8[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
266 elif T is uint16: value.uint16[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
267 elif T is uint32: value.uint32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
268 elif T is uint64: value.uint64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
269 elif T is int and sizeof(int) == sizeof(int32): value.int32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
270 elif T is int and sizeof(int) == sizeof(int64): value.int64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
271 elif T is uint and sizeof(uint) == sizeof(uint32): value.uint32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
272 elif T is uint and sizeof(uint) == sizeof(uint64): value.uint64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
273 elif T is float and sizeof(float) == sizeof(float32): value.float32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
274 elif T is float and sizeof(float) == sizeof(float64): value.float64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
275 elif T is TVec2[int32]: value.vec2i32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
276 elif T is TVec2[int64]: value.vec2i64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
277 elif T is TVec3[int32]: value.vec3i32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
278 elif T is TVec3[int64]: value.vec3i64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
279 elif T is TVec4[int32]: value.vec4i32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
280 elif T is TVec4[int64]: value.vec4i64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
281 elif T is TVec2[uint32]: value.vec2u32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
282 elif T is TVec2[uint64]: value.vec2u64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
283 elif T is TVec3[uint32]: value.vec3u32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
284 elif T is TVec3[uint64]: value.vec3u64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
285 elif T is TVec4[uint32]: value.vec4u32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
286 elif T is TVec4[uint64]: value.vec4u64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
287 elif T is TVec2[float32]: value.vec2f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
288 elif T is TVec2[float64]: value.vec2f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
289 elif T is TVec3[float32]: value.vec3f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
290 elif T is TVec3[float64]: value.vec3f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
291 elif T is TVec4[float32]: value.vec4f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
292 elif T is TVec4[float64]: value.vec4f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
293 elif T is TMat2[float32]: value.mat2f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
294 elif T is TMat2[float64]: value.mat2f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
295 elif T is TMat23[float32]: value.mat23f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
296 elif T is TMat23[float64]: value.mat23f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
297 elif T is TMat32[float32]: value.mat32f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
298 elif T is TMat32[float64]: value.mat32f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
299 elif T is TMat3[float32]: value.mat3f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
300 elif T is TMat3[float64]: value.mat3f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
301 elif T is TMat34[float32]: value.mat34f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
302 elif T is TMat34[float64]: value.mat34f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
303 elif T is TMat43[float32]: value.mat43f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
304 elif T is TMat43[float64]: value.mat43f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
305 elif T is TMat4[float32]: value.mat4f32[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
306 elif T is TMat4[float64]: value.mat4f64[i] = data |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
307 elif T is Texture: value.texture[i] = data |
902 | 308 else: {.error: "Virtual datatype has no values".} |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
309 |
1137 | 310 proc InitDataList*(theType: DataType, len = 0): DataList = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
311 result = DataList(theType: theType) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
312 case result.theType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
313 of Float32: result.float32 = new seq[float32] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
314 of Float64: result.float64 = new seq[float64] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
315 of Int8: result.int8 = new seq[int8] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
316 of Int16: result.int16 = new seq[int16] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
317 of Int32: result.int32 = new seq[int32] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
318 of Int64: result.int64 = new seq[int64] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
319 of UInt8: result.uint8 = new seq[uint8] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
320 of UInt16: result.uint16 = new seq[uint16] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
321 of UInt32: result.uint32 = new seq[uint32] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
322 of UInt64: result.uint64 = new seq[uint64] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
323 of Vec2I32: result.vec2i32 = new seq[TVec2[int32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
324 of Vec2I64: result.vec2i64 = new seq[TVec2[int64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
325 of Vec3I32: result.vec3i32 = new seq[TVec3[int32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
326 of Vec3I64: result.vec3i64 = new seq[TVec3[int64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
327 of Vec4I32: result.vec4i32 = new seq[TVec4[int32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
328 of Vec4I64: result.vec4i64 = new seq[TVec4[int64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
329 of Vec2U32: result.vec2u32 = new seq[TVec2[uint32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
330 of Vec2U64: result.vec2u64 = new seq[TVec2[uint64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
331 of Vec3U32: result.vec3u32 = new seq[TVec3[uint32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
332 of Vec3U64: result.vec3u64 = new seq[TVec3[uint64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
333 of Vec4U32: result.vec4u32 = new seq[TVec4[uint32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
334 of Vec4U64: result.vec4u64 = new seq[TVec4[uint64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
335 of Vec2F32: result.vec2f32 = new seq[TVec2[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
336 of Vec2F64: result.vec2f64 = new seq[TVec2[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
337 of Vec3F32: result.vec3f32 = new seq[TVec3[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
338 of Vec3F64: result.vec3f64 = new seq[TVec3[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
339 of Vec4F32: result.vec4f32 = new seq[TVec4[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
340 of Vec4F64: result.vec4f64 = new seq[TVec4[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
341 of Mat2F32: result.mat2f32 = new seq[TMat2[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
342 of Mat2F64: result.mat2f64 = new seq[TMat2[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
343 of Mat23F32: result.mat23f32 = new seq[TMat23[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
344 of Mat23F64: result.mat23f64 = new seq[TMat23[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
345 of Mat32F32: result.mat32f32 = new seq[TMat32[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
346 of Mat32F64: result.mat32f64 = new seq[TMat32[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
347 of Mat3F32: result.mat3f32 = new seq[TMat3[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
348 of Mat3F64: result.mat3f64 = new seq[TMat3[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
349 of Mat34F32: result.mat34f32 = new seq[TMat34[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
350 of Mat34F64: result.mat34f64 = new seq[TMat34[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
351 of Mat43F32: result.mat43f32 = new seq[TMat43[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
352 of Mat43F64: result.mat43f64 = new seq[TMat43[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
353 of Mat4F32: result.mat4f32 = new seq[TMat4[float32]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
354 of Mat4F64: result.mat4f64 = new seq[TMat4[float64]] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
355 of TextureType: result.texture = new seq[Texture] |
1137 | 356 result.SetLen(len) |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
357 |
1137 | 358 proc InitDataList*[T: GPUType](len = 1): DataList = |
359 result = InitDataList(GetDataType[T]()) | |
360 result.SetLen(len) | |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
361 |
1137 | 362 proc InitDataList*[T: GPUType](data: openArray[T]): DataList = |
363 result = InitDataList(GetDataType[T]()) | |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
364 result.setValues(@data) |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
365 |
869
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
366 func getValues[T: GPUType|int|uint|float](value: DataList): ref seq[T] = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
367 when T is float32: value.float32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
368 elif T is float64: value.float64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
369 elif T is int8: value.int8 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
370 elif T is int16: value.int16 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
371 elif T is int32: value.int32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
372 elif T is int64: value.int64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
373 elif T is uint8: value.uint8 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
374 elif T is uint16: value.uint16 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
375 elif T is uint32: value.uint32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
376 elif T is uint64: value.uint64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
377 elif T is int and sizeof(int) == sizeof(int32): value.int32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
378 elif T is int and sizeof(int) == sizeof(int64): value.int64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
379 elif T is uint and sizeof(uint) == sizeof(uint32): value.uint32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
380 elif T is uint and sizeof(uint) == sizeof(uint64): value.uint64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
381 elif T is float and sizeof(float) == sizeof(float32): value.float32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
382 elif T is float and sizeof(float) == sizeof(float64): value.float64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
383 elif T is TVec2[int32]: value.vec2i32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
384 elif T is TVec2[int64]: value.vec2i64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
385 elif T is TVec3[int32]: value.vec3i32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
386 elif T is TVec3[int64]: value.vec3i64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
387 elif T is TVec4[int32]: value.vec4i32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
388 elif T is TVec4[int64]: value.vec4i64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
389 elif T is TVec2[uint32]: value.vec2u32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
390 elif T is TVec2[uint64]: value.vec2u64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
391 elif T is TVec3[uint32]: value.vec3u32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
392 elif T is TVec3[uint64]: value.vec3u64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
393 elif T is TVec4[uint32]: value.vec4u32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
394 elif T is TVec4[uint64]: value.vec4u64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
395 elif T is TVec2[float32]: value.vec2f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
396 elif T is TVec2[float64]: value.vec2f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
397 elif T is TVec3[float32]: value.vec3f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
398 elif T is TVec3[float64]: value.vec3f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
399 elif T is TVec4[float32]: value.vec4f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
400 elif T is TVec4[float64]: value.vec4f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
401 elif T is TMat2[float32]: value.mat2f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
402 elif T is TMat2[float64]: value.mat2f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
403 elif T is TMat23[float32]: value.mat23f |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
404 elif T is TMat23[float64]: value.mat23f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
405 elif T is TMat32[float32]: value.mat32f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
406 elif T is TMat32[float64]: value.mat32f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
407 elif T is TMat3[float32]: value.mat3f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
408 elif T is TMat3[float64]: value.mat3f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
409 elif T is TMat34[float32]: value.mat34f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
410 elif T is TMat34[float64]: value.mat34f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
411 elif T is TMat43[float32]: value.mat43f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
412 elif T is TMat43[float64]: value.mat43f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
413 elif T is TMat4[float32]: value.mat4f32 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
414 elif T is TMat4[float64]: value.mat4f64 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
415 elif T is Texture: value.texture |
902 | 416 else: {.error: "Virtual datatype has no values".} |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
417 |
869
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
418 func getValue[T: GPUType|int|uint|float](value: DataList, i: int): T = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
419 when T is float32: value.float32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
420 elif T is float64: value.float64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
421 elif T is int8: value.int8[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
422 elif T is int16: value.int16[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
423 elif T is int32: value.int32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
424 elif T is int64: value.int64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
425 elif T is uint8: value.uint8[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
426 elif T is uint16: value.uint16[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
427 elif T is uint32: value.uint32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
428 elif T is uint64: value.uint64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
429 elif T is int and sizeof(int) == sizeof(int32): value.int32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
430 elif T is int and sizeof(int) == sizeof(int64): value.int64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
431 elif T is uint and sizeof(uint) == sizeof(uint32): value.uint32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
432 elif T is uint and sizeof(uint) == sizeof(uint64): value.uint64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
433 elif T is float and sizeof(float) == sizeof(float32): value.float32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
434 elif T is float and sizeof(float) == sizeof(float64): value.float64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
435 elif T is TVec2[int32]: value.vec2i32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
436 elif T is TVec2[int64]: value.vec2i64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
437 elif T is TVec3[int32]: value.vec3i32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
438 elif T is TVec3[int64]: value.vec3i64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
439 elif T is TVec4[int32]: value.vec4i32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
440 elif T is TVec4[int64]: value.vec4i64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
441 elif T is TVec2[uint32]: value.vec2u32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
442 elif T is TVec2[uint64]: value.vec2u64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
443 elif T is TVec3[uint32]: value.vec3u32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
444 elif T is TVec3[uint64]: value.vec3u64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
445 elif T is TVec4[uint32]: value.vec4u32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
446 elif T is TVec4[uint64]: value.vec4u64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
447 elif T is TVec2[float32]: value.vec2f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
448 elif T is TVec2[float64]: value.vec2f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
449 elif T is TVec3[float32]: value.vec3f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
450 elif T is TVec3[float64]: value.vec3f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
451 elif T is TVec4[float32]: value.vec4f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
452 elif T is TVec4[float64]: value.vec4f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
453 elif T is TMat2[float32]: value.mat2f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
454 elif T is TMat2[float64]: value.mat2f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
455 elif T is TMat23[float32]: value.mat23f[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
456 elif T is TMat23[float64]: value.mat23f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
457 elif T is TMat32[float32]: value.mat32f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
458 elif T is TMat32[float64]: value.mat32f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
459 elif T is TMat3[float32]: value.mat3f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
460 elif T is TMat3[float64]: value.mat3f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
461 elif T is TMat34[float32]: value.mat34f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
462 elif T is TMat34[float64]: value.mat34f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
463 elif T is TMat43[float32]: value.mat43f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
464 elif T is TMat43[float64]: value.mat43f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
465 elif T is TMat4[float32]: value.mat4f32[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
466 elif T is TMat4[float64]: value.mat4f64[i] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
467 elif T is Texture: value.texture[i] |
902 | 468 else: {.error: "Virtual datatype has no values".} |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
469 |
869
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
470 template `[]`*(list: DataList, t: typedesc): ref seq[t] = |
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
471 getValues[t](list) |
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
472 template `[]`*(list: DataList, i: int, t: typedesc): untyped = |
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
473 getValue[t](list, i) |
65afec4cb6c6
did: overhaul dynamic array-api in a few places
Sam <sam@basx.dev>
parents:
868
diff
changeset
|
474 |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
475 # since we use this often with tables, add this for an easy assignment |
950
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
920
diff
changeset
|
476 template `[]`*(table: Table[string, DataList], key: string, t: typedesc): ref seq[t] = |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
920
diff
changeset
|
477 getValues[t](table[key]) |
904
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
478 template `[]=`*[T](table: var Table[string, DataList], key: string, values: openArray[T]) = |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
479 if table.contains(key): |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
480 table[key].setValues(values) |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
481 else: |
1137 | 482 table[key] = InitDataList(values) |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
483 |
904
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
484 template `[]=`*[T](list: var DataList, values: openArray[T]) = |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
485 list.setValues(values) |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
486 template `[]=`*[T](list: var DataList, i: int, value: T) = |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
487 list.setValue(i, value) |
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
488 |
1137 | 489 func GetPointer*(value: var DataList): pointer = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
490 if value.len == 0: |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
491 result = nil |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
492 case value.theType |
1137 | 493 of Float32: result = value.float32[].ToCPointer |
494 of Float64: result = value.float64[].ToCPointer | |
495 of Int8: result = value.int8[].ToCPointer | |
496 of Int16: result = value.int16[].ToCPointer | |
497 of Int32: result = value.int32[].ToCPointer | |
498 of Int64: result = value.int64[].ToCPointer | |
499 of UInt8: result = value.uint8[].ToCPointer | |
500 of UInt16: result = value.uint16[].ToCPointer | |
501 of UInt32: result = value.uint32[].ToCPointer | |
502 of UInt64: result = value.uint64[].ToCPointer | |
503 of Vec2I32: result = value.vec2i32[].ToCPointer | |
504 of Vec2I64: result = value.vec2i64[].ToCPointer | |
505 of Vec3I32: result = value.vec3i32[].ToCPointer | |
506 of Vec3I64: result = value.vec3i64[].ToCPointer | |
507 of Vec4I32: result = value.vec4i32[].ToCPointer | |
508 of Vec4I64: result = value.vec4i64[].ToCPointer | |
509 of Vec2U32: result = value.vec2u32[].ToCPointer | |
510 of Vec2U64: result = value.vec2u64[].ToCPointer | |
511 of Vec3U32: result = value.vec3u32[].ToCPointer | |
512 of Vec3U64: result = value.vec3u64[].ToCPointer | |
513 of Vec4U32: result = value.vec4u32[].ToCPointer | |
514 of Vec4U64: result = value.vec4u64[].ToCPointer | |
515 of Vec2F32: result = value.vec2f32[].ToCPointer | |
516 of Vec2F64: result = value.vec2f64[].ToCPointer | |
517 of Vec3F32: result = value.vec3f32[].ToCPointer | |
518 of Vec3F64: result = value.vec3f64[].ToCPointer | |
519 of Vec4F32: result = value.vec4f32[].ToCPointer | |
520 of Vec4F64: result = value.vec4f64[].ToCPointer | |
521 of Mat2F32: result = value.mat2f32[].ToCPointer | |
522 of Mat2F64: result = value.mat2f64[].ToCPointer | |
523 of Mat23F32: result = value.mat23f32[].ToCPointer | |
524 of Mat23F64: result = value.mat23f64[].ToCPointer | |
525 of Mat32F32: result = value.mat32f32[].ToCPointer | |
526 of Mat32F64: result = value.mat32f64[].ToCPointer | |
527 of Mat3F32: result = value.mat3f32[].ToCPointer | |
528 of Mat3F64: result = value.mat3f64[].ToCPointer | |
529 of Mat34F32: result = value.mat34f32[].ToCPointer | |
530 of Mat34F64: result = value.mat34f64[].ToCPointer | |
531 of Mat43F32: result = value.mat43f32[].ToCPointer | |
532 of Mat43F64: result = value.mat43f64[].ToCPointer | |
533 of Mat4F32: result = value.mat4f32[].ToCPointer | |
534 of Mat4F64: result = value.mat4f64[].ToCPointer | |
870
b975eab2b694
did: improve dynamic array, mesh and material APIs a ton, changes in material attributes are now detected and will trigger uniform-updates
Sam <sam@basx.dev>
parents:
869
diff
changeset
|
535 of TextureType: nil |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
536 |
1137 | 537 proc AppendValues*[T: GPUType|int|uint|float](value: var DataList, data: openArray[T]) = |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
538 value.len += data.len |
904
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
539 when T is float32: value.float32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
540 elif T is float64: value.float64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
541 elif T is int8: value.int8[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
542 elif T is int16: value.int16[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
543 elif T is int32: value.int32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
544 elif T is int64: value.int64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
545 elif T is uint8: value.uint8[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
546 elif T is uint16: value.uint16[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
547 elif T is uint32: value.uint32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
548 elif T is uint64: value.uint64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
549 elif T is int and sizeof(int) == sizeof(int32): value.int32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
550 elif T is int and sizeof(int) == sizeof(int64): value.int64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
551 elif T is uint and sizeof(uint) == sizeof(uint32): value.uint32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
552 elif T is uint and sizeof(uint) == sizeof(uint64): value.uint64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
553 elif T is float and sizeof(float) == sizeof(float32): value.float32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
554 elif T is float and sizeof(float) == sizeof(float64): value.float64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
555 elif T is TVec2[int32]: value.vec2i32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
556 elif T is TVec2[int64]: value.vec2i64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
557 elif T is TVec3[int32]: value.vec3i32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
558 elif T is TVec3[int64]: value.vec3i64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
559 elif T is TVec4[int32]: value.vec4i32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
560 elif T is TVec4[int64]: value.vec4i64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
561 elif T is TVec2[uint32]: value.vec2u32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
562 elif T is TVec2[uint64]: value.vec2u64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
563 elif T is TVec3[uint32]: value.vec3u32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
564 elif T is TVec3[uint64]: value.vec3u64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
565 elif T is TVec4[uint32]: value.vec4u32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
566 elif T is TVec4[uint64]: value.vec4u64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
567 elif T is TVec2[float32]: value.vec2f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
568 elif T is TVec2[float64]: value.vec2f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
569 elif T is TVec3[float32]: value.vec3f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
570 elif T is TVec3[float64]: value.vec3f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
571 elif T is TVec4[float32]: value.vec4f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
572 elif T is TVec4[float64]: value.vec4f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
573 elif T is TMat2[float32]: value.mat2f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
574 elif T is TMat2[float64]: value.mat2f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
575 elif T is TMat23[float32]: value.mat23f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
576 elif T is TMat23[float64]: value.mat23f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
577 elif T is TMat32[float32]: value.mat32f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
578 elif T is TMat32[float64]: value.mat32f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
579 elif T is TMat3[float32]: value.mat3f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
580 elif T is TMat3[float64]: value.mat3f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
581 elif T is TMat34[float32]: value.mat34f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
582 elif T is TMat34[float64]: value.mat34f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
583 elif T is TMat43[float32]: value.mat43f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
584 elif T is TMat43[float64]: value.mat43f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
585 elif T is TMat4[float32]: value.mat4f32[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
586 elif T is TMat4[float64]: value.mat4f64[].add @data |
a253a691e0d6
fix: font-api, allow consistent use of mesh-transform
Sam <sam@basx.dev>
parents:
902
diff
changeset
|
587 elif T is Texture: value.texture[].add @data |
902 | 588 else: {.error: "Virtual datatype has no values".} |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
589 |
1137 | 590 proc AppendValues*(value: var DataList, data: DataList) = |
868
252cbc10b25f
did: improve/refactor some of the material API
Sam <sam@basx.dev>
parents:
840
diff
changeset
|
591 assert value.theType == data.theType, &"Expected datalist of type {value.theType} but got {data.theType}" |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
592 value.len += data.len |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
593 case value.theType: |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
594 of Float32: value.float32[].add data.float32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
595 of Float64: value.float64[].add data.float64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
596 of Int8: value.int8[].add data.int8[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
597 of Int16: value.int16[].add data.int16[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
598 of Int32: value.int32[].add data.int32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
599 of Int64: value.int64[].add data.int64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
600 of UInt8: value.uint8[].add data.uint8[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
601 of UInt16: value.uint16[].add data.uint16[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
602 of UInt32: value.uint32[].add data.uint32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
603 of UInt64: value.uint64[].add data.uint64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
604 of Vec2I32: value.vec2i32[].add data.vec2i32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
605 of Vec2I64: value.vec2i64[].add data.vec2i64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
606 of Vec3I32: value.vec3i32[].add data.vec3i32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
607 of Vec3I64: value.vec3i64[].add data.vec3i64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
608 of Vec4I32: value.vec4i32[].add data.vec4i32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
609 of Vec4I64: value.vec4i64[].add data.vec4i64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
610 of Vec2U32: value.vec2u32[].add data.vec2u32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
611 of Vec2U64: value.vec2u64[].add data.vec2u64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
612 of Vec3U32: value.vec3u32[].add data.vec3u32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
613 of Vec3U64: value.vec3u64[].add data.vec3u64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
614 of Vec4U32: value.vec4u32[].add data.vec4u32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
615 of Vec4U64: value.vec4u64[].add data.vec4u64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
616 of Vec2F32: value.vec2f32[].add data.vec2f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
617 of Vec2F64: value.vec2f64[].add data.vec2f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
618 of Vec3F32: value.vec3f32[].add data.vec3f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
619 of Vec3F64: value.vec3f64[].add data.vec3f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
620 of Vec4F32: value.vec4f32[].add data.vec4f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
621 of Vec4F64: value.vec4f64[].add data.vec4f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
622 of Mat2F32: value.mat2f32[].add data.mat2f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
623 of Mat2F64: value.mat2f64[].add data.mat2f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
624 of Mat23F32: value.mat23f32[].add data.mat23f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
625 of Mat23F64: value.mat23f64[].add data.mat23f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
626 of Mat32F32: value.mat32f32[].add data.mat32f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
627 of Mat32F64: value.mat32f64[].add data.mat32f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
628 of Mat3F32: value.mat3f32[].add data.mat3f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
629 of Mat3F64: value.mat3f64[].add data.mat3f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
630 of Mat34F32: value.mat34f32[].add data.mat34f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
631 of Mat34F64: value.mat34f64[].add data.mat34f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
632 of Mat43F32: value.mat43f32[].add data.mat43f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
633 of Mat43F64: value.mat43f64[].add data.mat43f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
634 of Mat4F32: value.mat4f32[].add data.mat4f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
635 of Mat4F64: value.mat4f64[].add data.mat4f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
636 of TextureType: value.texture[].add data.texture[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
637 |
1137 | 638 proc AppendFrom*(a: var DataList, i: int, b: DataList, j: int) = |
902 | 639 assert a.theType == b.theType |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
640 case a.theType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
641 of Float32: a.float32[i] = b.float32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
642 of Float64: a.float64[i] = b.float64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
643 of Int8: a.int8[i] = b.int8[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
644 of Int16: a.int16[i] = b.int16[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
645 of Int32: a.int32[i] = b.int32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
646 of Int64: a.int64[i] = b.int64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
647 of UInt8: a.uint8[i] = b.uint8[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
648 of UInt16: a.uint16[i] = b.uint16[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
649 of UInt32: a.uint32[i] = b.uint32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
650 of UInt64: a.uint64[i] = b.uint64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
651 of Vec2I32: a.vec2i32[i] = b.vec2i32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
652 of Vec2I64: a.vec2i64[i] = b.vec2i64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
653 of Vec3I32: a.vec3i32[i] = b.vec3i32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
654 of Vec3I64: a.vec3i64[i] = b.vec3i64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
655 of Vec4I32: a.vec4i32[i] = b.vec4i32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
656 of Vec4I64: a.vec4i64[i] = b.vec4i64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
657 of Vec2U32: a.vec2u32[i] = b.vec2u32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
658 of Vec2U64: a.vec2u64[i] = b.vec2u64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
659 of Vec3U32: a.vec3u32[i] = b.vec3u32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
660 of Vec3U64: a.vec3u64[i] = b.vec3u64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
661 of Vec4U32: a.vec4u32[i] = b.vec4u32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
662 of Vec4U64: a.vec4u64[i] = b.vec4u64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
663 of Vec2F32: a.vec2f32[i] = b.vec2f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
664 of Vec2F64: a.vec2f64[i] = b.vec2f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
665 of Vec3F32: a.vec3f32[i] = b.vec3f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
666 of Vec3F64: a.vec3f64[i] = b.vec3f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
667 of Vec4F32: a.vec4f32[i] = b.vec4f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
668 of Vec4F64: a.vec4f64[i] = b.vec4f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
669 of Mat2F32: a.mat2f32[i] = b.mat2f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
670 of Mat2F64: a.mat2f64[i] = b.mat2f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
671 of Mat23F32: a.mat23f32[i] = b.mat23f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
672 of Mat23F64: a.mat23f64[i] = b.mat23f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
673 of Mat32F32: a.mat32f32[i] = b.mat32f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
674 of Mat32F64: a.mat32f64[i] = b.mat32f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
675 of Mat3F32: a.mat3f32[i] = b.mat3f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
676 of Mat3F64: a.mat3f64[i] = b.mat3f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
677 of Mat34F32: a.mat34f32[i] = b.mat34f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
678 of Mat34F64: a.mat34f64[i] = b.mat34f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
679 of Mat43F32: a.mat43f32[i] = b.mat43f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
680 of Mat43F64: a.mat43f64[i] = b.mat43f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
681 of Mat4F32: a.mat4f32[i] = b.mat4f32[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
682 of Mat4F64: a.mat4f64[i] = b.mat4f64[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
683 of TextureType: a.texture[i] = b.texture[j] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
684 |
1137 | 685 proc Copy*(datalist: DataList): DataList = |
686 result = InitDataList(datalist.theType) | |
687 result.AppendValues(datalist) | |
840
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
688 |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
689 func `$`*(list: DataList): string = |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
690 case list.theType |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
691 of Float32: $list.float32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
692 of Float64: $list.float64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
693 of Int8: $list.int8[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
694 of Int16: $list.int16[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
695 of Int32: $list.int32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
696 of Int64: $list.int64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
697 of UInt8: $list.uint8[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
698 of UInt16: $list.uint16[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
699 of UInt32: $list.uint32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
700 of UInt64: $list.uint64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
701 of Vec2I32: $list.vec2i32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
702 of Vec2I64: $list.vec2i64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
703 of Vec3I32: $list.vec3i32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
704 of Vec3I64: $list.vec3i64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
705 of Vec4I32: $list.vec4i32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
706 of Vec4I64: $list.vec4i64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
707 of Vec2U32: $list.vec2u32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
708 of Vec2U64: $list.vec2u64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
709 of Vec3U32: $list.vec3u32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
710 of Vec3U64: $list.vec3u64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
711 of Vec4U32: $list.vec4u32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
712 of Vec4U64: $list.vec4u64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
713 of Vec2F32: $list.vec2f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
714 of Vec2F64: $list.vec2f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
715 of Vec3F32: $list.vec3f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
716 of Vec3F64: $list.vec3f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
717 of Vec4F32: $list.vec4f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
718 of Vec4F64: $list.vec4f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
719 of Mat2F32: $list.mat2f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
720 of Mat2F64: $list.mat2f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
721 of Mat23F32: $list.mat23f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
722 of Mat23F64: $list.mat23f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
723 of Mat32F32: $list.mat32f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
724 of Mat32F64: $list.mat32f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
725 of Mat3F32: $list.mat3f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
726 of Mat3F64: $list.mat3f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
727 of Mat34F32: $list.mat34f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
728 of Mat34F64: $list.mat34f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
729 of Mat43F32: $list.mat43f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
730 of Mat43F64: $list.mat43f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
731 of Mat4F32: $list.mat4f32[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
732 of Mat4F64: $list.mat4f64[] |
44ec744fbedc
did: package restructuring according to nimble recommendation for libraries
Sam <sam@basx.dev>
parents:
diff
changeset
|
733 of TextureType: $list.texture[] |