Skip to content

Commit e9f2d65

Browse files
committed
Inline atomics without doing parent
1 parent bf69f97 commit e9f2d65

File tree

1 file changed

+40
-23
lines changed

1 file changed

+40
-23
lines changed

src/data/intrinsics.ts

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ export const INTRINSIC_MODULE = "_intrinsic";
44

55
const b = (name: string): SchemaFieldType => ({ category: "builtin", name });
66
const bf = (count: number): SchemaFieldType => ({ category: "bitfield", count });
7-
const parent = (name: string) => [{ name, module: INTRINSIC_MODULE }];
8-
97
type IntrinsicDef = {
108
name: string;
11-
parents?: { name: string; module: string }[];
129
fields?: { name: string; offset: number; type: SchemaFieldType }[];
1310
size: number;
1411
};
@@ -42,12 +39,7 @@ const types: IntrinsicDef[] = [
4239
name: "m128_f32",
4340
offset: 0,
4441
type: { category: "fixed_array", inner: b("float32"), count: 4 },
45-
},
46-
{
47-
name: "m128_u32",
48-
offset: 0,
49-
type: { category: "fixed_array", inner: b("uint32"), count: 4 },
50-
},
42+
}
5143
],
5244
size: 16,
5345
},
@@ -73,7 +65,13 @@ const types: IntrinsicDef[] = [
7365
},
7466
{
7567
name: "matrix3x4a_t",
76-
parents: parent("matrix3x4_t"),
68+
fields: [
69+
{
70+
name: "m_flMatVal",
71+
offset: 0,
72+
type: { category: "fixed_array", inner: b("float32"), count: 12 },
73+
},
74+
],
7775
size: 48,
7876
},
7977
{
@@ -97,7 +95,12 @@ const types: IntrinsicDef[] = [
9795
},
9896
{
9997
name: "QuaternionAligned",
100-
parents: parent("Quaternion"),
98+
fields: [
99+
{ name: "x", offset: 0, type: b("float32") },
100+
{ name: "y", offset: 4, type: b("float32") },
101+
{ name: "z", offset: 8, type: b("float32") },
102+
{ name: "w", offset: 12, type: b("float32") },
103+
],
101104
size: 16,
102105
},
103106
{
@@ -146,13 +149,21 @@ const types: IntrinsicDef[] = [
146149
},
147150
{
148151
name: "VectorAligned",
149-
parents: parent("Vector"),
150-
fields: [{ name: "w", offset: 12, type: b("float32") }],
152+
fields: [
153+
{ name: "x", offset: 0, type: b("float32") },
154+
{ name: "y", offset: 4, type: b("float32") },
155+
{ name: "z", offset: 8, type: b("float32") },
156+
{ name: "w", offset: 12, type: b("float32") },
157+
],
151158
size: 16,
152159
},
153160
{
154161
name: "VectorWS",
155-
parents: parent("Vector"),
162+
fields: [
163+
{ name: "x", offset: 0, type: b("float32") },
164+
{ name: "y", offset: 4, type: b("float32") },
165+
{ name: "z", offset: 8, type: b("float32") },
166+
],
156167
size: 12,
157168
},
158169
{
@@ -173,7 +184,6 @@ const types: IntrinsicDef[] = [
173184
{
174185
name: "CEntityHandle",
175186
fields: [
176-
{ name: "m_Index", offset: 0, type: b("uint32") },
177187
{ name: "m_EntityIndex", offset: 0, type: bf(15) },
178188
{ name: "m_Serial", offset: 0, type: bf(17) },
179189
],
@@ -186,7 +196,10 @@ const types: IntrinsicDef[] = [
186196
},
187197
{
188198
name: "CHandle",
189-
parents: parent("CEntityHandle"),
199+
fields: [
200+
{ name: "m_EntityIndex", offset: 0, type: bf(15) },
201+
{ name: "m_Serial", offset: 0, type: bf(17) },
202+
],
190203
size: 4,
191204
},
192205
{
@@ -207,7 +220,6 @@ const types: IntrinsicDef[] = [
207220
fields: [
208221
{ name: "m_nLength", offset: 0, type: b("int32") },
209222
{ name: "m_nAllocatedSize", offset: 4, type: b("int32") },
210-
{ name: "m_pString", offset: 8, type: { category: "ptr", inner: b("char") } },
211223
{
212224
name: "m_szString",
213225
offset: 8,
@@ -243,7 +255,7 @@ const types: IntrinsicDef[] = [
243255
},
244256
{
245257
name: "CGlobalSymbolCaseSensitive",
246-
parents: parent("CGlobalSymbol"),
258+
fields: [{ name: "m_Id", offset: 0, type: b("uint32") }],
247259
size: 4,
248260
},
249261
{
@@ -266,7 +278,12 @@ const types: IntrinsicDef[] = [
266278
},
267279
{
268280
name: "CUtlVectorFixedGrowable",
269-
parents: parent("CUtlVector"),
281+
fields: [
282+
{ name: "m_Size", offset: 0, type: b("int32") },
283+
{ name: "m_pMemory", offset: 8, type: { category: "ptr", inner: b("void") } },
284+
{ name: "m_nAllocationCount", offset: 16, type: b("int32") },
285+
{ name: "m_nGrowSize", offset: 20, type: b("int32") },
286+
],
270287
size: 24,
271288
},
272289

@@ -287,7 +304,7 @@ const types: IntrinsicDef[] = [
287304
},
288305
{
289306
name: "CResourceString",
290-
parents: parent("CResourcePointer"),
307+
fields: [{ name: "m_nOffset", offset: 0, type: b("int32") }],
291308
size: 4,
292309
},
293310
{
@@ -302,12 +319,12 @@ const types: IntrinsicDef[] = [
302319
},
303320
{
304321
name: "CStrongHandleCopyable",
305-
parents: parent("CStrongHandle"),
322+
fields: [{ name: "m_pBinding", offset: 0, type: { category: "ptr", inner: b("void") } }],
306323
size: 8,
307324
},
308325
{
309326
name: "CStrongHandleVoid",
310-
parents: parent("CStrongHandle"),
327+
fields: [{ name: "m_pBinding", offset: 0, type: { category: "ptr", inner: b("void") } }],
311328
size: 8,
312329
},
313330
{
@@ -383,7 +400,7 @@ export const intrinsicDeclarations = new Map<string, Declaration>(
383400
kind: "class",
384401
name: c.name,
385402
module: INTRINSIC_MODULE,
386-
parents: c.parents ?? [],
403+
parents: [],
387404
fields: (c.fields ?? []).map((f) => ({ ...f, metadata: [] })),
388405
metadata: [],
389406
},

0 commit comments

Comments
 (0)