typegpu 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{builtin-ClEnM-Ye.js → builtin-DdtWpk2t.js} +2 -2
- package/{builtin-ClEnM-Ye.js.map → builtin-DdtWpk2t.js.map} +1 -1
- package/common/index.d.ts +1 -1
- package/common/index.js +1 -1
- package/data/index.d.ts +1 -1
- package/data/index.js +4 -4
- package/{deepEqual-yZXvaV2C.js → deepEqual-DQxK4vdp.js} +3 -3
- package/{deepEqual-yZXvaV2C.js.map → deepEqual-DQxK4vdp.js.map} +1 -1
- package/{extensions-0SFbU9FH.js → extensions-DIVuAfBM.js} +3 -3
- package/{extensions-0SFbU9FH.js.map → extensions-DIVuAfBM.js.map} +1 -1
- package/{fullScreenTriangle-MdLGaAMR.js → fullScreenTriangle-CfFyQd_0.js} +3 -3
- package/{fullScreenTriangle-MdLGaAMR.js.map → fullScreenTriangle-CfFyQd_0.js.map} +1 -1
- package/index.d.ts +1 -1
- package/index.js +7 -7
- package/index.js.map +1 -1
- package/{indexNamedExports-Cdy7USiY.d.ts → indexNamedExports-oL6tyaJ9.d.ts} +12 -11
- package/indexNamedExports-oL6tyaJ9.d.ts.map +1 -0
- package/{operators-HTxa_0k9.js → operators-d-PMVTo7.js} +4 -2
- package/operators-d-PMVTo7.js.map +1 -0
- package/package.json +1 -1
- package/std/index.d.ts +1 -1
- package/std/index.js +2 -2
- package/{texture-Dg5ybJro.js → texture-BagDrrks.js} +2 -2
- package/{texture-Dg5ybJro.js.map → texture-BagDrrks.js.map} +1 -1
- package/indexNamedExports-Cdy7USiY.d.ts.map +0 -1
- package/operators-HTxa_0k9.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as isAlignAttrib, At as stitch, B as vec2h, Bn as isNaturallyEphemeral, Cn as isDisarray, Dn as undecorate, En as isUnstruct, G as vec3h, H as vec2u, Hn as isSizeAttrib, J as vec4b, Jn as isWgslData, K as vec3i, Kn as isVoid, L as isValidProp, Ln as isMat, M as INTERNAL_createStruct, Mn as isBuiltinAttrib, Nn as isDecorated, O as coerceToSnippet, Q as vec4u, R as vec2b, Sn as isData, Tn as isLooseDecorated, U as vec3b, Un as isVec, V as vec2i, Vn as isPtr, W as vec3f, Wt as isKnownAtComptime, X as vec4h, Y as vec4f, Yn as isWgslStruct, Z as vec4i, _n as MatrixColumnsAccess, _t as schemaCallWrapperGPU, at as i32, bn as getCustomLocation, bt as derefSnippet, cr as $internal, dn as isEphemeralSnippet, er as getName, fr as $resolve, gn as InfixDispatch, gt as schemaCallWrapper, ht as safeStringify, i as mul, ir as $cast, it as f32, mn as snip, n as div, nt as bool, o as sub, or as $gpuCallable, pr as isMarkedInternal, q as vec3u, qn as isWgslArray, r as mod, rr as setName, rt as f16, st as u32, t as add, tt as abstractInt, vn as UnknownData, w as comptime, wn as isLooseData, xn as getCustomSize, yn as getCustomAlignment, z as vec2f } from "./operators-
|
|
1
|
+
import { An as isAlignAttrib, At as stitch, B as vec2h, Bn as isNaturallyEphemeral, Cn as isDisarray, Dn as undecorate, En as isUnstruct, G as vec3h, H as vec2u, Hn as isSizeAttrib, J as vec4b, Jn as isWgslData, K as vec3i, Kn as isVoid, L as isValidProp, Ln as isMat, M as INTERNAL_createStruct, Mn as isBuiltinAttrib, Nn as isDecorated, O as coerceToSnippet, Q as vec4u, R as vec2b, Sn as isData, Tn as isLooseDecorated, U as vec3b, Un as isVec, V as vec2i, Vn as isPtr, W as vec3f, Wt as isKnownAtComptime, X as vec4h, Y as vec4f, Yn as isWgslStruct, Z as vec4i, _n as MatrixColumnsAccess, _t as schemaCallWrapperGPU, at as i32, bn as getCustomLocation, bt as derefSnippet, cr as $internal, dn as isEphemeralSnippet, er as getName, fr as $resolve, gn as InfixDispatch, gt as schemaCallWrapper, ht as safeStringify, i as mul, ir as $cast, it as f32, mn as snip, n as div, nt as bool, o as sub, or as $gpuCallable, pr as isMarkedInternal, q as vec3u, qn as isWgslArray, r as mod, rr as setName, rt as f16, st as u32, t as add, tt as abstractInt, vn as UnknownData, w as comptime, wn as isLooseData, xn as getCustomSize, yn as getCustomAlignment, z as vec2f } from "./operators-d-PMVTo7.js";
|
|
2
2
|
|
|
3
3
|
//#region src/data/vertexFormatData.ts
|
|
4
4
|
var TgpuVertexFormatDataImpl = class {
|
|
@@ -815,4 +815,4 @@ const builtin = {
|
|
|
815
815
|
|
|
816
816
|
//#endregion
|
|
817
817
|
export { uint32x4 as $, packedFormats as A, sint8x4 as B, float16x4 as C, float32x4 as D, float32x3 as E, sint32x2 as F, snorm8x2 as G, snorm16x2 as H, sint32x3 as I, uint16x2 as J, snorm8x4 as K, sint32x4 as L, sint16x2 as M, sint16x4 as N, formatToWGSLType as O, sint32 as P, uint32x3 as Q, sint8 as R, float16x2 as S, float32x2 as T, snorm16x4 as U, snorm16 as V, snorm8 as W, uint32 as X, uint16x4 as Y, uint32x2 as Z, roundUp as _, AutoStruct as a, unorm16x2 as at, customAlignmentOf as b, getAttributesString as c, unorm8x2 as ct, isBuiltin as d, uint8 as et, location as f, getLayoutInfo as g, sizeOf as h, infixOperators as i, unorm16 as it, sint16 as j, isPackedData as k, interpolate as l, unorm8x4 as lt, PUBLIC_sizeOf as m, arrayOf as n, uint8x4 as nt, createIoSchema as o, unorm16x4 as ot, size as p, uint16 as q, accessProp as r, unorm10_10_10_2 as rt, align as s, unorm8 as st, builtin as t, uint8x2 as tt, invariant as u, unorm8x4_bgra as ut, PUBLIC_alignmentOf as v, float32 as w, float16 as x, alignmentOf as y, sint8x2 as z };
|
|
818
|
-
//# sourceMappingURL=builtin-
|
|
818
|
+
//# sourceMappingURL=builtin-DdtWpk2t.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-ClEnM-Ye.js","names":["#validProps","#allocated","#typeForExtraProps","#locations","#usedWgslKeys","#cachedStruct"],"sources":["../src/data/vertexFormatData.ts","../src/data/alignmentOf.ts","../src/mathUtils.ts","../src/data/schemaMemoryLayout.ts","../src/data/sizeOf.ts","../src/data/attributes.ts","../src/core/function/ioSchema.ts","../src/data/autoStruct.ts","../src/tgsl/accessProp.ts","../src/data/array.ts","../src/builtin.ts"],"sourcesContent":["import {\n $cast,\n $gpuCallable,\n $internal,\n isMarkedInternal,\n} from '../shared/symbols.ts';\nimport type { Infer } from '../shared/repr.ts';\nimport type {\n $invalidSchemaReason,\n $repr,\n $validVertexSchema,\n} from '../shared/symbols.ts';\nimport type { VertexFormat } from '../shared/vertexFormat.ts';\nimport { f32, i32, u32 } from './numeric.ts';\nimport {\n vec2f,\n vec2i,\n vec2u,\n vec3f,\n vec3i,\n vec3u,\n vec4f,\n vec4i,\n vec4u,\n} from './vector.ts';\nimport type { WithCast } from '../types.ts';\nimport {\n schemaCallWrapper,\n schemaCallWrapperGPU,\n} from './schemaCallWrapper.ts';\nimport type { Snippet } from './snippet.ts';\nimport type {\n BaseData,\n F16,\n F32,\n I32,\n U32,\n Vec2f,\n Vec2h,\n Vec2i,\n Vec2u,\n Vec3f,\n Vec3h,\n Vec3i,\n Vec3u,\n Vec4f,\n Vec4h,\n Vec4i,\n Vec4u,\n} from './wgslTypes.ts';\n\nexport type FormatToWGSLType<T extends VertexFormat> =\n (typeof formatToWGSLType)[T];\n\nexport interface TgpuVertexFormatData<T extends VertexFormat>\n extends BaseData, WithCast<FormatToWGSLType<T>> {\n readonly type: T;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<FormatToWGSLType<T>>;\n readonly [$validVertexSchema]: true;\n readonly [$invalidSchemaReason]:\n 'Vertex formats are not host-shareable, use concrete types instead';\n // ---\n}\n\nclass TgpuVertexFormatDataImpl<T extends VertexFormat>\n implements TgpuVertexFormatData<T> {\n public readonly [$internal] = {};\n [$gpuCallable]: TgpuVertexFormatData<T>[typeof $gpuCallable];\n\n // Type-tokens, not available at runtime\n declare readonly [$repr]: Infer<FormatToWGSLType<T>>;\n declare readonly [$validVertexSchema]: true;\n declare readonly [$invalidSchemaReason]:\n 'Vertex formats are not host-shareable, use concrete types instead';\n // ---\n\n constructor(public readonly type: T) {\n this[$gpuCallable] = {\n call: (ctx, [v]): Snippet => {\n return schemaCallWrapperGPU(ctx, formatToWGSLType[this.type], v);\n },\n };\n }\n\n [$cast](\n v?: Infer<FormatToWGSLType<T>>,\n ): Infer<FormatToWGSLType<T>> {\n return schemaCallWrapper(formatToWGSLType[this.type], v);\n }\n}\n\nexport const formatToWGSLType = {\n uint8: u32,\n uint8x2: vec2u,\n uint8x4: vec4u,\n sint8: i32,\n sint8x2: vec2i,\n sint8x4: vec4i,\n unorm8: f32,\n unorm8x2: vec2f,\n unorm8x4: vec4f,\n snorm8: f32,\n snorm8x2: vec2f,\n snorm8x4: vec4f,\n uint16: u32,\n uint16x2: vec2u,\n uint16x4: vec4u,\n sint16: i32,\n sint16x2: vec2i,\n sint16x4: vec4i,\n unorm16: f32,\n unorm16x2: vec2f,\n unorm16x4: vec4f,\n snorm16: f32,\n snorm16x2: vec2f,\n snorm16x4: vec4f,\n float16: f32,\n float16x2: vec2f,\n float16x4: vec4f,\n float32: f32,\n float32x2: vec2f,\n float32x3: vec3f,\n float32x4: vec4f,\n uint32: u32,\n uint32x2: vec2u,\n uint32x3: vec3u,\n uint32x4: vec4u,\n sint32: i32,\n sint32x2: vec2i,\n sint32x3: vec3i,\n sint32x4: vec4i,\n 'unorm10-10-10-2': vec4f,\n 'unorm8x4-bgra': vec4f,\n} as const;\n\nexport const packedFormats = new Set(Object.keys(formatToWGSLType));\n\nexport type uint8 = TgpuVertexFormatData<'uint8'>;\nexport const uint8 = new TgpuVertexFormatDataImpl('uint8') as uint8;\n\nexport type uint8x2 = TgpuVertexFormatData<'uint8x2'>;\nexport const uint8x2 = new TgpuVertexFormatDataImpl('uint8x2') as uint8x2;\n\nexport type uint8x4 = TgpuVertexFormatData<'uint8x4'>;\nexport const uint8x4 = new TgpuVertexFormatDataImpl('uint8x4') as uint8x4;\n\nexport type sint8 = TgpuVertexFormatData<'sint8'>;\nexport const sint8 = new TgpuVertexFormatDataImpl('sint8') as sint8;\n\nexport type sint8x2 = TgpuVertexFormatData<'sint8x2'>;\nexport const sint8x2 = new TgpuVertexFormatDataImpl('sint8x2') as sint8x2;\n\nexport type sint8x4 = TgpuVertexFormatData<'sint8x4'>;\nexport const sint8x4 = new TgpuVertexFormatDataImpl('sint8x4') as sint8x4;\n\nexport type unorm8 = TgpuVertexFormatData<'unorm8'>;\nexport const unorm8 = new TgpuVertexFormatDataImpl('unorm8') as unorm8;\n\nexport type unorm8x2 = TgpuVertexFormatData<'unorm8x2'>;\nexport const unorm8x2 = new TgpuVertexFormatDataImpl('unorm8x2') as unorm8x2;\n\nexport type unorm8x4 = TgpuVertexFormatData<'unorm8x4'>;\nexport const unorm8x4 = new TgpuVertexFormatDataImpl('unorm8x4') as unorm8x4;\n\nexport type snorm8 = TgpuVertexFormatData<'snorm8'>;\nexport const snorm8 = new TgpuVertexFormatDataImpl('snorm8') as snorm8;\n\nexport type snorm8x2 = TgpuVertexFormatData<'snorm8x2'>;\nexport const snorm8x2 = new TgpuVertexFormatDataImpl('snorm8x2') as snorm8x2;\n\nexport type snorm8x4 = TgpuVertexFormatData<'snorm8x4'>;\nexport const snorm8x4 = new TgpuVertexFormatDataImpl('snorm8x4') as snorm8x4;\n\nexport type uint16 = TgpuVertexFormatData<'uint16'>;\nexport const uint16 = new TgpuVertexFormatDataImpl('uint16') as uint16;\n\nexport type uint16x2 = TgpuVertexFormatData<'uint16x2'>;\nexport const uint16x2 = new TgpuVertexFormatDataImpl('uint16x2') as uint16x2;\n\nexport type uint16x4 = TgpuVertexFormatData<'uint16x4'>;\nexport const uint16x4 = new TgpuVertexFormatDataImpl('uint16x4') as uint16x4;\n\nexport type sint16 = TgpuVertexFormatData<'sint16'>;\nexport const sint16 = new TgpuVertexFormatDataImpl('sint16') as sint16;\n\nexport type sint16x2 = TgpuVertexFormatData<'sint16x2'>;\nexport const sint16x2 = new TgpuVertexFormatDataImpl('sint16x2') as sint16x2;\n\nexport type sint16x4 = TgpuVertexFormatData<'sint16x4'>;\nexport const sint16x4 = new TgpuVertexFormatDataImpl('sint16x4') as sint16x4;\n\nexport type unorm16 = TgpuVertexFormatData<'unorm16'>;\nexport const unorm16 = new TgpuVertexFormatDataImpl('unorm16') as unorm16;\n\nexport type unorm16x2 = TgpuVertexFormatData<'unorm16x2'>;\nexport const unorm16x2 = new TgpuVertexFormatDataImpl('unorm16x2') as unorm16x2;\n\nexport type unorm16x4 = TgpuVertexFormatData<'unorm16x4'>;\nexport const unorm16x4 = new TgpuVertexFormatDataImpl('unorm16x4') as unorm16x4;\n\nexport type snorm16 = TgpuVertexFormatData<'snorm16'>;\nexport const snorm16 = new TgpuVertexFormatDataImpl('snorm16') as snorm16;\n\nexport type snorm16x2 = TgpuVertexFormatData<'snorm16x2'>;\nexport const snorm16x2 = new TgpuVertexFormatDataImpl('snorm16x2') as snorm16x2;\n\nexport type snorm16x4 = TgpuVertexFormatData<'snorm16x4'>;\nexport const snorm16x4 = new TgpuVertexFormatDataImpl('snorm16x4') as snorm16x4;\n\nexport type float16 = TgpuVertexFormatData<'float16'>;\nexport const float16 = new TgpuVertexFormatDataImpl('float16') as float16;\n\nexport type float16x2 = TgpuVertexFormatData<'float16x2'>;\nexport const float16x2 = new TgpuVertexFormatDataImpl('float16x2') as float16x2;\n\nexport type float16x4 = TgpuVertexFormatData<'float16x4'>;\nexport const float16x4 = new TgpuVertexFormatDataImpl('float16x4') as float16x4;\n\nexport type float32 = TgpuVertexFormatData<'float32'>;\nexport const float32 = new TgpuVertexFormatDataImpl('float32') as float32;\n\nexport type float32x2 = TgpuVertexFormatData<'float32x2'>;\nexport const float32x2 = new TgpuVertexFormatDataImpl('float32x2') as float32x2;\n\nexport type float32x3 = TgpuVertexFormatData<'float32x3'>;\nexport const float32x3 = new TgpuVertexFormatDataImpl('float32x3') as float32x3;\n\nexport type float32x4 = TgpuVertexFormatData<'float32x4'>;\nexport const float32x4 = new TgpuVertexFormatDataImpl('float32x4') as float32x4;\n\nexport type uint32 = TgpuVertexFormatData<'uint32'>;\nexport const uint32 = new TgpuVertexFormatDataImpl('uint32') as uint32;\n\nexport type uint32x2 = TgpuVertexFormatData<'uint32x2'>;\nexport const uint32x2 = new TgpuVertexFormatDataImpl('uint32x2') as uint32x2;\n\nexport type uint32x3 = TgpuVertexFormatData<'uint32x3'>;\nexport const uint32x3 = new TgpuVertexFormatDataImpl('uint32x3') as uint32x3;\n\nexport type uint32x4 = TgpuVertexFormatData<'uint32x4'>;\nexport const uint32x4 = new TgpuVertexFormatDataImpl('uint32x4') as uint32x4;\n\nexport type sint32 = TgpuVertexFormatData<'sint32'>;\nexport const sint32 = new TgpuVertexFormatDataImpl('sint32') as sint32;\n\nexport type sint32x2 = TgpuVertexFormatData<'sint32x2'>;\nexport const sint32x2 = new TgpuVertexFormatDataImpl('sint32x2') as sint32x2;\n\nexport type sint32x3 = TgpuVertexFormatData<'sint32x3'>;\nexport const sint32x3 = new TgpuVertexFormatDataImpl('sint32x3') as sint32x3;\n\nexport type sint32x4 = TgpuVertexFormatData<'sint32x4'>;\nexport const sint32x4 = new TgpuVertexFormatDataImpl('sint32x4') as sint32x4;\n\nexport type unorm10_10_10_2 = TgpuVertexFormatData<'unorm10-10-10-2'>;\nexport const unorm10_10_10_2 = new TgpuVertexFormatDataImpl(\n 'unorm10-10-10-2',\n) as unorm10_10_10_2;\n\nexport type unorm8x4_bgra = TgpuVertexFormatData<'unorm8x4-bgra'>;\nexport const unorm8x4_bgra = new TgpuVertexFormatDataImpl(\n 'unorm8x4-bgra',\n) as unorm8x4_bgra;\n\nexport type PackedData =\n | uint8\n | uint8x2\n | uint8x4\n | sint8\n | sint8x2\n | sint8x4\n | unorm8\n | unorm8x2\n | unorm8x4\n | snorm8\n | snorm8x2\n | snorm8x4\n | uint16\n | uint16x2\n | uint16x4\n | sint16\n | sint16x2\n | sint16x4\n | unorm16\n | unorm16x2\n | unorm16x4\n | snorm16\n | snorm16x2\n | snorm16x4\n | float16\n | float16x2\n | float16x4\n | float32\n | float32x2\n | float32x3\n | float32x4\n | uint32\n | uint32x2\n | uint32x3\n | uint32x4\n | sint32\n | sint32x2\n | sint32x3\n | sint32x4\n | unorm10_10_10_2\n | unorm8x4_bgra;\n\nexport function isPackedData(value: unknown): value is PackedData {\n return (\n isMarkedInternal(value) && packedFormats.has((value as PackedData)?.type)\n );\n}\n\ntype U32Data = U32 | Vec2u | Vec3u | Vec4u;\ntype I32Data = I32 | Vec2i | Vec3i | Vec4i;\ntype FloatData = F32 | Vec2f | Vec3f | Vec4f | F16 | Vec2h | Vec3h | Vec4h;\n\nexport type FormatToAcceptedData = {\n uint8: U32Data;\n uint8x2: U32Data;\n uint8x4: U32Data;\n sint8: I32Data;\n sint8x2: I32Data;\n sint8x4: I32Data;\n unorm8: FloatData;\n unorm8x2: FloatData;\n unorm8x4: FloatData;\n snorm8: FloatData;\n snorm8x2: FloatData;\n snorm8x4: FloatData;\n uint16: U32Data;\n uint16x2: U32Data;\n uint16x4: U32Data;\n sint16: I32Data;\n sint16x2: I32Data;\n sint16x4: I32Data;\n unorm16: FloatData;\n unorm16x2: FloatData;\n unorm16x4: FloatData;\n snorm16: FloatData;\n snorm16x2: FloatData;\n snorm16x4: FloatData;\n float16: FloatData;\n float16x2: FloatData;\n float16x4: FloatData;\n float32: FloatData;\n float32x2: FloatData;\n float32x3: FloatData;\n float32x4: FloatData;\n uint32: U32Data;\n uint32x2: U32Data;\n uint32x3: U32Data;\n uint32x4: U32Data;\n sint32: I32Data;\n sint32x2: I32Data;\n sint32x3: I32Data;\n sint32x4: I32Data;\n 'unorm10-10-10-2': FloatData;\n 'unorm8x4-bgra': FloatData;\n};\n","import { safeStringify } from '../shared/stringify.ts';\nimport {\n type AnyData,\n getCustomAlignment,\n isDisarray,\n isLooseDecorated,\n isUnstruct,\n} from './dataTypes.ts';\nimport { packedFormats } from './vertexFormatData.ts';\nimport {\n type BaseData,\n isDecorated,\n isWgslArray,\n isWgslStruct,\n} from './wgslTypes.ts';\n\nconst knownAlignmentMap: Record<string, number> = {\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4,\n bool: 4,\n u16: 2,\n vec2f: 8,\n vec2h: 4,\n vec2i: 8,\n vec2u: 8,\n 'vec2<bool>': 8,\n vec3f: 16,\n vec3h: 8,\n vec3i: 16,\n vec3u: 16,\n 'vec3<bool>': 16,\n vec4f: 16,\n vec4h: 8,\n vec4i: 16,\n vec4u: 16,\n 'vec4<bool>': 16,\n mat2x2f: 8,\n mat3x3f: 16,\n mat4x4f: 16,\n atomic: 4,\n};\n\nfunction computeAlignment(data: object): number {\n const dataType = (data as BaseData)?.type;\n const knownAlignment = knownAlignmentMap[dataType];\n if (knownAlignment !== undefined) {\n return knownAlignment;\n }\n\n if (isWgslStruct(data)) {\n return Object.values(data.propTypes)\n .map(alignmentOf)\n .reduce((a, b) => (a > b ? a : b));\n }\n\n if (isWgslArray(data)) {\n return alignmentOf(data.elementType);\n }\n\n if (isUnstruct(data)) {\n // A loose struct is aligned to its first property.\n const firstProp = Object.values(data.propTypes)[0];\n return firstProp ? (getCustomAlignment(firstProp) ?? 1) : 1;\n }\n\n if (isDisarray(data)) {\n return getCustomAlignment(data.elementType) ?? 1;\n }\n\n if (isDecorated(data) || isLooseDecorated(data)) {\n return getCustomAlignment(data) ?? alignmentOf(data.inner);\n }\n\n if (packedFormats.has(dataType)) {\n return 1;\n }\n\n throw new Error(\n `Cannot determine alignment of data: ${safeStringify(data)}`,\n );\n}\n\nfunction computeCustomAlignment(data: BaseData): number {\n if (isUnstruct(data)) {\n // A loose struct is aligned to its first property.\n const firstProp = Object.values(data.propTypes)[0];\n return firstProp ? customAlignmentOf(firstProp) : 1;\n }\n\n if (isDisarray(data)) {\n return customAlignmentOf(data.elementType);\n }\n\n if (isLooseDecorated(data)) {\n return getCustomAlignment(data) ?? customAlignmentOf(data.inner);\n }\n\n return getCustomAlignment(data) ?? 1;\n}\n\n/**\n * Since alignments can be inferred from data types, they are not stored on them.\n * Instead, this weak map acts as an extended property of those data types.\n */\nconst cachedAlignments = new WeakMap<object, number>();\n\nconst cachedCustomAlignments = new WeakMap<object, number>();\n\nexport function alignmentOf(data: BaseData): number {\n let alignment = cachedAlignments.get(data);\n if (alignment === undefined) {\n alignment = computeAlignment(data);\n cachedAlignments.set(data, alignment);\n }\n\n return alignment;\n}\n\nexport function customAlignmentOf(data: BaseData): number {\n let alignment = cachedCustomAlignments.get(data);\n if (alignment === undefined) {\n alignment = computeCustomAlignment(data);\n cachedCustomAlignments.set(data, alignment);\n }\n\n return alignment;\n}\n\n/**\n * Returns the alignment (in bytes) of data represented by the `schema`.\n */\nexport function PUBLIC_alignmentOf(schema: AnyData): number {\n return alignmentOf(schema);\n}\n","/**\n * @param value\n * @param modulo has to be power of 2\n */\nexport const roundUp = (value: number, modulo: number) => {\n const bitMask = modulo - 1;\n const invBitMask = ~bitMask;\n return (value & bitMask) === 0 ? value : (value & invBitMask) + modulo;\n};\n","import { roundUp } from '../mathUtils.ts';\nimport { alignmentOf, customAlignmentOf } from './alignmentOf.ts';\nimport type { Disarray, LooseTypeLiteral, Unstruct } from './dataTypes.ts';\nimport {\n getCustomSize,\n isDisarray,\n isLooseDecorated,\n isUnstruct,\n undecorate,\n} from './dataTypes.ts';\nimport type {\n BaseData,\n WgslArray,\n WgslStruct,\n WgslTypeLiteral,\n} from './wgslTypes.ts';\nimport { isDecorated, isWgslArray, isWgslStruct } from './wgslTypes.ts';\n\nconst knownSizesMap: Record<string, number> = {\n bool: 4,\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4,\n u16: 2,\n vec2f: 8,\n vec2h: 4,\n vec2i: 8,\n vec2u: 8,\n 'vec2<bool>': 8,\n vec3f: 12,\n vec3h: 6,\n vec3i: 12,\n vec3u: 12,\n 'vec3<bool>': 12,\n vec4f: 16,\n vec4h: 8,\n vec4i: 16,\n vec4u: 16,\n 'vec4<bool>': 16,\n mat2x2f: 16,\n mat3x3f: 48,\n mat4x4f: 64,\n uint8: 1,\n uint8x2: 2,\n uint8x4: 4,\n sint8: 1,\n sint8x2: 2,\n sint8x4: 4,\n unorm8: 1,\n unorm8x2: 2,\n unorm8x4: 4,\n snorm8: 1,\n snorm8x2: 2,\n snorm8x4: 4,\n uint16: 2,\n uint16x2: 4,\n uint16x4: 8,\n sint16: 2,\n sint16x2: 4,\n sint16x4: 8,\n unorm16: 2,\n unorm16x2: 4,\n unorm16x4: 8,\n snorm16: 2,\n snorm16x2: 4,\n snorm16x4: 8,\n float16: 2,\n float16x2: 4,\n float16x4: 8,\n float32: 4,\n float32x2: 8,\n float32x3: 12,\n float32x4: 16,\n uint32: 4,\n uint32x2: 8,\n uint32x3: 12,\n uint32x4: 16,\n sint32: 4,\n sint32x2: 8,\n sint32x3: 12,\n sint32x4: 16,\n 'unorm10-10-10-2': 4,\n 'unorm8x4-bgra': 4,\n atomic: 4,\n} satisfies Partial<Record<WgslTypeLiteral | LooseTypeLiteral, number>>;\n\ninterface SchemaMemoryLayout {\n isContiguous: boolean;\n size: number;\n longestContiguousPrefix: number;\n}\n\nfunction computeMLOfStruct(struct: WgslStruct): SchemaMemoryLayout {\n let size = 0;\n let longestContiguousPrefix = 0;\n let isContiguous = true;\n let prefixEnd = false;\n\n for (const property of Object.values(struct.propTypes)) {\n if (Number.isNaN(size)) {\n throw new Error('Only the last property of a struct can be unbounded');\n }\n\n const prevSize = size;\n size = roundUp(size, alignmentOf(property));\n\n const hasPadding = prevSize !== size;\n\n const propLayout = computeMemoryLayout(property);\n size += propLayout.size;\n\n if (Number.isNaN(size) && property.type !== 'array') {\n throw new Error('Cannot nest unbounded struct within another struct');\n }\n\n if (prefixEnd) {\n continue;\n }\n\n if (!hasPadding && propLayout.isContiguous) {\n longestContiguousPrefix += propLayout.size;\n } else {\n prefixEnd = true;\n isContiguous = false;\n if (!hasPadding) {\n longestContiguousPrefix += propLayout.longestContiguousPrefix;\n }\n }\n }\n\n const trueSize = roundUp(size, alignmentOf(struct));\n\n return {\n isContiguous: size === trueSize && isContiguous,\n size: trueSize,\n longestContiguousPrefix,\n };\n}\n\nfunction computeMLOfUnstruct(data: Unstruct): SchemaMemoryLayout {\n let size = 0;\n let longestContiguousPrefix = 0;\n let isContiguous = true;\n let prefixEnd = false;\n\n for (const property of Object.values(data.propTypes)) {\n const alignment = customAlignmentOf(property);\n const prevSize = size;\n size = roundUp(size, alignment);\n\n const hasPadding = prevSize !== size;\n if (hasPadding) {\n isContiguous = false;\n }\n\n const propLayout = computeMemoryLayout(property);\n size += propLayout.size;\n\n if (prefixEnd) {\n continue;\n }\n\n if (!hasPadding && propLayout.isContiguous) {\n longestContiguousPrefix += propLayout.size;\n } else {\n prefixEnd = true;\n isContiguous = false;\n if (!hasPadding) {\n longestContiguousPrefix += propLayout.longestContiguousPrefix;\n }\n }\n }\n\n return {\n isContiguous: isContiguous,\n size,\n longestContiguousPrefix,\n };\n}\n\nfunction computeMLOfWgslArray(data: WgslArray): SchemaMemoryLayout {\n const elementType = data.elementType;\n const elementMemoryLayout = computeMemoryLayout(elementType);\n const elementSize = elementMemoryLayout.size;\n const stride = roundUp(elementSize, alignmentOf(elementType));\n\n const hasPadding = stride > elementSize;\n const isContiguous = !hasPadding && elementMemoryLayout.isContiguous;\n\n const size = data.elementCount === 0\n ? Number.NaN\n : data.elementCount * stride;\n\n let longestContiguousPrefix: number;\n if (isContiguous) {\n longestContiguousPrefix = size;\n } else {\n longestContiguousPrefix = elementMemoryLayout.longestContiguousPrefix;\n }\n\n return { size, isContiguous, longestContiguousPrefix };\n}\n\nfunction computeMLOfDisarray(data: Disarray): SchemaMemoryLayout {\n const elementType = data.elementType;\n const elementMemoryLayout = computeMemoryLayout(elementType);\n const elementSize = elementMemoryLayout.size;\n const stride = roundUp(elementSize, customAlignmentOf(elementType));\n\n const hasPadding = stride > elementSize;\n const isContiguous = !hasPadding && elementMemoryLayout.isContiguous;\n\n const size = data.elementCount * stride;\n\n let longestContiguousPrefix: number;\n if (isContiguous) {\n longestContiguousPrefix = size;\n } else {\n longestContiguousPrefix = elementMemoryLayout.longestContiguousPrefix;\n }\n\n return { size, isContiguous, longestContiguousPrefix };\n}\n\nfunction computeMemoryLayout(data: BaseData): SchemaMemoryLayout {\n const knownSize = knownSizesMap[data.type];\n\n if (knownSize !== undefined) {\n return {\n isContiguous: data.type !== 'mat3x3f',\n size: knownSize,\n longestContiguousPrefix: data.type === 'mat3x3f' ? 12 : knownSize,\n };\n }\n\n if (isWgslStruct(data)) {\n return computeMLOfStruct(data);\n }\n\n if (isUnstruct(data)) {\n return computeMLOfUnstruct(data);\n }\n\n if (isWgslArray(data)) {\n return computeMLOfWgslArray(data);\n }\n\n if (isDisarray(data)) {\n return computeMLOfDisarray(data);\n }\n\n if (isDecorated(data) || isLooseDecorated(data)) {\n const size = getCustomSize(data);\n const undecoratedLayout = computeMemoryLayout(undecorate(data));\n\n if (size) {\n const isContiguous = size === undecoratedLayout.size &&\n undecoratedLayout.isContiguous;\n\n return {\n isContiguous,\n size,\n longestContiguousPrefix: undecoratedLayout.longestContiguousPrefix,\n };\n }\n return computeMemoryLayout(data.inner);\n }\n\n throw new Error(`Cannot determine memory layout of data: ${data}`);\n}\n\n/**\n * Since memory layout can be inferred from data types, they are not stored on them.\n * Instead, this weak map acts as an extended property of those data types.\n */\nconst cachedLayouts = new WeakMap<BaseData, SchemaMemoryLayout>();\n\nexport function getLayoutInfo<T extends keyof SchemaMemoryLayout>(\n schema: BaseData,\n key: T,\n): SchemaMemoryLayout[T] {\n let layout = cachedLayouts.get(schema);\n\n if (layout === undefined) {\n layout = computeMemoryLayout(schema);\n cachedLayouts.set(schema, layout);\n }\n\n return layout[key];\n}\n","import type { AnyData } from './dataTypes.ts';\nimport type { BaseData } from './wgslTypes.ts';\nimport { getLayoutInfo } from './schemaMemoryLayout.ts';\n\nexport function sizeOf(schema: BaseData): number {\n return getLayoutInfo(schema, 'size');\n}\n\n/**\n * Returns the size (in bytes) of data represented by the `schema`.\n */\nexport function PUBLIC_sizeOf(schema: AnyData): number {\n return sizeOf(schema);\n}\n","import type {\n Infer,\n InferGPU,\n InferPartial,\n IsValidStorageSchema,\n IsValidUniformSchema,\n IsValidVertexSchema,\n MemIdentity,\n} from '../shared/repr.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport {\n $gpuRepr,\n $invalidSchemaReason,\n $memIdent,\n $repr,\n $reprPartial,\n $validStorageSchema,\n $validUniformSchema,\n $validVertexSchema,\n} from '../shared/symbols.ts';\nimport { alignmentOf } from './alignmentOf.ts';\nimport {\n type AnyData,\n type AnyLooseData,\n type IsLooseData,\n isLooseData,\n isLooseDecorated,\n type LooseDecorated,\n type Undecorate,\n} from './dataTypes.ts';\nimport { sizeOf } from './sizeOf.ts';\nimport {\n type Align,\n type AnyWgslData,\n type BaseData,\n type Builtin,\n type Decorated,\n type FlatInterpolatableData,\n type FlatInterpolationType,\n type Interpolate,\n type InterpolationType,\n type Invariant,\n isAlignAttrib,\n isBuiltinAttrib,\n isDecorated,\n isSizeAttrib,\n type IsWgslData,\n isWgslData,\n type Location,\n type PerspectiveOrLinearInterpolatableData,\n type PerspectiveOrLinearInterpolationType,\n type Size,\n type Vec4f,\n} from './wgslTypes.ts';\n\n// ----------\n// Public API\n// ----------\n\nexport const builtinNames = [\n 'vertex_index',\n 'instance_index',\n 'clip_distances',\n 'position',\n 'front_facing',\n 'frag_depth',\n 'primitive_index',\n 'sample_index',\n 'sample_mask',\n 'fragment',\n 'local_invocation_id',\n 'local_invocation_index',\n 'global_invocation_id',\n 'workgroup_id',\n 'num_workgroups',\n 'subgroup_invocation_id',\n 'subgroup_size',\n 'subgroup_id',\n 'num_subgroups',\n] as const;\n\nexport type BuiltinName = (typeof builtinNames)[number];\n\nexport type AnyAttribute<\n AllowedBuiltins extends Builtin<BuiltinName> = Builtin<BuiltinName>,\n> =\n | Align<number>\n | Size<number>\n | Location\n | Interpolate\n | Invariant\n | AllowedBuiltins;\n\nexport type ExtractAttributes<T> = T extends {\n readonly attribs: unknown[];\n} ? T['attribs']\n : [];\n\n/**\n * Decorates a data-type `TData` with an attribute `TAttrib`.\n *\n * - if `TData` is loose\n * - if `TData` is already `LooseDecorated`\n * - Prepend `TAttrib` to the existing attribute tuple.\n * - else\n * - Wrap `TData` with `LooseDecorated` and a single attribute `[TAttrib]`\n * - else\n * - if `TData` is already `Decorated`\n * - Prepend `TAttrib` to the existing attribute tuple.\n * - else\n * - Wrap `TData` with `Decorated` and a single attribute `[TAttrib]`\n */\nexport type Decorate<\n TData extends BaseData,\n TAttrib extends AnyAttribute,\n> = IsWgslData<TData> extends true\n ? Decorated<Undecorate<TData>, [TAttrib, ...ExtractAttributes<TData>]>\n : IsLooseData<TData> extends true\n ? LooseDecorated<Undecorate<TData>, [TAttrib, ...ExtractAttributes<TData>]>\n : never;\n\nexport type IsBuiltin<T> = ExtractAttributes<T>[number] extends [] ? false\n : ExtractAttributes<T>[number] extends Builtin<BuiltinName> ? true\n : false;\n\nexport type HasCustomLocation<T> = ExtractAttributes<T>[number] extends []\n ? false\n : ExtractAttributes<T>[number] extends Location ? true\n : false;\n\nexport function attribute(\n data: BaseData,\n attrib: AnyAttribute,\n): Decorated | LooseDecorated {\n if (isDecorated(data)) {\n return new DecoratedImpl(data.inner, [attrib, ...data.attribs]);\n }\n\n if (isLooseDecorated(data)) {\n return new LooseDecoratedImpl(data.inner, [attrib, ...data.attribs]);\n }\n\n if (isLooseData(data)) {\n return new LooseDecoratedImpl(data, [attrib]) as unknown as LooseDecorated;\n }\n\n return new DecoratedImpl(data, [attrib]) as unknown as Decorated;\n}\n\n/**\n * Gives the wrapped data-type a custom byte alignment. Useful in order to\n * fulfill uniform alignment requirements.\n *\n * @example\n * const Data = d.struct({\n * a: u32, // takes up 4 bytes\n * // 12 bytes of padding, because `b` is custom aligned to multiples of 16 bytes\n * b: d.align(16, u32),\n * });\n *\n * @param alignment The multiple of bytes this data should align itself to.\n * @param data The data-type to align.\n */\nexport function align<TAlign extends number, TData extends AnyData>(\n alignment: TAlign,\n data: TData,\n): Decorate<TData, Align<TAlign>> {\n return attribute(data, {\n [$internal]: true,\n type: '@align',\n params: [alignment],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Adds padding bytes after the wrapped data-type, until the whole value takes up `size` bytes.\n *\n * @example\n * const Data = d.struct({\n * a: d.size(16, u32), // takes up 16 bytes, instead of 4\n * b: u32, // starts at byte 16, because `a` has a custom size\n * });\n *\n * @param size The amount of bytes that should be reserved for this data-type.\n * @param data The data-type to wrap.\n */\nexport function size<TSize extends number, TData extends AnyData>(\n size: TSize,\n data: TData,\n): Decorate<TData, Size<TSize>> {\n return attribute(data, {\n [$internal]: true,\n type: '@size',\n params: [size],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Assigns an explicit numeric location to a struct member or a parameter that has this type.\n *\n * @example\n * const VertexOutput = {\n * a: d.u32, // has implicit location 0\n * b: d.location(5, d.u32),\n * c: d.u32, // has implicit location 6\n * };\n *\n * @param location The explicit numeric location.\n * @param data The data-type to wrap.\n */\nexport function location<TLocation extends number, TData extends BaseData>(\n location: TLocation,\n data: TData,\n): Decorate<TData, Location<TLocation>> {\n return attribute(data, {\n [$internal]: true,\n type: '@location',\n params: [location],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Specifies how user-defined vertex shader output (fragment shader input)\n * must be interpolated.\n *\n * Tip: Integer outputs cannot be interpolated.\n *\n * @example\n * const VertexOutput = {\n * a: d.f32, // has implicit 'perspective, center' interpolation\n * b: d.interpolate('linear, sample', d.f32),\n * };\n *\n * @param interpolationType How data should be interpolated.\n * @param data The data-type to wrap.\n */\nexport function interpolate<\n TInterpolation extends PerspectiveOrLinearInterpolationType,\n TData extends PerspectiveOrLinearInterpolatableData,\n>(\n interpolationType: TInterpolation,\n data: TData,\n): Decorate<TData, Interpolate<TInterpolation>>;\n\n/**\n * Specifies how user-defined vertex shader output (fragment shader input)\n * must be interpolated.\n *\n * Tip: Default sampling method of `flat` is `first`. Unless you specifically\n * need deterministic behavior provided by `'flat, first'`, prefer explicit\n * `'flat, either'` as it could be slightly faster in hardware.\n *\n * @example\n * const VertexOutput = {\n * a: d.f32, // has implicit 'perspective, center' interpolation\n * b: d.interpolate('flat, either', d.u32), // integer outputs cannot interpolate\n * };\n *\n * @param interpolationType How data should be interpolated.\n * @param data The data-type to wrap.\n */\nexport function interpolate<\n TInterpolation extends FlatInterpolationType,\n TData extends FlatInterpolatableData,\n>(\n interpolationType: TInterpolation,\n data: TData,\n): Decorate<TData, Interpolate<TInterpolation>>;\n\nexport function interpolate<\n TInterpolation extends InterpolationType,\n TData extends AnyData,\n>(\n interpolationType: TInterpolation,\n data: TData,\n): Decorate<TData, Interpolate<TInterpolation>> {\n return attribute(data, {\n [$internal]: true,\n type: '@interpolate',\n params: [interpolationType],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Marks a position built-in output value as invariant in vertex shaders.\n * If the data and control flow match for two position outputs in different\n * entry points, then the result values are guaranteed to be the same.\n *\n * Must only be applied to the position built-in value.\n *\n * @example\n * const VertexOutput = {\n * pos: d.invariant(d.builtin.position),\n * };\n *\n * @param data The position built-in data-type to mark as invariant.\n */\nexport function invariant(\n data: Decorated<Vec4f, [Builtin<'position'>]>,\n): Decorated<Vec4f, [Builtin<'position'>, Invariant]> {\n // Validate that invariant is only applied to position built-in\n if (!isBuiltin(data)) {\n throw new Error(\n 'The @invariant attribute must only be applied to the position built-in value.',\n );\n }\n\n // Find the builtin attribute to check if it's position\n const builtinAttrib = (isDecorated(data) || isLooseDecorated(data))\n ? data.attribs.find(isBuiltinAttrib)\n : undefined;\n\n if (!builtinAttrib || builtinAttrib.params[0] !== 'position') {\n throw new Error(\n 'The @invariant attribute must only be applied to the position built-in value.',\n );\n }\n\n return attribute(data, {\n [$internal]: true,\n type: '@invariant',\n params: [],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\nexport function isBuiltin(value: unknown): value is\n | Decorated<AnyWgslData, AnyAttribute[]>\n | LooseDecorated<AnyLooseData, AnyAttribute[]> {\n return (\n (isDecorated(value) || isLooseDecorated(value)) &&\n value.attribs.find(isBuiltinAttrib) !== undefined\n );\n}\n\nexport function getAttributesString<T extends BaseData>(field: T): string {\n if (!isDecorated(field) && !isLooseDecorated(field)) {\n return '';\n }\n\n return (field.attribs as AnyAttribute[])\n .map((attrib) => {\n if (attrib.params.length === 0) {\n return `${attrib.type} `;\n }\n return `${attrib.type}(${attrib.params.join(', ')}) `;\n })\n .join('');\n}\n\n// --------------\n// Implementation\n// --------------\n\nclass BaseDecoratedImpl<TInner extends BaseData, TAttribs extends unknown[]> {\n public readonly [$internal] = {};\n\n // Type-tokens, not available at runtime\n declare readonly [$repr]: Infer<TInner>;\n declare readonly [$gpuRepr]: InferGPU<TInner>;\n declare readonly [$reprPartial]: InferPartial<TInner>;\n // ---\n\n constructor(\n public readonly inner: TInner,\n public readonly attribs: TAttribs,\n ) {\n const alignAttrib = attribs.find(isAlignAttrib)?.params[0];\n const sizeAttrib = attribs.find(isSizeAttrib)?.params[0];\n\n if (alignAttrib !== undefined) {\n if (alignAttrib <= 0) {\n throw new Error(\n `Custom data alignment must be a positive number, got: ${alignAttrib}.`,\n );\n }\n\n if (Math.log2(alignAttrib) % 1 !== 0) {\n throw new Error(\n `Alignment has to be a power of 2, got: ${alignAttrib}.`,\n );\n }\n\n if (isWgslData(this.inner)) {\n if (alignAttrib % alignmentOf(this.inner) !== 0) {\n throw new Error(\n `Custom alignment has to be a multiple of the standard data alignment. Got: ${alignAttrib}, expected multiple of: ${\n alignmentOf(this.inner)\n }.`,\n );\n }\n }\n }\n\n if (sizeAttrib !== undefined) {\n if (sizeAttrib < sizeOf(this.inner)) {\n throw new Error(\n `Custom data size cannot be smaller then the standard data size. Got: ${sizeAttrib}, expected at least: ${\n sizeOf(this.inner)\n }.`,\n );\n }\n\n if (sizeAttrib <= 0) {\n throw new Error(\n `Custom data size must be a positive number. Got: ${sizeAttrib}.`,\n );\n }\n }\n }\n}\n\nclass DecoratedImpl<TInner extends BaseData, TAttribs extends unknown[]>\n extends BaseDecoratedImpl<TInner, TAttribs>\n implements Decorated<TInner, TAttribs> {\n public readonly [$internal] = {};\n public readonly type = 'decorated';\n\n // Type-tokens, not available at runtime\n declare readonly [$memIdent]: TAttribs extends Location[]\n ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs>\n : Decorated<MemIdentity<TInner>, TAttribs>;\n declare readonly [$invalidSchemaReason]:\n Decorated[typeof $invalidSchemaReason];\n declare readonly [$validStorageSchema]: IsValidStorageSchema<TInner>;\n declare readonly [$validUniformSchema]: IsValidUniformSchema<TInner>;\n declare readonly [$validVertexSchema]: IsValidVertexSchema<TInner>;\n // ---\n}\n\nclass LooseDecoratedImpl<TInner extends BaseData, TAttribs extends unknown[]>\n extends BaseDecoratedImpl<TInner, TAttribs>\n implements LooseDecorated<TInner, TAttribs> {\n public readonly [$internal] = {};\n public readonly type = 'loose-decorated';\n\n // Type-tokens, not available at runtime\n declare readonly [$invalidSchemaReason]:\n LooseDecorated[typeof $invalidSchemaReason];\n declare readonly [$validVertexSchema]: IsValidVertexSchema<TInner>;\n // ---\n}\n","import {\n type Decorate,\n type HasCustomLocation,\n type IsBuiltin,\n location,\n} from '../../data/attributes.ts';\nimport { isBuiltin } from '../../data/attributes.ts';\nimport { getCustomLocation, isData } from '../../data/dataTypes.ts';\nimport { INTERNAL_createStruct } from '../../data/struct.ts';\nimport {\n type BaseData,\n isVoid,\n type Location,\n type WgslStruct,\n} from '../../data/wgslTypes.ts';\n\nexport type WithLocations<T extends Record<string, BaseData>> = {\n [Key in keyof T]: IsBuiltin<T[Key]> extends true ? T[Key]\n : HasCustomLocation<T[Key]> extends true ? T[Key]\n : Decorate<T[Key], Location>;\n};\n\nexport type IOLayoutToSchema<T> = T extends BaseData\n ? HasCustomLocation<T> extends true ? T : Decorate<T, Location<0>>\n : T extends Record<string, BaseData> ? WgslStruct<WithLocations<T>>\n : T extends { type: 'void' } ? void\n : never;\n\nexport function withLocations<T extends BaseData>(\n members: Record<string, T> | undefined,\n locations: Record<string, number> = {},\n): Record<string, BaseData> {\n let nextLocation = 0;\n const usedCustomLocations = new Set<number>();\n\n return Object.fromEntries(\n Object.entries(members ?? {}).map(([key, member]) => {\n const customLocation = getCustomLocation(member);\n\n if (customLocation !== undefined) {\n if (usedCustomLocations.has(customLocation)) {\n throw new Error('Duplicate custom location attributes found');\n }\n usedCustomLocations.add(customLocation);\n }\n\n return [key, member] as const;\n }).map(([key, member]) => {\n if (isBuiltin(member)) { // skipping builtins\n return [key, member];\n }\n\n if (getCustomLocation(member) !== undefined) { // this member is already marked\n return [key, member];\n }\n\n if (locations[key]) { // location has been determined by a previous procedure\n return [key, location(locations[key], member)];\n }\n\n while (usedCustomLocations.has(nextLocation)) {\n nextLocation++;\n }\n return [key, location(nextLocation++, member)];\n }),\n );\n}\n\nexport function createIoSchema<\n T extends BaseData | Record<string, BaseData>,\n>(layout: T, locations: Record<string, number> = {}) {\n return (\n isData(layout)\n ? isVoid(layout)\n ? layout\n : isBuiltin(layout)\n ? layout\n : getCustomLocation(layout) !== undefined\n ? layout\n : location(0, layout)\n : INTERNAL_createStruct(\n withLocations(layout as Record<string, BaseData>, locations),\n /* isAbstruct */ false,\n )\n ) as IOLayoutToSchema<T>;\n}\n","import { createIoSchema } from '../core/function/ioSchema.ts';\nimport { isValidProp } from '../nameRegistry.ts';\nimport { getName, setName } from '../shared/meta.ts';\nimport { $internal, $repr, $resolve } from '../shared/symbols.ts';\nimport type { ResolutionCtx, SelfResolvable } from '../types.ts';\nimport type { ResolvedSnippet } from './snippet.ts';\nimport type { BaseData, WgslStruct } from './wgslTypes.ts';\n\n/**\n * A requirement for the generated struct is that non-builtin properties need to\n * have the same name in WGSL as they do in JS. This allows locations to be properly\n * matched between the Vertex output and Fragment input.\n */\nexport class AutoStruct implements BaseData, SelfResolvable {\n // Prototype properties\n declare [$internal]: Record<string, never>;\n declare type: 'auto-struct';\n\n // Type-tokens, not available at runtime\n declare readonly [$repr]: Record<string, unknown>;\n // ---\n\n /**\n * js key -> data type\n */\n readonly #validProps: Record<string, BaseData>;\n /**\n * js key -> { prop: 'wgsl key', type: ... }\n * @example '$position' -> { prop: 'position', type: ... }\n */\n readonly #allocated: Record<string, { prop: string; type: BaseData }>;\n\n #usedWgslKeys: Set<string>;\n #locations: Record<string, number> | undefined;\n #cachedStruct: WgslStruct | undefined;\n #typeForExtraProps: BaseData | undefined;\n\n constructor(\n validProps: Record<string, BaseData>,\n typeForExtraProps: BaseData | undefined,\n locations?: Record<string, number>,\n ) {\n this.#validProps = validProps;\n this.#typeForExtraProps = typeForExtraProps;\n this.#allocated = {};\n this.#locations = locations;\n this.#usedWgslKeys = new Set();\n }\n\n /**\n * Used for accessing builtins, varying and attributes in code.\n */\n accessProp(key: string): { prop: string; type: BaseData } | undefined {\n // If the prop is not found in validProps, we consider it an extra property\n const dataType = this.#validProps[key] ?? this.#typeForExtraProps;\n if (!dataType) {\n return undefined;\n }\n\n return this.provideProp(key, dataType);\n }\n\n /**\n * Used for providing new varyings.\n *\n * @privateRemarks\n * Internally used by `accessProp`.\n */\n provideProp(\n key: string,\n dataType: BaseData,\n ): { prop: string; type: BaseData } {\n let alloc = this.#allocated[key];\n if (!alloc) {\n const wgslKey = key.replaceAll('$', '');\n if (this.#usedWgslKeys.has(wgslKey)) {\n throw new Error(\n `Property name '${wgslKey}' causes naming clashes. Choose a different name.`,\n );\n }\n if (!isValidProp(wgslKey)) {\n throw new Error(\n `Property key '${key}' is a reserved WGSL word. Choose a different name.`,\n );\n }\n\n this.#usedWgslKeys.add(wgslKey);\n alloc = { prop: wgslKey, type: dataType };\n this.#allocated[key] = alloc;\n }\n\n return alloc;\n }\n\n get completeStruct() {\n if (!this.#cachedStruct) {\n this.#cachedStruct = createIoSchema(\n Object.fromEntries(\n Object.values(this.#allocated).map((alloc) => {\n return [alloc.prop, alloc.type];\n }),\n ),\n this.#locations,\n );\n const ownName = getName(this);\n // Passing the given name forward\n if (ownName) {\n setName(this.#cachedStruct, ownName);\n }\n }\n\n return this.#cachedStruct;\n }\n\n [$resolve](ctx: ResolutionCtx): ResolvedSnippet {\n return ctx.resolve(this.completeStruct);\n }\n\n toString(): string {\n return `auto-struct:${getName(this) ?? '<unnamed>'}`;\n }\n}\n\nAutoStruct.prototype[$internal] = {};\nAutoStruct.prototype.type = 'auto-struct';\n","import { stitch } from '../core/resolve/stitch.ts';\nimport { AutoStruct } from '../data/autoStruct.ts';\nimport {\n InfixDispatch,\n isUnstruct,\n MatrixColumnsAccess,\n undecorate,\n UnknownData,\n} from '../data/dataTypes.ts';\nimport { abstractInt, bool, f16, f32, i32, u32 } from '../data/numeric.ts';\nimport { derefSnippet } from '../data/ref.ts';\nimport { isEphemeralSnippet, snip, type Snippet } from '../data/snippet.ts';\nimport {\n vec2b,\n vec2f,\n vec2h,\n vec2i,\n vec2u,\n vec3b,\n vec3f,\n vec3h,\n vec3i,\n vec3u,\n vec4b,\n vec4f,\n vec4h,\n vec4i,\n vec4u,\n} from '../data/vector.ts';\nimport {\n type BaseData,\n isMat,\n isNaturallyEphemeral,\n isPtr,\n isVec,\n isWgslArray,\n isWgslStruct,\n} from '../data/wgslTypes.ts';\nimport { $gpuCallable } from '../shared/symbols.ts';\nimport { add, div, mod, mul, sub } from '../std/operators.ts';\nimport { isKnownAtComptime } from '../types.ts';\nimport { coerceToSnippet } from './generationHelpers.ts';\n\nconst infixKinds = [\n 'vec2f',\n 'vec3f',\n 'vec4f',\n 'vec2h',\n 'vec3h',\n 'vec4h',\n 'vec2i',\n 'vec3i',\n 'vec4i',\n 'vec2u',\n 'vec3u',\n 'vec4u',\n 'mat2x2f',\n 'mat3x3f',\n 'mat4x4f',\n];\n\nexport const infixOperators = {\n add,\n sub,\n mul,\n div,\n mod,\n} as const;\n\nexport type InfixOperator = keyof typeof infixOperators;\n\ntype SwizzleableType = 'f' | 'h' | 'i' | 'u' | 'b';\ntype SwizzleLength = 1 | 2 | 3 | 4;\n\nconst swizzleLenToType: Record<\n SwizzleableType,\n Record<SwizzleLength, BaseData>\n> = {\n f: {\n 1: f32,\n 2: vec2f,\n 3: vec3f,\n 4: vec4f,\n },\n h: {\n 1: f16,\n 2: vec2h,\n 3: vec3h,\n 4: vec4h,\n },\n i: {\n 1: i32,\n 2: vec2i,\n 3: vec3i,\n 4: vec4i,\n },\n u: {\n 1: u32,\n 2: vec2u,\n 3: vec3u,\n 4: vec4u,\n },\n b: {\n 1: bool,\n 2: vec2b,\n 3: vec3b,\n 4: vec4b,\n },\n} as const;\n\nexport function accessProp(\n target: Snippet,\n propName: string,\n): Snippet | undefined {\n if (\n infixKinds.includes((target.dataType as BaseData).type) &&\n propName in infixOperators\n ) {\n const operator = infixOperators[propName as InfixOperator];\n return snip(\n new InfixDispatch(\n propName,\n target,\n operator[$gpuCallable].call.bind(operator),\n ),\n UnknownData,\n /* origin */ target.origin,\n );\n }\n\n if (isWgslArray(target.dataType) && propName === 'length') {\n if (target.dataType.elementCount === 0) {\n // Dynamically-sized array\n return snip(stitch`arrayLength(&${target})`, u32, /* origin */ 'runtime');\n }\n\n return snip(\n target.dataType.elementCount,\n abstractInt,\n /* origin */ 'constant',\n );\n }\n\n if (isMat(target.dataType) && propName === 'columns') {\n return snip(\n new MatrixColumnsAccess(target),\n UnknownData,\n /* origin */ target.origin,\n );\n }\n\n if (isWgslStruct(target.dataType) || isUnstruct(target.dataType)) {\n let propType = target.dataType.propTypes[propName];\n if (!propType) {\n return undefined;\n }\n propType = undecorate(propType);\n\n return snip(\n stitch`${target}.${propName}`,\n propType,\n /* origin */ target.origin === 'argument'\n ? 'argument'\n : !isEphemeralSnippet(target) && !isNaturallyEphemeral(propType)\n ? target.origin\n : target.origin === 'constant' ||\n target.origin === 'constant-tgpu-const-ref'\n ? 'constant'\n : 'runtime',\n );\n }\n\n if (target.dataType instanceof AutoStruct) {\n const result = target.dataType.accessProp(propName);\n if (!result) {\n return undefined;\n }\n return snip(stitch`${target}.${result.prop}`, result.type, 'argument');\n }\n\n if (isPtr(target.dataType)) {\n const derefed = derefSnippet(target);\n\n if (propName === '$') {\n // Dereference pointer\n return derefed;\n }\n\n // Sometimes values that are typed as pointers aren't instances of `d.ref`, so we\n // allow access to member props as if it wasn't a pointer.\n return accessProp(derefed, propName);\n }\n\n if (isVec(target.dataType)) {\n // Example: d.vec3f().kind === 'vec3f'\n if (propName === 'kind') {\n return snip(target.dataType.type, UnknownData, 'constant');\n }\n }\n\n const propLength = propName.length;\n if (isVec(target.dataType) && propLength >= 1 && propLength <= 4) {\n const isXYZW = /^[xyzw]+$/.test(propName);\n const isRGBA = /^[rgba]+$/.test(propName);\n\n if (!isXYZW && !isRGBA) {\n // Not a valid swizzle\n return undefined;\n }\n\n const swizzleTypeChar = target.dataType.type.includes('bool')\n ? 'b'\n : (target.dataType.type[4] as SwizzleableType);\n const swizzleType =\n swizzleLenToType[swizzleTypeChar][propLength as SwizzleLength];\n if (!swizzleType) {\n return undefined;\n }\n\n return snip(\n isKnownAtComptime(target)\n // oxlint-disable-next-line typescript/no-explicit-any it's fine, the prop is there\n ? (target.value as any)[propName]\n : stitch`${target}.${propName}`,\n swizzleType,\n // Swizzling creates new vectors (unless they're on the lhs of an assignment, but that's not yet supported in WGSL)\n /* origin */ target.origin === 'argument' && propLength === 1\n ? 'argument'\n : target.origin === 'constant' ||\n target.origin === 'constant-tgpu-const-ref'\n ? 'constant'\n : 'runtime',\n );\n }\n\n if (isKnownAtComptime(target) || target.dataType === UnknownData) {\n // oxlint-disable-next-line typescript/no-explicit-any we either know exactly what it is, or have no idea at all\n return coerceToSnippet((target.value as any)[propName]);\n }\n\n return undefined;\n}\n","import { comptime } from '../core/function/comptime.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport { schemaCallWrapper } from './schemaCallWrapper.ts';\nimport { sizeOf } from './sizeOf.ts';\nimport type { AnyWgslData, WgslArray } from './wgslTypes.ts';\n\n// ----------\n// Public API\n// ----------\n\ninterface WgslArrayConstructor {\n <TElement extends AnyWgslData>(\n elementType: TElement,\n ): (elementCount: number) => WgslArray<TElement>;\n\n <TElement extends AnyWgslData>(\n elementType: TElement,\n elementCount: number,\n ): WgslArray<TElement>;\n}\n\n/**\n * Creates an array schema that can be used to construct gpu buffers.\n * Describes arrays with fixed-size length, storing elements of the same type.\n *\n * @example\n * const LENGTH = 3;\n * const array = d.arrayOf(d.u32, LENGTH);\n *\n * If `elementCount` is not specified, a partially applied function is returned.\n * @example\n * const array = d.arrayOf(d.vec3f);\n * // ^? (n: number) => WgslArray<d.Vec3f>\n *\n * @param elementType The type of elements in the array.\n * @param elementCount The number of elements in the array.\n */\nexport const arrayOf = comptime(\n ((elementType, elementCount) => {\n if (elementCount === undefined) {\n return comptime((count: number) => cpu_arrayOf(elementType, count));\n }\n return cpu_arrayOf(elementType, elementCount);\n }) as WgslArrayConstructor,\n).$name('arrayOf');\n\n// --------------\n// Implementation\n// --------------\n\nfunction cpu_arrayOf<TElement extends AnyWgslData>(\n elementType: TElement,\n elementCount: number,\n): WgslArray<TElement> {\n // In the schema call, create and return a deep copy\n // by wrapping all the values in `elementType` schema calls.\n const arraySchema = (elements?: TElement[]) => {\n if (elements && elements.length !== elementCount) {\n throw new Error(\n `Array schema of ${elementCount} elements of type ${elementType.type} called with ${elements.length} argument(s).`,\n );\n }\n\n return Array.from(\n { length: elementCount },\n (_, i) => schemaCallWrapper(elementType, elements?.[i]),\n );\n };\n Object.setPrototypeOf(arraySchema, WgslArrayImpl);\n\n if (Number.isNaN(sizeOf(elementType))) {\n throw new Error('Cannot nest runtime sized arrays.');\n }\n arraySchema.elementType = elementType;\n\n if (!Number.isInteger(elementCount) || elementCount < 0) {\n throw new Error(\n `Cannot create array schema with invalid element count: ${elementCount}.`,\n );\n }\n arraySchema.elementCount = elementCount;\n\n return arraySchema as unknown as WgslArray<TElement>;\n}\n\nconst WgslArrayImpl = {\n [$internal]: true,\n type: 'array',\n\n toString(this: WgslArray): string {\n return `arrayOf(${this.elementType}, ${this.elementCount})`;\n },\n};\n","import { arrayOf } from './data/array.ts';\nimport { attribute } from './data/attributes.ts';\nimport type { LooseDecorated } from './data/dataTypes.ts';\nimport { bool, f32, u32 } from './data/numeric.ts';\nimport { vec3u, vec4f } from './data/vector.ts';\nimport type {\n BaseData,\n Bool,\n Builtin,\n Decorated,\n F32,\n U32,\n Vec3u,\n Vec4f,\n WgslArray,\n} from './data/wgslTypes.ts';\nimport { $internal } from './shared/symbols.ts';\n\n// ----------\n// Public API\n// ----------\n\nexport type BuiltinVertexIndex = Decorated<U32, [Builtin<'vertex_index'>]>;\nexport type BuiltinInstanceIndex = Decorated<U32, [Builtin<'instance_index'>]>;\nexport type BuiltinClipDistances = Decorated<\n WgslArray<U32>,\n [Builtin<'clip_distances'>]\n>;\nexport type BuiltinPosition = Decorated<Vec4f, [Builtin<'position'>]>;\nexport type BuiltinFrontFacing = Decorated<Bool, [Builtin<'front_facing'>]>;\nexport type BuiltinFragDepth = Decorated<F32, [Builtin<'frag_depth'>]>;\nexport type BuiltinPrimitiveIndex = Decorated<\n U32,\n [Builtin<'primitive_index'>]\n>;\nexport type BuiltinSampleIndex = Decorated<U32, [Builtin<'sample_index'>]>;\nexport type BuiltinSampleMask = Decorated<U32, [Builtin<'sample_mask'>]>;\nexport type BuiltinLocalInvocationId = Decorated<\n Vec3u,\n [Builtin<'local_invocation_id'>]\n>;\nexport type BuiltinLocalInvocationIndex = Decorated<\n U32,\n [Builtin<'local_invocation_index'>]\n>;\nexport type BuiltinGlobalInvocationId = Decorated<\n Vec3u,\n [Builtin<'global_invocation_id'>]\n>;\nexport type BuiltinWorkgroupId = Decorated<Vec3u, [Builtin<'workgroup_id'>]>;\nexport type BuiltinNumWorkgroups = Decorated<\n Vec3u,\n [Builtin<'num_workgroups'>]\n>;\nexport type BuiltinSubgroupInvocationId = Decorated<\n U32,\n [Builtin<'subgroup_invocation_id'>]\n>;\nexport type BuiltinSubgroupSize = Decorated<U32, [Builtin<'subgroup_size'>]>;\nexport type BuiltinSubgroupId = Decorated<U32, [Builtin<'subgroup_id'>]>;\nexport type BuiltinNumSubgroups = Decorated<U32, [Builtin<'num_subgroups'>]>;\n\nfunction defineBuiltin<T extends Decorated | LooseDecorated>(\n dataType: BaseData,\n value: T['attribs'][0] extends { params: [infer TValue] } ? TValue : never,\n): T {\n return attribute(dataType, {\n [$internal]: true,\n type: '@builtin',\n // oxlint-disable-next-line typescript/no-explicit-any it's fine\n params: [value as any],\n }) as T;\n}\n\nexport const builtin = {\n vertexIndex: defineBuiltin<BuiltinVertexIndex>(u32, 'vertex_index'),\n instanceIndex: defineBuiltin<BuiltinInstanceIndex>(u32, 'instance_index'),\n clipDistances: defineBuiltin<BuiltinClipDistances>(\n arrayOf(u32, 8),\n 'clip_distances',\n ),\n position: defineBuiltin<BuiltinPosition>(vec4f, 'position'),\n frontFacing: defineBuiltin<BuiltinFrontFacing>(bool, 'front_facing'),\n fragDepth: defineBuiltin<BuiltinFragDepth>(f32, 'frag_depth'),\n primitiveIndex: defineBuiltin<BuiltinPrimitiveIndex>(u32, 'primitive_index'),\n sampleIndex: defineBuiltin<BuiltinSampleIndex>(u32, 'sample_index'),\n sampleMask: defineBuiltin<BuiltinSampleMask>(u32, 'sample_mask'),\n localInvocationId: defineBuiltin<BuiltinLocalInvocationId>(\n vec3u,\n 'local_invocation_id',\n ),\n localInvocationIndex: defineBuiltin<BuiltinLocalInvocationIndex>(\n u32,\n 'local_invocation_index',\n ),\n globalInvocationId: defineBuiltin<BuiltinGlobalInvocationId>(\n vec3u,\n 'global_invocation_id',\n ),\n workgroupId: defineBuiltin<BuiltinWorkgroupId>(vec3u, 'workgroup_id'),\n numWorkgroups: defineBuiltin<BuiltinNumWorkgroups>(vec3u, 'num_workgroups'),\n subgroupInvocationId: defineBuiltin<BuiltinSubgroupInvocationId>(\n u32,\n 'subgroup_invocation_id',\n ),\n subgroupSize: defineBuiltin<BuiltinSubgroupSize>(u32, 'subgroup_size'),\n subgroupId: defineBuiltin<BuiltinSubgroupId>(u32, 'subgroup_id'),\n numSubgroups: defineBuiltin<BuiltinNumSubgroups>(u32, 'num_subgroups'),\n} as const;\n\nexport type AnyBuiltin = (typeof builtin)[keyof typeof builtin];\nexport type AnyComputeBuiltin =\n | BuiltinLocalInvocationId\n | BuiltinLocalInvocationIndex\n | BuiltinGlobalInvocationId\n | BuiltinWorkgroupId\n | BuiltinNumWorkgroups\n | BuiltinSubgroupInvocationId\n | BuiltinSubgroupSize\n | BuiltinSubgroupId\n | BuiltinNumSubgroups;\nexport type AnyVertexInputBuiltin = BuiltinVertexIndex | BuiltinInstanceIndex;\nexport type AnyVertexOutputBuiltin = BuiltinClipDistances | BuiltinPosition;\nexport type AnyFragmentInputBuiltin =\n | BuiltinPosition\n | BuiltinFrontFacing\n | BuiltinPrimitiveIndex\n | BuiltinSampleIndex\n | BuiltinSampleMask\n | BuiltinSubgroupInvocationId\n | BuiltinSubgroupSize;\nexport type AnyFragmentOutputBuiltin = BuiltinFragDepth | BuiltinSampleMask;\n\nexport type OmitBuiltins<S> = S extends AnyBuiltin ? never\n : S extends BaseData ? S\n : {\n [\n Key in keyof S as S[Key] extends AnyBuiltin ? never\n : Key extends `$${string}` ? never\n : Key\n ]: S[Key];\n };\n"],"mappings":";;;AAkEA,IAAM,2BAAN,MACqC;CACnC,CAAiB,aAAa,EAAE;CAChC,CAAC;CASD,YAAY,AAAgB,MAAS;EAAT;AAC1B,OAAK,gBAAgB,EACnB,OAAO,KAAK,CAAC,OAAgB;AAC3B,UAAO,qBAAqB,KAAK,iBAAiB,KAAK,OAAO,EAAE;KAEnE;;CAGH,CAAC,OACC,GAC4B;AAC5B,SAAO,kBAAkB,iBAAiB,KAAK,OAAO,EAAE;;;AAI5D,MAAa,mBAAmB;CAC9B,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAA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AiC,KAAK,cAAc;CAChE,mBAAmB,cACjB,OACA,sBACD;CACD,sBAAsB,cACpB,KACA,yBACD;CACD,oBAAoB,cAClB,OACA,uBACD;CACD,aAAa,cAAkC,OAAO,eAAe;CACrE,eAAe,cAAoC,OAAO,iBAAiB;CAC3E,sBAAsB,cACpB,KACA,yBACD;CACD,cAAc,cAAmC,KAAK,gBAAgB;CACtE,YAAY,cAAiC,KAAK,cAAc;CAChE,cAAc,cAAmC,KAAK,gBAAgB;CACvE"}
|
|
1
|
+
{"version":3,"file":"builtin-DdtWpk2t.js","names":["#validProps","#allocated","#typeForExtraProps","#locations","#usedWgslKeys","#cachedStruct"],"sources":["../src/data/vertexFormatData.ts","../src/data/alignmentOf.ts","../src/mathUtils.ts","../src/data/schemaMemoryLayout.ts","../src/data/sizeOf.ts","../src/data/attributes.ts","../src/core/function/ioSchema.ts","../src/data/autoStruct.ts","../src/tgsl/accessProp.ts","../src/data/array.ts","../src/builtin.ts"],"sourcesContent":["import {\n $cast,\n $gpuCallable,\n $internal,\n isMarkedInternal,\n} from '../shared/symbols.ts';\nimport type { Infer } from '../shared/repr.ts';\nimport type {\n $invalidSchemaReason,\n $repr,\n $validVertexSchema,\n} from '../shared/symbols.ts';\nimport type { VertexFormat } from '../shared/vertexFormat.ts';\nimport { f32, i32, u32 } from './numeric.ts';\nimport {\n vec2f,\n vec2i,\n vec2u,\n vec3f,\n vec3i,\n vec3u,\n vec4f,\n vec4i,\n vec4u,\n} from './vector.ts';\nimport type { WithCast } from '../types.ts';\nimport {\n schemaCallWrapper,\n schemaCallWrapperGPU,\n} from './schemaCallWrapper.ts';\nimport type { Snippet } from './snippet.ts';\nimport type {\n BaseData,\n F16,\n F32,\n I32,\n U32,\n Vec2f,\n Vec2h,\n Vec2i,\n Vec2u,\n Vec3f,\n Vec3h,\n Vec3i,\n Vec3u,\n Vec4f,\n Vec4h,\n Vec4i,\n Vec4u,\n} from './wgslTypes.ts';\n\nexport type FormatToWGSLType<T extends VertexFormat> =\n (typeof formatToWGSLType)[T];\n\nexport interface TgpuVertexFormatData<T extends VertexFormat>\n extends BaseData, WithCast<FormatToWGSLType<T>> {\n readonly type: T;\n\n // Type-tokens, not available at runtime\n readonly [$repr]: Infer<FormatToWGSLType<T>>;\n readonly [$validVertexSchema]: true;\n readonly [$invalidSchemaReason]:\n 'Vertex formats are not host-shareable, use concrete types instead';\n // ---\n}\n\nclass TgpuVertexFormatDataImpl<T extends VertexFormat>\n implements TgpuVertexFormatData<T> {\n public readonly [$internal] = {};\n [$gpuCallable]: TgpuVertexFormatData<T>[typeof $gpuCallable];\n\n // Type-tokens, not available at runtime\n declare readonly [$repr]: Infer<FormatToWGSLType<T>>;\n declare readonly [$validVertexSchema]: true;\n declare readonly [$invalidSchemaReason]:\n 'Vertex formats are not host-shareable, use concrete types instead';\n // ---\n\n constructor(public readonly type: T) {\n this[$gpuCallable] = {\n call: (ctx, [v]): Snippet => {\n return schemaCallWrapperGPU(ctx, formatToWGSLType[this.type], v);\n },\n };\n }\n\n [$cast](\n v?: Infer<FormatToWGSLType<T>>,\n ): Infer<FormatToWGSLType<T>> {\n return schemaCallWrapper(formatToWGSLType[this.type], v);\n }\n}\n\nexport const formatToWGSLType = {\n uint8: u32,\n uint8x2: vec2u,\n uint8x4: vec4u,\n sint8: i32,\n sint8x2: vec2i,\n sint8x4: vec4i,\n unorm8: f32,\n unorm8x2: vec2f,\n unorm8x4: vec4f,\n snorm8: f32,\n snorm8x2: vec2f,\n snorm8x4: vec4f,\n uint16: u32,\n uint16x2: vec2u,\n uint16x4: vec4u,\n sint16: i32,\n sint16x2: vec2i,\n sint16x4: vec4i,\n unorm16: f32,\n unorm16x2: vec2f,\n unorm16x4: vec4f,\n snorm16: f32,\n snorm16x2: vec2f,\n snorm16x4: vec4f,\n float16: f32,\n float16x2: vec2f,\n float16x4: vec4f,\n float32: f32,\n float32x2: vec2f,\n float32x3: vec3f,\n float32x4: vec4f,\n uint32: u32,\n uint32x2: vec2u,\n uint32x3: vec3u,\n uint32x4: vec4u,\n sint32: i32,\n sint32x2: vec2i,\n sint32x3: vec3i,\n sint32x4: vec4i,\n 'unorm10-10-10-2': vec4f,\n 'unorm8x4-bgra': vec4f,\n} as const;\n\nexport const packedFormats = new Set(Object.keys(formatToWGSLType));\n\nexport type uint8 = TgpuVertexFormatData<'uint8'>;\nexport const uint8 = new TgpuVertexFormatDataImpl('uint8') as uint8;\n\nexport type uint8x2 = TgpuVertexFormatData<'uint8x2'>;\nexport const uint8x2 = new TgpuVertexFormatDataImpl('uint8x2') as uint8x2;\n\nexport type uint8x4 = TgpuVertexFormatData<'uint8x4'>;\nexport const uint8x4 = new TgpuVertexFormatDataImpl('uint8x4') as uint8x4;\n\nexport type sint8 = TgpuVertexFormatData<'sint8'>;\nexport const sint8 = new TgpuVertexFormatDataImpl('sint8') as sint8;\n\nexport type sint8x2 = TgpuVertexFormatData<'sint8x2'>;\nexport const sint8x2 = new TgpuVertexFormatDataImpl('sint8x2') as sint8x2;\n\nexport type sint8x4 = TgpuVertexFormatData<'sint8x4'>;\nexport const sint8x4 = new TgpuVertexFormatDataImpl('sint8x4') as sint8x4;\n\nexport type unorm8 = TgpuVertexFormatData<'unorm8'>;\nexport const unorm8 = new TgpuVertexFormatDataImpl('unorm8') as unorm8;\n\nexport type unorm8x2 = TgpuVertexFormatData<'unorm8x2'>;\nexport const unorm8x2 = new TgpuVertexFormatDataImpl('unorm8x2') as unorm8x2;\n\nexport type unorm8x4 = TgpuVertexFormatData<'unorm8x4'>;\nexport const unorm8x4 = new TgpuVertexFormatDataImpl('unorm8x4') as unorm8x4;\n\nexport type snorm8 = TgpuVertexFormatData<'snorm8'>;\nexport const snorm8 = new TgpuVertexFormatDataImpl('snorm8') as snorm8;\n\nexport type snorm8x2 = TgpuVertexFormatData<'snorm8x2'>;\nexport const snorm8x2 = new TgpuVertexFormatDataImpl('snorm8x2') as snorm8x2;\n\nexport type snorm8x4 = TgpuVertexFormatData<'snorm8x4'>;\nexport const snorm8x4 = new TgpuVertexFormatDataImpl('snorm8x4') as snorm8x4;\n\nexport type uint16 = TgpuVertexFormatData<'uint16'>;\nexport const uint16 = new TgpuVertexFormatDataImpl('uint16') as uint16;\n\nexport type uint16x2 = TgpuVertexFormatData<'uint16x2'>;\nexport const uint16x2 = new TgpuVertexFormatDataImpl('uint16x2') as uint16x2;\n\nexport type uint16x4 = TgpuVertexFormatData<'uint16x4'>;\nexport const uint16x4 = new TgpuVertexFormatDataImpl('uint16x4') as uint16x4;\n\nexport type sint16 = TgpuVertexFormatData<'sint16'>;\nexport const sint16 = new TgpuVertexFormatDataImpl('sint16') as sint16;\n\nexport type sint16x2 = TgpuVertexFormatData<'sint16x2'>;\nexport const sint16x2 = new TgpuVertexFormatDataImpl('sint16x2') as sint16x2;\n\nexport type sint16x4 = TgpuVertexFormatData<'sint16x4'>;\nexport const sint16x4 = new TgpuVertexFormatDataImpl('sint16x4') as sint16x4;\n\nexport type unorm16 = TgpuVertexFormatData<'unorm16'>;\nexport const unorm16 = new TgpuVertexFormatDataImpl('unorm16') as unorm16;\n\nexport type unorm16x2 = TgpuVertexFormatData<'unorm16x2'>;\nexport const unorm16x2 = new TgpuVertexFormatDataImpl('unorm16x2') as unorm16x2;\n\nexport type unorm16x4 = TgpuVertexFormatData<'unorm16x4'>;\nexport const unorm16x4 = new TgpuVertexFormatDataImpl('unorm16x4') as unorm16x4;\n\nexport type snorm16 = TgpuVertexFormatData<'snorm16'>;\nexport const snorm16 = new TgpuVertexFormatDataImpl('snorm16') as snorm16;\n\nexport type snorm16x2 = TgpuVertexFormatData<'snorm16x2'>;\nexport const snorm16x2 = new TgpuVertexFormatDataImpl('snorm16x2') as snorm16x2;\n\nexport type snorm16x4 = TgpuVertexFormatData<'snorm16x4'>;\nexport const snorm16x4 = new TgpuVertexFormatDataImpl('snorm16x4') as snorm16x4;\n\nexport type float16 = TgpuVertexFormatData<'float16'>;\nexport const float16 = new TgpuVertexFormatDataImpl('float16') as float16;\n\nexport type float16x2 = TgpuVertexFormatData<'float16x2'>;\nexport const float16x2 = new TgpuVertexFormatDataImpl('float16x2') as float16x2;\n\nexport type float16x4 = TgpuVertexFormatData<'float16x4'>;\nexport const float16x4 = new TgpuVertexFormatDataImpl('float16x4') as float16x4;\n\nexport type float32 = TgpuVertexFormatData<'float32'>;\nexport const float32 = new TgpuVertexFormatDataImpl('float32') as float32;\n\nexport type float32x2 = TgpuVertexFormatData<'float32x2'>;\nexport const float32x2 = new TgpuVertexFormatDataImpl('float32x2') as float32x2;\n\nexport type float32x3 = TgpuVertexFormatData<'float32x3'>;\nexport const float32x3 = new TgpuVertexFormatDataImpl('float32x3') as float32x3;\n\nexport type float32x4 = TgpuVertexFormatData<'float32x4'>;\nexport const float32x4 = new TgpuVertexFormatDataImpl('float32x4') as float32x4;\n\nexport type uint32 = TgpuVertexFormatData<'uint32'>;\nexport const uint32 = new TgpuVertexFormatDataImpl('uint32') as uint32;\n\nexport type uint32x2 = TgpuVertexFormatData<'uint32x2'>;\nexport const uint32x2 = new TgpuVertexFormatDataImpl('uint32x2') as uint32x2;\n\nexport type uint32x3 = TgpuVertexFormatData<'uint32x3'>;\nexport const uint32x3 = new TgpuVertexFormatDataImpl('uint32x3') as uint32x3;\n\nexport type uint32x4 = TgpuVertexFormatData<'uint32x4'>;\nexport const uint32x4 = new TgpuVertexFormatDataImpl('uint32x4') as uint32x4;\n\nexport type sint32 = TgpuVertexFormatData<'sint32'>;\nexport const sint32 = new TgpuVertexFormatDataImpl('sint32') as sint32;\n\nexport type sint32x2 = TgpuVertexFormatData<'sint32x2'>;\nexport const sint32x2 = new TgpuVertexFormatDataImpl('sint32x2') as sint32x2;\n\nexport type sint32x3 = TgpuVertexFormatData<'sint32x3'>;\nexport const sint32x3 = new TgpuVertexFormatDataImpl('sint32x3') as sint32x3;\n\nexport type sint32x4 = TgpuVertexFormatData<'sint32x4'>;\nexport const sint32x4 = new TgpuVertexFormatDataImpl('sint32x4') as sint32x4;\n\nexport type unorm10_10_10_2 = TgpuVertexFormatData<'unorm10-10-10-2'>;\nexport const unorm10_10_10_2 = new TgpuVertexFormatDataImpl(\n 'unorm10-10-10-2',\n) as unorm10_10_10_2;\n\nexport type unorm8x4_bgra = TgpuVertexFormatData<'unorm8x4-bgra'>;\nexport const unorm8x4_bgra = new TgpuVertexFormatDataImpl(\n 'unorm8x4-bgra',\n) as unorm8x4_bgra;\n\nexport type PackedData =\n | uint8\n | uint8x2\n | uint8x4\n | sint8\n | sint8x2\n | sint8x4\n | unorm8\n | unorm8x2\n | unorm8x4\n | snorm8\n | snorm8x2\n | snorm8x4\n | uint16\n | uint16x2\n | uint16x4\n | sint16\n | sint16x2\n | sint16x4\n | unorm16\n | unorm16x2\n | unorm16x4\n | snorm16\n | snorm16x2\n | snorm16x4\n | float16\n | float16x2\n | float16x4\n | float32\n | float32x2\n | float32x3\n | float32x4\n | uint32\n | uint32x2\n | uint32x3\n | uint32x4\n | sint32\n | sint32x2\n | sint32x3\n | sint32x4\n | unorm10_10_10_2\n | unorm8x4_bgra;\n\nexport function isPackedData(value: unknown): value is PackedData {\n return (\n isMarkedInternal(value) && packedFormats.has((value as PackedData)?.type)\n );\n}\n\ntype U32Data = U32 | Vec2u | Vec3u | Vec4u;\ntype I32Data = I32 | Vec2i | Vec3i | Vec4i;\ntype FloatData = F32 | Vec2f | Vec3f | Vec4f | F16 | Vec2h | Vec3h | Vec4h;\n\nexport type FormatToAcceptedData = {\n uint8: U32Data;\n uint8x2: U32Data;\n uint8x4: U32Data;\n sint8: I32Data;\n sint8x2: I32Data;\n sint8x4: I32Data;\n unorm8: FloatData;\n unorm8x2: FloatData;\n unorm8x4: FloatData;\n snorm8: FloatData;\n snorm8x2: FloatData;\n snorm8x4: FloatData;\n uint16: U32Data;\n uint16x2: U32Data;\n uint16x4: U32Data;\n sint16: I32Data;\n sint16x2: I32Data;\n sint16x4: I32Data;\n unorm16: FloatData;\n unorm16x2: FloatData;\n unorm16x4: FloatData;\n snorm16: FloatData;\n snorm16x2: FloatData;\n snorm16x4: FloatData;\n float16: FloatData;\n float16x2: FloatData;\n float16x4: FloatData;\n float32: FloatData;\n float32x2: FloatData;\n float32x3: FloatData;\n float32x4: FloatData;\n uint32: U32Data;\n uint32x2: U32Data;\n uint32x3: U32Data;\n uint32x4: U32Data;\n sint32: I32Data;\n sint32x2: I32Data;\n sint32x3: I32Data;\n sint32x4: I32Data;\n 'unorm10-10-10-2': FloatData;\n 'unorm8x4-bgra': FloatData;\n};\n","import { safeStringify } from '../shared/stringify.ts';\nimport {\n type AnyData,\n getCustomAlignment,\n isDisarray,\n isLooseDecorated,\n isUnstruct,\n} from './dataTypes.ts';\nimport { packedFormats } from './vertexFormatData.ts';\nimport {\n type BaseData,\n isDecorated,\n isWgslArray,\n isWgslStruct,\n} from './wgslTypes.ts';\n\nconst knownAlignmentMap: Record<string, number> = {\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4,\n bool: 4,\n u16: 2,\n vec2f: 8,\n vec2h: 4,\n vec2i: 8,\n vec2u: 8,\n 'vec2<bool>': 8,\n vec3f: 16,\n vec3h: 8,\n vec3i: 16,\n vec3u: 16,\n 'vec3<bool>': 16,\n vec4f: 16,\n vec4h: 8,\n vec4i: 16,\n vec4u: 16,\n 'vec4<bool>': 16,\n mat2x2f: 8,\n mat3x3f: 16,\n mat4x4f: 16,\n atomic: 4,\n};\n\nfunction computeAlignment(data: object): number {\n const dataType = (data as BaseData)?.type;\n const knownAlignment = knownAlignmentMap[dataType];\n if (knownAlignment !== undefined) {\n return knownAlignment;\n }\n\n if (isWgslStruct(data)) {\n return Object.values(data.propTypes)\n .map(alignmentOf)\n .reduce((a, b) => (a > b ? a : b));\n }\n\n if (isWgslArray(data)) {\n return alignmentOf(data.elementType);\n }\n\n if (isUnstruct(data)) {\n // A loose struct is aligned to its first property.\n const firstProp = Object.values(data.propTypes)[0];\n return firstProp ? (getCustomAlignment(firstProp) ?? 1) : 1;\n }\n\n if (isDisarray(data)) {\n return getCustomAlignment(data.elementType) ?? 1;\n }\n\n if (isDecorated(data) || isLooseDecorated(data)) {\n return getCustomAlignment(data) ?? alignmentOf(data.inner);\n }\n\n if (packedFormats.has(dataType)) {\n return 1;\n }\n\n throw new Error(\n `Cannot determine alignment of data: ${safeStringify(data)}`,\n );\n}\n\nfunction computeCustomAlignment(data: BaseData): number {\n if (isUnstruct(data)) {\n // A loose struct is aligned to its first property.\n const firstProp = Object.values(data.propTypes)[0];\n return firstProp ? customAlignmentOf(firstProp) : 1;\n }\n\n if (isDisarray(data)) {\n return customAlignmentOf(data.elementType);\n }\n\n if (isLooseDecorated(data)) {\n return getCustomAlignment(data) ?? customAlignmentOf(data.inner);\n }\n\n return getCustomAlignment(data) ?? 1;\n}\n\n/**\n * Since alignments can be inferred from data types, they are not stored on them.\n * Instead, this weak map acts as an extended property of those data types.\n */\nconst cachedAlignments = new WeakMap<object, number>();\n\nconst cachedCustomAlignments = new WeakMap<object, number>();\n\nexport function alignmentOf(data: BaseData): number {\n let alignment = cachedAlignments.get(data);\n if (alignment === undefined) {\n alignment = computeAlignment(data);\n cachedAlignments.set(data, alignment);\n }\n\n return alignment;\n}\n\nexport function customAlignmentOf(data: BaseData): number {\n let alignment = cachedCustomAlignments.get(data);\n if (alignment === undefined) {\n alignment = computeCustomAlignment(data);\n cachedCustomAlignments.set(data, alignment);\n }\n\n return alignment;\n}\n\n/**\n * Returns the alignment (in bytes) of data represented by the `schema`.\n */\nexport function PUBLIC_alignmentOf(schema: AnyData): number {\n return alignmentOf(schema);\n}\n","/**\n * @param value\n * @param modulo has to be power of 2\n */\nexport const roundUp = (value: number, modulo: number) => {\n const bitMask = modulo - 1;\n const invBitMask = ~bitMask;\n return (value & bitMask) === 0 ? value : (value & invBitMask) + modulo;\n};\n","import { roundUp } from '../mathUtils.ts';\nimport { alignmentOf, customAlignmentOf } from './alignmentOf.ts';\nimport type { Disarray, LooseTypeLiteral, Unstruct } from './dataTypes.ts';\nimport {\n getCustomSize,\n isDisarray,\n isLooseDecorated,\n isUnstruct,\n undecorate,\n} from './dataTypes.ts';\nimport type {\n BaseData,\n WgslArray,\n WgslStruct,\n WgslTypeLiteral,\n} from './wgslTypes.ts';\nimport { isDecorated, isWgslArray, isWgslStruct } from './wgslTypes.ts';\n\nconst knownSizesMap: Record<string, number> = {\n bool: 4,\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4,\n u16: 2,\n vec2f: 8,\n vec2h: 4,\n vec2i: 8,\n vec2u: 8,\n 'vec2<bool>': 8,\n vec3f: 12,\n vec3h: 6,\n vec3i: 12,\n vec3u: 12,\n 'vec3<bool>': 12,\n vec4f: 16,\n vec4h: 8,\n vec4i: 16,\n vec4u: 16,\n 'vec4<bool>': 16,\n mat2x2f: 16,\n mat3x3f: 48,\n mat4x4f: 64,\n uint8: 1,\n uint8x2: 2,\n uint8x4: 4,\n sint8: 1,\n sint8x2: 2,\n sint8x4: 4,\n unorm8: 1,\n unorm8x2: 2,\n unorm8x4: 4,\n snorm8: 1,\n snorm8x2: 2,\n snorm8x4: 4,\n uint16: 2,\n uint16x2: 4,\n uint16x4: 8,\n sint16: 2,\n sint16x2: 4,\n sint16x4: 8,\n unorm16: 2,\n unorm16x2: 4,\n unorm16x4: 8,\n snorm16: 2,\n snorm16x2: 4,\n snorm16x4: 8,\n float16: 2,\n float16x2: 4,\n float16x4: 8,\n float32: 4,\n float32x2: 8,\n float32x3: 12,\n float32x4: 16,\n uint32: 4,\n uint32x2: 8,\n uint32x3: 12,\n uint32x4: 16,\n sint32: 4,\n sint32x2: 8,\n sint32x3: 12,\n sint32x4: 16,\n 'unorm10-10-10-2': 4,\n 'unorm8x4-bgra': 4,\n atomic: 4,\n} satisfies Partial<Record<WgslTypeLiteral | LooseTypeLiteral, number>>;\n\ninterface SchemaMemoryLayout {\n isContiguous: boolean;\n size: number;\n longestContiguousPrefix: number;\n}\n\nfunction computeMLOfStruct(struct: WgslStruct): SchemaMemoryLayout {\n let size = 0;\n let longestContiguousPrefix = 0;\n let isContiguous = true;\n let prefixEnd = false;\n\n for (const property of Object.values(struct.propTypes)) {\n if (Number.isNaN(size)) {\n throw new Error('Only the last property of a struct can be unbounded');\n }\n\n const prevSize = size;\n size = roundUp(size, alignmentOf(property));\n\n const hasPadding = prevSize !== size;\n\n const propLayout = computeMemoryLayout(property);\n size += propLayout.size;\n\n if (Number.isNaN(size) && property.type !== 'array') {\n throw new Error('Cannot nest unbounded struct within another struct');\n }\n\n if (prefixEnd) {\n continue;\n }\n\n if (!hasPadding && propLayout.isContiguous) {\n longestContiguousPrefix += propLayout.size;\n } else {\n prefixEnd = true;\n isContiguous = false;\n if (!hasPadding) {\n longestContiguousPrefix += propLayout.longestContiguousPrefix;\n }\n }\n }\n\n const trueSize = roundUp(size, alignmentOf(struct));\n\n return {\n isContiguous: size === trueSize && isContiguous,\n size: trueSize,\n longestContiguousPrefix,\n };\n}\n\nfunction computeMLOfUnstruct(data: Unstruct): SchemaMemoryLayout {\n let size = 0;\n let longestContiguousPrefix = 0;\n let isContiguous = true;\n let prefixEnd = false;\n\n for (const property of Object.values(data.propTypes)) {\n const alignment = customAlignmentOf(property);\n const prevSize = size;\n size = roundUp(size, alignment);\n\n const hasPadding = prevSize !== size;\n if (hasPadding) {\n isContiguous = false;\n }\n\n const propLayout = computeMemoryLayout(property);\n size += propLayout.size;\n\n if (prefixEnd) {\n continue;\n }\n\n if (!hasPadding && propLayout.isContiguous) {\n longestContiguousPrefix += propLayout.size;\n } else {\n prefixEnd = true;\n isContiguous = false;\n if (!hasPadding) {\n longestContiguousPrefix += propLayout.longestContiguousPrefix;\n }\n }\n }\n\n return {\n isContiguous: isContiguous,\n size,\n longestContiguousPrefix,\n };\n}\n\nfunction computeMLOfWgslArray(data: WgslArray): SchemaMemoryLayout {\n const elementType = data.elementType;\n const elementMemoryLayout = computeMemoryLayout(elementType);\n const elementSize = elementMemoryLayout.size;\n const stride = roundUp(elementSize, alignmentOf(elementType));\n\n const hasPadding = stride > elementSize;\n const isContiguous = !hasPadding && elementMemoryLayout.isContiguous;\n\n const size = data.elementCount === 0\n ? Number.NaN\n : data.elementCount * stride;\n\n let longestContiguousPrefix: number;\n if (isContiguous) {\n longestContiguousPrefix = size;\n } else {\n longestContiguousPrefix = elementMemoryLayout.longestContiguousPrefix;\n }\n\n return { size, isContiguous, longestContiguousPrefix };\n}\n\nfunction computeMLOfDisarray(data: Disarray): SchemaMemoryLayout {\n const elementType = data.elementType;\n const elementMemoryLayout = computeMemoryLayout(elementType);\n const elementSize = elementMemoryLayout.size;\n const stride = roundUp(elementSize, customAlignmentOf(elementType));\n\n const hasPadding = stride > elementSize;\n const isContiguous = !hasPadding && elementMemoryLayout.isContiguous;\n\n const size = data.elementCount * stride;\n\n let longestContiguousPrefix: number;\n if (isContiguous) {\n longestContiguousPrefix = size;\n } else {\n longestContiguousPrefix = elementMemoryLayout.longestContiguousPrefix;\n }\n\n return { size, isContiguous, longestContiguousPrefix };\n}\n\nfunction computeMemoryLayout(data: BaseData): SchemaMemoryLayout {\n const knownSize = knownSizesMap[data.type];\n\n if (knownSize !== undefined) {\n return {\n isContiguous: data.type !== 'mat3x3f',\n size: knownSize,\n longestContiguousPrefix: data.type === 'mat3x3f' ? 12 : knownSize,\n };\n }\n\n if (isWgslStruct(data)) {\n return computeMLOfStruct(data);\n }\n\n if (isUnstruct(data)) {\n return computeMLOfUnstruct(data);\n }\n\n if (isWgslArray(data)) {\n return computeMLOfWgslArray(data);\n }\n\n if (isDisarray(data)) {\n return computeMLOfDisarray(data);\n }\n\n if (isDecorated(data) || isLooseDecorated(data)) {\n const size = getCustomSize(data);\n const undecoratedLayout = computeMemoryLayout(undecorate(data));\n\n if (size) {\n const isContiguous = size === undecoratedLayout.size &&\n undecoratedLayout.isContiguous;\n\n return {\n isContiguous,\n size,\n longestContiguousPrefix: undecoratedLayout.longestContiguousPrefix,\n };\n }\n return computeMemoryLayout(data.inner);\n }\n\n throw new Error(`Cannot determine memory layout of data: ${data}`);\n}\n\n/**\n * Since memory layout can be inferred from data types, they are not stored on them.\n * Instead, this weak map acts as an extended property of those data types.\n */\nconst cachedLayouts = new WeakMap<BaseData, SchemaMemoryLayout>();\n\nexport function getLayoutInfo<T extends keyof SchemaMemoryLayout>(\n schema: BaseData,\n key: T,\n): SchemaMemoryLayout[T] {\n let layout = cachedLayouts.get(schema);\n\n if (layout === undefined) {\n layout = computeMemoryLayout(schema);\n cachedLayouts.set(schema, layout);\n }\n\n return layout[key];\n}\n","import type { AnyData } from './dataTypes.ts';\nimport type { BaseData } from './wgslTypes.ts';\nimport { getLayoutInfo } from './schemaMemoryLayout.ts';\n\nexport function sizeOf(schema: BaseData): number {\n return getLayoutInfo(schema, 'size');\n}\n\n/**\n * Returns the size (in bytes) of data represented by the `schema`.\n */\nexport function PUBLIC_sizeOf(schema: AnyData): number {\n return sizeOf(schema);\n}\n","import type {\n Infer,\n InferGPU,\n InferPartial,\n IsValidStorageSchema,\n IsValidUniformSchema,\n IsValidVertexSchema,\n MemIdentity,\n} from '../shared/repr.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport {\n $gpuRepr,\n $invalidSchemaReason,\n $memIdent,\n $repr,\n $reprPartial,\n $validStorageSchema,\n $validUniformSchema,\n $validVertexSchema,\n} from '../shared/symbols.ts';\nimport { alignmentOf } from './alignmentOf.ts';\nimport {\n type AnyData,\n type AnyLooseData,\n type IsLooseData,\n isLooseData,\n isLooseDecorated,\n type LooseDecorated,\n type Undecorate,\n} from './dataTypes.ts';\nimport { sizeOf } from './sizeOf.ts';\nimport {\n type Align,\n type AnyWgslData,\n type BaseData,\n type Builtin,\n type Decorated,\n type FlatInterpolatableData,\n type FlatInterpolationType,\n type Interpolate,\n type InterpolationType,\n type Invariant,\n isAlignAttrib,\n isBuiltinAttrib,\n isDecorated,\n isSizeAttrib,\n type IsWgslData,\n isWgslData,\n type Location,\n type PerspectiveOrLinearInterpolatableData,\n type PerspectiveOrLinearInterpolationType,\n type Size,\n type Vec4f,\n} from './wgslTypes.ts';\n\n// ----------\n// Public API\n// ----------\n\nexport const builtinNames = [\n 'vertex_index',\n 'instance_index',\n 'clip_distances',\n 'position',\n 'front_facing',\n 'frag_depth',\n 'primitive_index',\n 'sample_index',\n 'sample_mask',\n 'fragment',\n 'local_invocation_id',\n 'local_invocation_index',\n 'global_invocation_id',\n 'workgroup_id',\n 'num_workgroups',\n 'subgroup_invocation_id',\n 'subgroup_size',\n 'subgroup_id',\n 'num_subgroups',\n] as const;\n\nexport type BuiltinName = (typeof builtinNames)[number];\n\nexport type AnyAttribute<\n AllowedBuiltins extends Builtin<BuiltinName> = Builtin<BuiltinName>,\n> =\n | Align<number>\n | Size<number>\n | Location\n | Interpolate\n | Invariant\n | AllowedBuiltins;\n\nexport type ExtractAttributes<T> = T extends {\n readonly attribs: unknown[];\n} ? T['attribs']\n : [];\n\n/**\n * Decorates a data-type `TData` with an attribute `TAttrib`.\n *\n * - if `TData` is loose\n * - if `TData` is already `LooseDecorated`\n * - Prepend `TAttrib` to the existing attribute tuple.\n * - else\n * - Wrap `TData` with `LooseDecorated` and a single attribute `[TAttrib]`\n * - else\n * - if `TData` is already `Decorated`\n * - Prepend `TAttrib` to the existing attribute tuple.\n * - else\n * - Wrap `TData` with `Decorated` and a single attribute `[TAttrib]`\n */\nexport type Decorate<\n TData extends BaseData,\n TAttrib extends AnyAttribute,\n> = IsWgslData<TData> extends true\n ? Decorated<Undecorate<TData>, [TAttrib, ...ExtractAttributes<TData>]>\n : IsLooseData<TData> extends true\n ? LooseDecorated<Undecorate<TData>, [TAttrib, ...ExtractAttributes<TData>]>\n : never;\n\nexport type IsBuiltin<T> = ExtractAttributes<T>[number] extends [] ? false\n : ExtractAttributes<T>[number] extends Builtin<BuiltinName> ? true\n : false;\n\nexport type HasCustomLocation<T> = ExtractAttributes<T>[number] extends []\n ? false\n : ExtractAttributes<T>[number] extends Location ? true\n : false;\n\nexport function attribute(\n data: BaseData,\n attrib: AnyAttribute,\n): Decorated | LooseDecorated {\n if (isDecorated(data)) {\n return new DecoratedImpl(data.inner, [attrib, ...data.attribs]);\n }\n\n if (isLooseDecorated(data)) {\n return new LooseDecoratedImpl(data.inner, [attrib, ...data.attribs]);\n }\n\n if (isLooseData(data)) {\n return new LooseDecoratedImpl(data, [attrib]) as unknown as LooseDecorated;\n }\n\n return new DecoratedImpl(data, [attrib]) as unknown as Decorated;\n}\n\n/**\n * Gives the wrapped data-type a custom byte alignment. Useful in order to\n * fulfill uniform alignment requirements.\n *\n * @example\n * const Data = d.struct({\n * a: u32, // takes up 4 bytes\n * // 12 bytes of padding, because `b` is custom aligned to multiples of 16 bytes\n * b: d.align(16, u32),\n * });\n *\n * @param alignment The multiple of bytes this data should align itself to.\n * @param data The data-type to align.\n */\nexport function align<TAlign extends number, TData extends AnyData>(\n alignment: TAlign,\n data: TData,\n): Decorate<TData, Align<TAlign>> {\n return attribute(data, {\n [$internal]: true,\n type: '@align',\n params: [alignment],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Adds padding bytes after the wrapped data-type, until the whole value takes up `size` bytes.\n *\n * @example\n * const Data = d.struct({\n * a: d.size(16, u32), // takes up 16 bytes, instead of 4\n * b: u32, // starts at byte 16, because `a` has a custom size\n * });\n *\n * @param size The amount of bytes that should be reserved for this data-type.\n * @param data The data-type to wrap.\n */\nexport function size<TSize extends number, TData extends AnyData>(\n size: TSize,\n data: TData,\n): Decorate<TData, Size<TSize>> {\n return attribute(data, {\n [$internal]: true,\n type: '@size',\n params: [size],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Assigns an explicit numeric location to a struct member or a parameter that has this type.\n *\n * @example\n * const VertexOutput = {\n * a: d.u32, // has implicit location 0\n * b: d.location(5, d.u32),\n * c: d.u32, // has implicit location 6\n * };\n *\n * @param location The explicit numeric location.\n * @param data The data-type to wrap.\n */\nexport function location<TLocation extends number, TData extends BaseData>(\n location: TLocation,\n data: TData,\n): Decorate<TData, Location<TLocation>> {\n return attribute(data, {\n [$internal]: true,\n type: '@location',\n params: [location],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Specifies how user-defined vertex shader output (fragment shader input)\n * must be interpolated.\n *\n * Tip: Integer outputs cannot be interpolated.\n *\n * @example\n * const VertexOutput = {\n * a: d.f32, // has implicit 'perspective, center' interpolation\n * b: d.interpolate('linear, sample', d.f32),\n * };\n *\n * @param interpolationType How data should be interpolated.\n * @param data The data-type to wrap.\n */\nexport function interpolate<\n TInterpolation extends PerspectiveOrLinearInterpolationType,\n TData extends PerspectiveOrLinearInterpolatableData,\n>(\n interpolationType: TInterpolation,\n data: TData,\n): Decorate<TData, Interpolate<TInterpolation>>;\n\n/**\n * Specifies how user-defined vertex shader output (fragment shader input)\n * must be interpolated.\n *\n * Tip: Default sampling method of `flat` is `first`. Unless you specifically\n * need deterministic behavior provided by `'flat, first'`, prefer explicit\n * `'flat, either'` as it could be slightly faster in hardware.\n *\n * @example\n * const VertexOutput = {\n * a: d.f32, // has implicit 'perspective, center' interpolation\n * b: d.interpolate('flat, either', d.u32), // integer outputs cannot interpolate\n * };\n *\n * @param interpolationType How data should be interpolated.\n * @param data The data-type to wrap.\n */\nexport function interpolate<\n TInterpolation extends FlatInterpolationType,\n TData extends FlatInterpolatableData,\n>(\n interpolationType: TInterpolation,\n data: TData,\n): Decorate<TData, Interpolate<TInterpolation>>;\n\nexport function interpolate<\n TInterpolation extends InterpolationType,\n TData extends AnyData,\n>(\n interpolationType: TInterpolation,\n data: TData,\n): Decorate<TData, Interpolate<TInterpolation>> {\n return attribute(data, {\n [$internal]: true,\n type: '@interpolate',\n params: [interpolationType],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\n/**\n * Marks a position built-in output value as invariant in vertex shaders.\n * If the data and control flow match for two position outputs in different\n * entry points, then the result values are guaranteed to be the same.\n *\n * Must only be applied to the position built-in value.\n *\n * @example\n * const VertexOutput = {\n * pos: d.invariant(d.builtin.position),\n * };\n *\n * @param data The position built-in data-type to mark as invariant.\n */\nexport function invariant(\n data: Decorated<Vec4f, [Builtin<'position'>]>,\n): Decorated<Vec4f, [Builtin<'position'>, Invariant]> {\n // Validate that invariant is only applied to position built-in\n if (!isBuiltin(data)) {\n throw new Error(\n 'The @invariant attribute must only be applied to the position built-in value.',\n );\n }\n\n // Find the builtin attribute to check if it's position\n const builtinAttrib = (isDecorated(data) || isLooseDecorated(data))\n ? data.attribs.find(isBuiltinAttrib)\n : undefined;\n\n if (!builtinAttrib || builtinAttrib.params[0] !== 'position') {\n throw new Error(\n 'The @invariant attribute must only be applied to the position built-in value.',\n );\n }\n\n return attribute(data, {\n [$internal]: true,\n type: '@invariant',\n params: [],\n // oxlint-disable-next-line typescript/no-explicit-any <tired of lying to types>\n }) as any;\n}\n\nexport function isBuiltin(value: unknown): value is\n | Decorated<AnyWgslData, AnyAttribute[]>\n | LooseDecorated<AnyLooseData, AnyAttribute[]> {\n return (\n (isDecorated(value) || isLooseDecorated(value)) &&\n value.attribs.find(isBuiltinAttrib) !== undefined\n );\n}\n\nexport function getAttributesString<T extends BaseData>(field: T): string {\n if (!isDecorated(field) && !isLooseDecorated(field)) {\n return '';\n }\n\n return (field.attribs as AnyAttribute[])\n .map((attrib) => {\n if (attrib.params.length === 0) {\n return `${attrib.type} `;\n }\n return `${attrib.type}(${attrib.params.join(', ')}) `;\n })\n .join('');\n}\n\n// --------------\n// Implementation\n// --------------\n\nclass BaseDecoratedImpl<TInner extends BaseData, TAttribs extends unknown[]> {\n public readonly [$internal] = {};\n\n // Type-tokens, not available at runtime\n declare readonly [$repr]: Infer<TInner>;\n declare readonly [$gpuRepr]: InferGPU<TInner>;\n declare readonly [$reprPartial]: InferPartial<TInner>;\n // ---\n\n constructor(\n public readonly inner: TInner,\n public readonly attribs: TAttribs,\n ) {\n const alignAttrib = attribs.find(isAlignAttrib)?.params[0];\n const sizeAttrib = attribs.find(isSizeAttrib)?.params[0];\n\n if (alignAttrib !== undefined) {\n if (alignAttrib <= 0) {\n throw new Error(\n `Custom data alignment must be a positive number, got: ${alignAttrib}.`,\n );\n }\n\n if (Math.log2(alignAttrib) % 1 !== 0) {\n throw new Error(\n `Alignment has to be a power of 2, got: ${alignAttrib}.`,\n );\n }\n\n if (isWgslData(this.inner)) {\n if (alignAttrib % alignmentOf(this.inner) !== 0) {\n throw new Error(\n `Custom alignment has to be a multiple of the standard data alignment. Got: ${alignAttrib}, expected multiple of: ${\n alignmentOf(this.inner)\n }.`,\n );\n }\n }\n }\n\n if (sizeAttrib !== undefined) {\n if (sizeAttrib < sizeOf(this.inner)) {\n throw new Error(\n `Custom data size cannot be smaller then the standard data size. Got: ${sizeAttrib}, expected at least: ${\n sizeOf(this.inner)\n }.`,\n );\n }\n\n if (sizeAttrib <= 0) {\n throw new Error(\n `Custom data size must be a positive number. Got: ${sizeAttrib}.`,\n );\n }\n }\n }\n}\n\nclass DecoratedImpl<TInner extends BaseData, TAttribs extends unknown[]>\n extends BaseDecoratedImpl<TInner, TAttribs>\n implements Decorated<TInner, TAttribs> {\n public readonly [$internal] = {};\n public readonly type = 'decorated';\n\n // Type-tokens, not available at runtime\n declare readonly [$memIdent]: TAttribs extends Location[]\n ? MemIdentity<TInner> | Decorated<MemIdentity<TInner>, TAttribs>\n : Decorated<MemIdentity<TInner>, TAttribs>;\n declare readonly [$invalidSchemaReason]:\n Decorated[typeof $invalidSchemaReason];\n declare readonly [$validStorageSchema]: IsValidStorageSchema<TInner>;\n declare readonly [$validUniformSchema]: IsValidUniformSchema<TInner>;\n declare readonly [$validVertexSchema]: IsValidVertexSchema<TInner>;\n // ---\n}\n\nclass LooseDecoratedImpl<TInner extends BaseData, TAttribs extends unknown[]>\n extends BaseDecoratedImpl<TInner, TAttribs>\n implements LooseDecorated<TInner, TAttribs> {\n public readonly [$internal] = {};\n public readonly type = 'loose-decorated';\n\n // Type-tokens, not available at runtime\n declare readonly [$invalidSchemaReason]:\n LooseDecorated[typeof $invalidSchemaReason];\n declare readonly [$validVertexSchema]: IsValidVertexSchema<TInner>;\n // ---\n}\n","import {\n type Decorate,\n type HasCustomLocation,\n type IsBuiltin,\n location,\n} from '../../data/attributes.ts';\nimport { isBuiltin } from '../../data/attributes.ts';\nimport { getCustomLocation, isData } from '../../data/dataTypes.ts';\nimport { INTERNAL_createStruct } from '../../data/struct.ts';\nimport {\n type BaseData,\n isVoid,\n type Location,\n type WgslStruct,\n} from '../../data/wgslTypes.ts';\n\nexport type WithLocations<T extends Record<string, BaseData>> = {\n [Key in keyof T]: IsBuiltin<T[Key]> extends true ? T[Key]\n : HasCustomLocation<T[Key]> extends true ? T[Key]\n : Decorate<T[Key], Location>;\n};\n\nexport type IOLayoutToSchema<T> = T extends BaseData\n ? HasCustomLocation<T> extends true ? T : Decorate<T, Location<0>>\n : T extends Record<string, BaseData> ? WgslStruct<WithLocations<T>>\n : T extends { type: 'void' } ? void\n : never;\n\nexport function withLocations<T extends BaseData>(\n members: Record<string, T> | undefined,\n locations: Record<string, number> = {},\n): Record<string, BaseData> {\n let nextLocation = 0;\n const usedCustomLocations = new Set<number>();\n\n return Object.fromEntries(\n Object.entries(members ?? {}).map(([key, member]) => {\n const customLocation = getCustomLocation(member);\n\n if (customLocation !== undefined) {\n if (usedCustomLocations.has(customLocation)) {\n throw new Error('Duplicate custom location attributes found');\n }\n usedCustomLocations.add(customLocation);\n }\n\n return [key, member] as const;\n }).map(([key, member]) => {\n if (isBuiltin(member)) { // skipping builtins\n return [key, member];\n }\n\n if (getCustomLocation(member) !== undefined) { // this member is already marked\n return [key, member];\n }\n\n if (locations[key]) { // location has been determined by a previous procedure\n return [key, location(locations[key], member)];\n }\n\n while (usedCustomLocations.has(nextLocation)) {\n nextLocation++;\n }\n return [key, location(nextLocation++, member)];\n }),\n );\n}\n\nexport function createIoSchema<\n T extends BaseData | Record<string, BaseData>,\n>(layout: T, locations: Record<string, number> = {}) {\n return (\n isData(layout)\n ? isVoid(layout)\n ? layout\n : isBuiltin(layout)\n ? layout\n : getCustomLocation(layout) !== undefined\n ? layout\n : location(0, layout)\n : INTERNAL_createStruct(\n withLocations(layout as Record<string, BaseData>, locations),\n /* isAbstruct */ false,\n )\n ) as IOLayoutToSchema<T>;\n}\n","import { createIoSchema } from '../core/function/ioSchema.ts';\nimport { isValidProp } from '../nameRegistry.ts';\nimport { getName, setName } from '../shared/meta.ts';\nimport { $internal, $repr, $resolve } from '../shared/symbols.ts';\nimport type { ResolutionCtx, SelfResolvable } from '../types.ts';\nimport type { ResolvedSnippet } from './snippet.ts';\nimport type { BaseData, WgslStruct } from './wgslTypes.ts';\n\n/**\n * A requirement for the generated struct is that non-builtin properties need to\n * have the same name in WGSL as they do in JS. This allows locations to be properly\n * matched between the Vertex output and Fragment input.\n */\nexport class AutoStruct implements BaseData, SelfResolvable {\n // Prototype properties\n declare [$internal]: Record<string, never>;\n declare type: 'auto-struct';\n\n // Type-tokens, not available at runtime\n declare readonly [$repr]: Record<string, unknown>;\n // ---\n\n /**\n * js key -> data type\n */\n readonly #validProps: Record<string, BaseData>;\n /**\n * js key -> { prop: 'wgsl key', type: ... }\n * @example '$position' -> { prop: 'position', type: ... }\n */\n readonly #allocated: Record<string, { prop: string; type: BaseData }>;\n\n #usedWgslKeys: Set<string>;\n #locations: Record<string, number> | undefined;\n #cachedStruct: WgslStruct | undefined;\n #typeForExtraProps: BaseData | undefined;\n\n constructor(\n validProps: Record<string, BaseData>,\n typeForExtraProps: BaseData | undefined,\n locations?: Record<string, number>,\n ) {\n this.#validProps = validProps;\n this.#typeForExtraProps = typeForExtraProps;\n this.#allocated = {};\n this.#locations = locations;\n this.#usedWgslKeys = new Set();\n }\n\n /**\n * Used for accessing builtins, varying and attributes in code.\n */\n accessProp(key: string): { prop: string; type: BaseData } | undefined {\n // If the prop is not found in validProps, we consider it an extra property\n const dataType = this.#validProps[key] ?? this.#typeForExtraProps;\n if (!dataType) {\n return undefined;\n }\n\n return this.provideProp(key, dataType);\n }\n\n /**\n * Used for providing new varyings.\n *\n * @privateRemarks\n * Internally used by `accessProp`.\n */\n provideProp(\n key: string,\n dataType: BaseData,\n ): { prop: string; type: BaseData } {\n let alloc = this.#allocated[key];\n if (!alloc) {\n const wgslKey = key.replaceAll('$', '');\n if (this.#usedWgslKeys.has(wgslKey)) {\n throw new Error(\n `Property name '${wgslKey}' causes naming clashes. Choose a different name.`,\n );\n }\n if (!isValidProp(wgslKey)) {\n throw new Error(\n `Property key '${key}' is a reserved WGSL word. Choose a different name.`,\n );\n }\n\n this.#usedWgslKeys.add(wgslKey);\n alloc = { prop: wgslKey, type: dataType };\n this.#allocated[key] = alloc;\n }\n\n return alloc;\n }\n\n get completeStruct() {\n if (!this.#cachedStruct) {\n this.#cachedStruct = createIoSchema(\n Object.fromEntries(\n Object.values(this.#allocated).map((alloc) => {\n return [alloc.prop, alloc.type];\n }),\n ),\n this.#locations,\n );\n const ownName = getName(this);\n // Passing the given name forward\n if (ownName) {\n setName(this.#cachedStruct, ownName);\n }\n }\n\n return this.#cachedStruct;\n }\n\n [$resolve](ctx: ResolutionCtx): ResolvedSnippet {\n return ctx.resolve(this.completeStruct);\n }\n\n toString(): string {\n return `auto-struct:${getName(this) ?? '<unnamed>'}`;\n }\n}\n\nAutoStruct.prototype[$internal] = {};\nAutoStruct.prototype.type = 'auto-struct';\n","import { stitch } from '../core/resolve/stitch.ts';\nimport { AutoStruct } from '../data/autoStruct.ts';\nimport {\n InfixDispatch,\n isUnstruct,\n MatrixColumnsAccess,\n undecorate,\n UnknownData,\n} from '../data/dataTypes.ts';\nimport { abstractInt, bool, f16, f32, i32, u32 } from '../data/numeric.ts';\nimport { derefSnippet } from '../data/ref.ts';\nimport { isEphemeralSnippet, snip, type Snippet } from '../data/snippet.ts';\nimport {\n vec2b,\n vec2f,\n vec2h,\n vec2i,\n vec2u,\n vec3b,\n vec3f,\n vec3h,\n vec3i,\n vec3u,\n vec4b,\n vec4f,\n vec4h,\n vec4i,\n vec4u,\n} from '../data/vector.ts';\nimport {\n type BaseData,\n isMat,\n isNaturallyEphemeral,\n isPtr,\n isVec,\n isWgslArray,\n isWgslStruct,\n} from '../data/wgslTypes.ts';\nimport { $gpuCallable } from '../shared/symbols.ts';\nimport { add, div, mod, mul, sub } from '../std/operators.ts';\nimport { isKnownAtComptime } from '../types.ts';\nimport { coerceToSnippet } from './generationHelpers.ts';\n\nconst infixKinds = [\n 'vec2f',\n 'vec3f',\n 'vec4f',\n 'vec2h',\n 'vec3h',\n 'vec4h',\n 'vec2i',\n 'vec3i',\n 'vec4i',\n 'vec2u',\n 'vec3u',\n 'vec4u',\n 'mat2x2f',\n 'mat3x3f',\n 'mat4x4f',\n];\n\nexport const infixOperators = {\n add,\n sub,\n mul,\n div,\n mod,\n} as const;\n\nexport type InfixOperator = keyof typeof infixOperators;\n\ntype SwizzleableType = 'f' | 'h' | 'i' | 'u' | 'b';\ntype SwizzleLength = 1 | 2 | 3 | 4;\n\nconst swizzleLenToType: Record<\n SwizzleableType,\n Record<SwizzleLength, BaseData>\n> = {\n f: {\n 1: f32,\n 2: vec2f,\n 3: vec3f,\n 4: vec4f,\n },\n h: {\n 1: f16,\n 2: vec2h,\n 3: vec3h,\n 4: vec4h,\n },\n i: {\n 1: i32,\n 2: vec2i,\n 3: vec3i,\n 4: vec4i,\n },\n u: {\n 1: u32,\n 2: vec2u,\n 3: vec3u,\n 4: vec4u,\n },\n b: {\n 1: bool,\n 2: vec2b,\n 3: vec3b,\n 4: vec4b,\n },\n} as const;\n\nexport function accessProp(\n target: Snippet,\n propName: string,\n): Snippet | undefined {\n if (\n infixKinds.includes((target.dataType as BaseData).type) &&\n propName in infixOperators\n ) {\n const operator = infixOperators[propName as InfixOperator];\n return snip(\n new InfixDispatch(\n propName,\n target,\n operator[$gpuCallable].call.bind(operator),\n ),\n UnknownData,\n /* origin */ target.origin,\n );\n }\n\n if (isWgslArray(target.dataType) && propName === 'length') {\n if (target.dataType.elementCount === 0) {\n // Dynamically-sized array\n return snip(stitch`arrayLength(&${target})`, u32, /* origin */ 'runtime');\n }\n\n return snip(\n target.dataType.elementCount,\n abstractInt,\n /* origin */ 'constant',\n );\n }\n\n if (isMat(target.dataType) && propName === 'columns') {\n return snip(\n new MatrixColumnsAccess(target),\n UnknownData,\n /* origin */ target.origin,\n );\n }\n\n if (isWgslStruct(target.dataType) || isUnstruct(target.dataType)) {\n let propType = target.dataType.propTypes[propName];\n if (!propType) {\n return undefined;\n }\n propType = undecorate(propType);\n\n return snip(\n stitch`${target}.${propName}`,\n propType,\n /* origin */ target.origin === 'argument'\n ? 'argument'\n : !isEphemeralSnippet(target) && !isNaturallyEphemeral(propType)\n ? target.origin\n : target.origin === 'constant' ||\n target.origin === 'constant-tgpu-const-ref'\n ? 'constant'\n : 'runtime',\n );\n }\n\n if (target.dataType instanceof AutoStruct) {\n const result = target.dataType.accessProp(propName);\n if (!result) {\n return undefined;\n }\n return snip(stitch`${target}.${result.prop}`, result.type, 'argument');\n }\n\n if (isPtr(target.dataType)) {\n const derefed = derefSnippet(target);\n\n if (propName === '$') {\n // Dereference pointer\n return derefed;\n }\n\n // Sometimes values that are typed as pointers aren't instances of `d.ref`, so we\n // allow access to member props as if it wasn't a pointer.\n return accessProp(derefed, propName);\n }\n\n if (isVec(target.dataType)) {\n // Example: d.vec3f().kind === 'vec3f'\n if (propName === 'kind') {\n return snip(target.dataType.type, UnknownData, 'constant');\n }\n }\n\n const propLength = propName.length;\n if (isVec(target.dataType) && propLength >= 1 && propLength <= 4) {\n const isXYZW = /^[xyzw]+$/.test(propName);\n const isRGBA = /^[rgba]+$/.test(propName);\n\n if (!isXYZW && !isRGBA) {\n // Not a valid swizzle\n return undefined;\n }\n\n const swizzleTypeChar = target.dataType.type.includes('bool')\n ? 'b'\n : (target.dataType.type[4] as SwizzleableType);\n const swizzleType =\n swizzleLenToType[swizzleTypeChar][propLength as SwizzleLength];\n if (!swizzleType) {\n return undefined;\n }\n\n return snip(\n isKnownAtComptime(target)\n // oxlint-disable-next-line typescript/no-explicit-any it's fine, the prop is there\n ? (target.value as any)[propName]\n : stitch`${target}.${propName}`,\n swizzleType,\n // Swizzling creates new vectors (unless they're on the lhs of an assignment, but that's not yet supported in WGSL)\n /* origin */ target.origin === 'argument' && propLength === 1\n ? 'argument'\n : target.origin === 'constant' ||\n target.origin === 'constant-tgpu-const-ref'\n ? 'constant'\n : 'runtime',\n );\n }\n\n if (isKnownAtComptime(target) || target.dataType === UnknownData) {\n // oxlint-disable-next-line typescript/no-explicit-any we either know exactly what it is, or have no idea at all\n return coerceToSnippet((target.value as any)[propName]);\n }\n\n return undefined;\n}\n","import { comptime } from '../core/function/comptime.ts';\nimport { $internal } from '../shared/symbols.ts';\nimport { schemaCallWrapper } from './schemaCallWrapper.ts';\nimport { sizeOf } from './sizeOf.ts';\nimport type { AnyWgslData, WgslArray } from './wgslTypes.ts';\n\n// ----------\n// Public API\n// ----------\n\ninterface WgslArrayConstructor {\n <TElement extends AnyWgslData>(\n elementType: TElement,\n ): (elementCount: number) => WgslArray<TElement>;\n\n <TElement extends AnyWgslData>(\n elementType: TElement,\n elementCount: number,\n ): WgslArray<TElement>;\n}\n\n/**\n * Creates an array schema that can be used to construct gpu buffers.\n * Describes arrays with fixed-size length, storing elements of the same type.\n *\n * @example\n * const LENGTH = 3;\n * const array = d.arrayOf(d.u32, LENGTH);\n *\n * If `elementCount` is not specified, a partially applied function is returned.\n * @example\n * const array = d.arrayOf(d.vec3f);\n * // ^? (n: number) => WgslArray<d.Vec3f>\n *\n * @param elementType The type of elements in the array.\n * @param elementCount The number of elements in the array.\n */\nexport const arrayOf = comptime(\n ((elementType, elementCount) => {\n if (elementCount === undefined) {\n return comptime((count: number) => cpu_arrayOf(elementType, count));\n }\n return cpu_arrayOf(elementType, elementCount);\n }) as WgslArrayConstructor,\n).$name('arrayOf');\n\n// --------------\n// Implementation\n// --------------\n\nfunction cpu_arrayOf<TElement extends AnyWgslData>(\n elementType: TElement,\n elementCount: number,\n): WgslArray<TElement> {\n // In the schema call, create and return a deep copy\n // by wrapping all the values in `elementType` schema calls.\n const arraySchema = (elements?: TElement[]) => {\n if (elements && elements.length !== elementCount) {\n throw new Error(\n `Array schema of ${elementCount} elements of type ${elementType.type} called with ${elements.length} argument(s).`,\n );\n }\n\n return Array.from(\n { length: elementCount },\n (_, i) => schemaCallWrapper(elementType, elements?.[i]),\n );\n };\n Object.setPrototypeOf(arraySchema, WgslArrayImpl);\n\n if (Number.isNaN(sizeOf(elementType))) {\n throw new Error('Cannot nest runtime sized arrays.');\n }\n arraySchema.elementType = elementType;\n\n if (!Number.isInteger(elementCount) || elementCount < 0) {\n throw new Error(\n `Cannot create array schema with invalid element count: ${elementCount}.`,\n );\n }\n arraySchema.elementCount = elementCount;\n\n return arraySchema as unknown as WgslArray<TElement>;\n}\n\nconst WgslArrayImpl = {\n [$internal]: true,\n type: 'array',\n\n toString(this: WgslArray): string {\n return `arrayOf(${this.elementType}, ${this.elementCount})`;\n },\n};\n","import { arrayOf } from './data/array.ts';\nimport { attribute } from './data/attributes.ts';\nimport type { LooseDecorated } from './data/dataTypes.ts';\nimport { bool, f32, u32 } from './data/numeric.ts';\nimport { vec3u, vec4f } from './data/vector.ts';\nimport type {\n BaseData,\n Bool,\n Builtin,\n Decorated,\n F32,\n U32,\n Vec3u,\n Vec4f,\n WgslArray,\n} from './data/wgslTypes.ts';\nimport { $internal } from './shared/symbols.ts';\n\n// ----------\n// Public API\n// ----------\n\nexport type BuiltinVertexIndex = Decorated<U32, [Builtin<'vertex_index'>]>;\nexport type BuiltinInstanceIndex = Decorated<U32, [Builtin<'instance_index'>]>;\nexport type BuiltinClipDistances = Decorated<\n WgslArray<U32>,\n [Builtin<'clip_distances'>]\n>;\nexport type BuiltinPosition = Decorated<Vec4f, [Builtin<'position'>]>;\nexport type BuiltinFrontFacing = Decorated<Bool, [Builtin<'front_facing'>]>;\nexport type BuiltinFragDepth = Decorated<F32, [Builtin<'frag_depth'>]>;\nexport type BuiltinPrimitiveIndex = Decorated<\n U32,\n [Builtin<'primitive_index'>]\n>;\nexport type BuiltinSampleIndex = Decorated<U32, [Builtin<'sample_index'>]>;\nexport type BuiltinSampleMask = Decorated<U32, [Builtin<'sample_mask'>]>;\nexport type BuiltinLocalInvocationId = Decorated<\n Vec3u,\n [Builtin<'local_invocation_id'>]\n>;\nexport type BuiltinLocalInvocationIndex = Decorated<\n U32,\n [Builtin<'local_invocation_index'>]\n>;\nexport type BuiltinGlobalInvocationId = Decorated<\n Vec3u,\n [Builtin<'global_invocation_id'>]\n>;\nexport type BuiltinWorkgroupId = Decorated<Vec3u, [Builtin<'workgroup_id'>]>;\nexport type BuiltinNumWorkgroups = Decorated<\n Vec3u,\n [Builtin<'num_workgroups'>]\n>;\nexport type BuiltinSubgroupInvocationId = Decorated<\n U32,\n [Builtin<'subgroup_invocation_id'>]\n>;\nexport type BuiltinSubgroupSize = Decorated<U32, [Builtin<'subgroup_size'>]>;\nexport type BuiltinSubgroupId = Decorated<U32, [Builtin<'subgroup_id'>]>;\nexport type BuiltinNumSubgroups = Decorated<U32, [Builtin<'num_subgroups'>]>;\n\nfunction defineBuiltin<T extends Decorated | LooseDecorated>(\n dataType: BaseData,\n value: T['attribs'][0] extends { params: [infer TValue] } ? TValue : never,\n): T {\n return attribute(dataType, {\n [$internal]: true,\n type: '@builtin',\n // oxlint-disable-next-line typescript/no-explicit-any it's fine\n params: [value as any],\n }) as T;\n}\n\nexport const builtin = {\n vertexIndex: defineBuiltin<BuiltinVertexIndex>(u32, 'vertex_index'),\n instanceIndex: defineBuiltin<BuiltinInstanceIndex>(u32, 'instance_index'),\n clipDistances: defineBuiltin<BuiltinClipDistances>(\n arrayOf(u32, 8),\n 'clip_distances',\n ),\n position: defineBuiltin<BuiltinPosition>(vec4f, 'position'),\n frontFacing: defineBuiltin<BuiltinFrontFacing>(bool, 'front_facing'),\n fragDepth: defineBuiltin<BuiltinFragDepth>(f32, 'frag_depth'),\n primitiveIndex: defineBuiltin<BuiltinPrimitiveIndex>(u32, 'primitive_index'),\n sampleIndex: defineBuiltin<BuiltinSampleIndex>(u32, 'sample_index'),\n sampleMask: defineBuiltin<BuiltinSampleMask>(u32, 'sample_mask'),\n localInvocationId: defineBuiltin<BuiltinLocalInvocationId>(\n vec3u,\n 'local_invocation_id',\n ),\n localInvocationIndex: defineBuiltin<BuiltinLocalInvocationIndex>(\n u32,\n 'local_invocation_index',\n ),\n globalInvocationId: defineBuiltin<BuiltinGlobalInvocationId>(\n vec3u,\n 'global_invocation_id',\n ),\n workgroupId: defineBuiltin<BuiltinWorkgroupId>(vec3u, 'workgroup_id'),\n numWorkgroups: defineBuiltin<BuiltinNumWorkgroups>(vec3u, 'num_workgroups'),\n subgroupInvocationId: defineBuiltin<BuiltinSubgroupInvocationId>(\n u32,\n 'subgroup_invocation_id',\n ),\n subgroupSize: defineBuiltin<BuiltinSubgroupSize>(u32, 'subgroup_size'),\n subgroupId: defineBuiltin<BuiltinSubgroupId>(u32, 'subgroup_id'),\n numSubgroups: defineBuiltin<BuiltinNumSubgroups>(u32, 'num_subgroups'),\n} as const;\n\nexport type AnyBuiltin = (typeof builtin)[keyof typeof builtin];\nexport type AnyComputeBuiltin =\n | BuiltinLocalInvocationId\n | BuiltinLocalInvocationIndex\n | BuiltinGlobalInvocationId\n | BuiltinWorkgroupId\n | BuiltinNumWorkgroups\n | BuiltinSubgroupInvocationId\n | BuiltinSubgroupSize\n | BuiltinSubgroupId\n | BuiltinNumSubgroups;\nexport type AnyVertexInputBuiltin = BuiltinVertexIndex | BuiltinInstanceIndex;\nexport type AnyVertexOutputBuiltin = BuiltinClipDistances | BuiltinPosition;\nexport type AnyFragmentInputBuiltin =\n | BuiltinPosition\n | BuiltinFrontFacing\n | BuiltinPrimitiveIndex\n | BuiltinSampleIndex\n | BuiltinSampleMask\n | BuiltinSubgroupInvocationId\n | BuiltinSubgroupSize;\nexport type AnyFragmentOutputBuiltin = BuiltinFragDepth | BuiltinSampleMask;\n\nexport type OmitBuiltins<S> = S extends AnyBuiltin ? never\n : S extends BaseData ? S\n : {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KAAK,YAAY,IAAI,KAAK,aAAa;;CAE5D;;;;AC9BD,SAAS,cACP,UACA,OACG;AACH,QAAO,UAAU,UAAU;GACxB,YAAY;EACb,MAAM;EAEN,QAAQ,CAAC,MAAa;EACvB,CAAC;;AAGJ,MAAa,UAAU;CACrB,aAAa,cAAkC,KAAK,eAAe;CACnE,eAAe,cAAoC,KAAK,iBAAiB;CACzE,eAAe,cACb,QAAQ,KAAK,EAAE,EACf,iBACD;CACD,UAAU,cAA+B,OAAO,WAAW;CAC3D,aAAa,cAAkC,MAAM,eAAe;CACpE,WAAW,cAAgC,KAAK,aAAa;CAC7D,gBAAgB,cAAqC,KAAK,kBAAkB;CAC5E,aAAa,cAAkC,KAAK,eAAe;CACnE,YAAY,cAAiC,KAAK,cAAc;CAChE,mBAAmB,cACjB,OACA,sBACD;CACD,sBAAsB,cACpB,KACA,yBACD;CACD,oBAAoB,cAClB,OACA,uBACD;CACD,aAAa,cAAkC,OAAO,eAAe;CACrE,eAAe,cAAoC,OAAO,iBAAiB;CAC3E,sBAAsB,cACpB,KACA,yBACD;CACD,cAAc,cAAmC,KAAK,gBAAgB;CACtE,YAAY,cAAiC,KAAK,cAAc;CAChE,cAAc,cAAmC,KAAK,gBAAgB;CACvE"}
|
package/common/index.d.ts
CHANGED
package/common/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import { t as fullScreenTriangle } from "../fullScreenTriangle-
|
|
2
|
+
import { t as fullScreenTriangle } from "../fullScreenTriangle-CfFyQd_0.js";
|
|
3
3
|
|
|
4
4
|
//#region src/common/index.ts
|
|
5
5
|
var common_exports = /* @__PURE__ */ __exportAll({ fullScreenTriangle: () => fullScreenTriangle });
|
package/data/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $a as m3x3f, $c as align, $i as textureStorage2dArray, $n as atomic, $s as uint32x2, Aa as Vec3h, Ai as WgslTextureCube, Ar as ptrHandle, As as formatToWGSLType, Ba as WgslStruct, Bi as texture2dArray, Br as i32, Bs as sint8, Ca as Vec2b, Ci as WgslStorageTexture3d, Cl as BuiltinNumWorkgroups, Cr as vec3u, Cs as float16, Da as Vec2u, Di as WgslTexture2d, Dl as BuiltinVertexIndex, Dr as vec4i, Ds as float32x2, Ea as Vec2i, Ei as WgslTexture1d, El as BuiltinSampleMask, Er as vec4h, Es as float32, Fa as Vec4h, Fi as WgslTextureDepthCubeArray, Fl as comparisonSampler, Fr as arrayOf, Fs as sint16x4, Ga as isInterpolateAttrib, Gi as textureDepth2dArray, Gs as snorm16x4, Ha as isAtomic, Hi as textureCube, Hr as u32, Hs as sint8x4, Ia as Vec4i, Ii as WgslTextureDepthMultisampled2d, Il as sampler, Ir as struct, Is as sint32, Ja as isSizeAttrib, Ji as textureDepthMultisampled2d, Jn as deepEqual, Js as snorm8x4, Ka as isLocationAttrib, Ki as textureDepthCube, Ks as snorm8, La as Vec4u, Li as WgslTextureMultisampled2d, Lr as bool, Ls as sint32x2, Ma as Vec3u, Mi as WgslTextureDepth2d, Mr as ptrStorage, Ms as packedFormats, Na as Vec4b, Ni as WgslTextureDepth2dArray, Nl as WgslComparisonSampler, Nr as ptrUniform, Ns as sint16, Oa as Vec3b, Oi as WgslTexture2dArray, Ol as BuiltinWorkgroupId, Or as vec4u, Os as float32x3, Pa as Vec4f, Pi as WgslTextureDepthCube, Pl as WgslSampler, Pr as ptrWorkgroup, Ps as sint16x2, Qa as m2x2f, Qc as IsBuiltin, Qi as textureStorage2d, Qn as PUBLIC_sizeOf, Qs as uint32, Ra as Void, Ri as texture1d, Rr as f16, Rs as sint32x3, Sa as U32, Si as WgslStorageTexture2dArray, Sl as BuiltinLocalInvocationIndex, Sr as vec3i, Ss as TgpuVertexFormatData, Ta as Vec2h, Ti as WgslTexture, Tl as BuiltinSampleIndex, Tr as vec4f, Ts as float16x4, Ua as isBuiltinAttrib, Ui as textureCubeArray, Us as snorm16, Va as isAlignAttrib, Vi as texture3d, Vr as u16, Vs as sint8x2, Wa as isDecorated, Wi as textureDepth2d, Ws as snorm16x2, Xa as isWgslData, Xc as AnyAttribute, Xi as textureMultisampled2d, Xn as PUBLIC_getLongestContiguousPrefix, Xs as uint16x2, Ya as isWgslArray, Yi as textureExternal, Yn as PUBLIC_alignmentOf, Ys as uint16, Za as isWgslStruct, Zc as HasCustomLocation, Zi as textureStorage1d, Zn as PUBLIC_isContiguous, Zs as uint16x4, _a as Mat4x4f, _l as BuiltinFragDepth, _r as vec2i, aa as Atomic, ac as unorm10_10_10_2, ai as LooseDecorated, ao as v2u, ar as mat4x4f, ba as StorableData, bi as WgslStorageTexture1d, bl as BuiltinInstanceIndex, br as vec3f, bs as FormatToWGSLType, ca as Builtin, cc as unorm16x4, ci as isDisarray, co as v3i, da as F32, dc as unorm8x4, di as isUnstruct, do as v4f, ea as textureStorage3d, ec as uint32x3, el as interpolate, eo as m4x4f, fa as I32, fc as unorm8x4_bgra, fi as Infer, fo as v4i, fr as unstruct, ga as Mat3x3f, gl as BuiltinClipDistances, gr as vec2h, ha as Mat2x2f, hl as AnyBuiltin, ho as _ref, hr as vec2f, ia as AnyWgslStruct, ic as uint8x4, ii as Disarray, il as size, io as v2i, ir as mat3x3f, ja as Vec3i, jc as memoryLayoutOf, ji as WgslTextureCubeArray, jr as ptrPrivate, js as isPackedData, ka as Vec3f, ki as WgslTexture3d, kl as builtin, kr as ptrFn, ks as float32x4, la as Decorated, lc as unorm8, li as isLooseData, lo as v3u, ma as Location, mi as InferPartial, mo as vecBase, mr as vec2b, na as AnyVecInstance, nc as uint8, ni as AnyData, nl as isBuiltin, no as v2b, oa as BaseData, oc as unorm16, oi as Unstruct, oo as v3b, or as matToArray, pa as Interpolate, pi as InferGPU, po as v4u, pr as disarrayOf, qa as isPtr, qi as textureDepthCubeArray, qs as snorm8x2, ra as AnyWgslData, rc as uint8x2, ri as AnyLooseData, rl as location, ro as v2f, rr as mat2x2f, sa as Bool, sc as unorm16x2, si as isData, so as v3f, ta as Align, tc as uint32x4, tl as invariant, to as matBase, ua as F16, uc as unorm8x2, ui as isLooseDecorated, uo as v4b, va as Ptr, vi as WgslExternalTexture, vl as BuiltinFrontFacing, vr as vec2u, wa as Vec2f, wi as WgslStorageTextureProps, wl as BuiltinPosition, wr as vec4b, ws as float16x2, xa as U16, xi as WgslStorageTexture2d, xl as BuiltinLocalInvocationId, xr as vec3h, xs as PackedData, ya as Size, yi as WgslStorageTexture, yl as BuiltinGlobalInvocationId, yr as vec3b, ys as FormatToAcceptedData, za as WgslArray, zi as texture2d, zr as f32, zs as sint32x4 } from "../indexNamedExports-
|
|
1
|
+
import { $a as m3x3f, $c as align, $i as textureStorage2dArray, $n as atomic, $s as uint32x2, Aa as Vec3h, Ai as WgslTextureCube, Ar as ptrHandle, As as formatToWGSLType, Ba as WgslStruct, Bi as texture2dArray, Br as i32, Bs as sint8, Ca as Vec2b, Ci as WgslStorageTexture3d, Cl as BuiltinNumWorkgroups, Cr as vec3u, Cs as float16, Da as Vec2u, Di as WgslTexture2d, Dl as BuiltinVertexIndex, Dr as vec4i, Ds as float32x2, Ea as Vec2i, Ei as WgslTexture1d, El as BuiltinSampleMask, Er as vec4h, Es as float32, Fa as Vec4h, Fi as WgslTextureDepthCubeArray, Fl as comparisonSampler, Fr as arrayOf, Fs as sint16x4, Ga as isInterpolateAttrib, Gi as textureDepth2dArray, Gs as snorm16x4, Ha as isAtomic, Hi as textureCube, Hr as u32, Hs as sint8x4, Ia as Vec4i, Ii as WgslTextureDepthMultisampled2d, Il as sampler, Ir as struct, Is as sint32, Ja as isSizeAttrib, Ji as textureDepthMultisampled2d, Jn as deepEqual, Js as snorm8x4, Ka as isLocationAttrib, Ki as textureDepthCube, Ks as snorm8, La as Vec4u, Li as WgslTextureMultisampled2d, Lr as bool, Ls as sint32x2, Ma as Vec3u, Mi as WgslTextureDepth2d, Mr as ptrStorage, Ms as packedFormats, Na as Vec4b, Ni as WgslTextureDepth2dArray, Nl as WgslComparisonSampler, Nr as ptrUniform, Ns as sint16, Oa as Vec3b, Oi as WgslTexture2dArray, Ol as BuiltinWorkgroupId, Or as vec4u, Os as float32x3, Pa as Vec4f, Pi as WgslTextureDepthCube, Pl as WgslSampler, Pr as ptrWorkgroup, Ps as sint16x2, Qa as m2x2f, Qc as IsBuiltin, Qi as textureStorage2d, Qn as PUBLIC_sizeOf, Qs as uint32, Ra as Void, Ri as texture1d, Rr as f16, Rs as sint32x3, Sa as U32, Si as WgslStorageTexture2dArray, Sl as BuiltinLocalInvocationIndex, Sr as vec3i, Ss as TgpuVertexFormatData, Ta as Vec2h, Ti as WgslTexture, Tl as BuiltinSampleIndex, Tr as vec4f, Ts as float16x4, Ua as isBuiltinAttrib, Ui as textureCubeArray, Us as snorm16, Va as isAlignAttrib, Vi as texture3d, Vr as u16, Vs as sint8x2, Wa as isDecorated, Wi as textureDepth2d, Ws as snorm16x2, Xa as isWgslData, Xc as AnyAttribute, Xi as textureMultisampled2d, Xn as PUBLIC_getLongestContiguousPrefix, Xs as uint16x2, Ya as isWgslArray, Yi as textureExternal, Yn as PUBLIC_alignmentOf, Ys as uint16, Za as isWgslStruct, Zc as HasCustomLocation, Zi as textureStorage1d, Zn as PUBLIC_isContiguous, Zs as uint16x4, _a as Mat4x4f, _l as BuiltinFragDepth, _r as vec2i, aa as Atomic, ac as unorm10_10_10_2, ai as LooseDecorated, ao as v2u, ar as mat4x4f, ba as StorableData, bi as WgslStorageTexture1d, bl as BuiltinInstanceIndex, br as vec3f, bs as FormatToWGSLType, ca as Builtin, cc as unorm16x4, ci as isDisarray, co as v3i, da as F32, dc as unorm8x4, di as isUnstruct, do as v4f, ea as textureStorage3d, ec as uint32x3, el as interpolate, eo as m4x4f, fa as I32, fc as unorm8x4_bgra, fi as Infer, fo as v4i, fr as unstruct, ga as Mat3x3f, gl as BuiltinClipDistances, gr as vec2h, ha as Mat2x2f, hl as AnyBuiltin, ho as _ref, hr as vec2f, ia as AnyWgslStruct, ic as uint8x4, ii as Disarray, il as size, io as v2i, ir as mat3x3f, ja as Vec3i, jc as memoryLayoutOf, ji as WgslTextureCubeArray, jr as ptrPrivate, js as isPackedData, ka as Vec3f, ki as WgslTexture3d, kl as builtin, kr as ptrFn, ks as float32x4, la as Decorated, lc as unorm8, li as isLooseData, lo as v3u, ma as Location, mi as InferPartial, mo as vecBase, mr as vec2b, na as AnyVecInstance, nc as uint8, ni as AnyData, nl as isBuiltin, no as v2b, oa as BaseData, oc as unorm16, oi as Unstruct, oo as v3b, or as matToArray, pa as Interpolate, pi as InferGPU, po as v4u, pr as disarrayOf, qa as isPtr, qi as textureDepthCubeArray, qs as snorm8x2, ra as AnyWgslData, rc as uint8x2, ri as AnyLooseData, rl as location, ro as v2f, rr as mat2x2f, sa as Bool, sc as unorm16x2, si as isData, so as v3f, ta as Align, tc as uint32x4, tl as invariant, to as matBase, ua as F16, uc as unorm8x2, ui as isLooseDecorated, uo as v4b, va as Ptr, vi as WgslExternalTexture, vl as BuiltinFrontFacing, vr as vec2u, wa as Vec2f, wi as WgslStorageTextureProps, wl as BuiltinPosition, wr as vec4b, ws as float16x2, xa as U16, xi as WgslStorageTexture2d, xl as BuiltinLocalInvocationId, xr as vec3h, xs as PackedData, ya as Size, yi as WgslStorageTexture, yl as BuiltinGlobalInvocationId, yr as vec3b, ys as FormatToAcceptedData, za as WgslArray, zi as texture2d, zr as f32, zs as sint32x4 } from "../indexNamedExports-oL6tyaJ9.js";
|
|
2
2
|
|
|
3
3
|
//#region src/data/index.d.ts
|
|
4
4
|
declare namespace index_d_exports {
|
package/data/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "../chunk-BYypO7fO.js";
|
|
2
|
-
import { $ as VecBase, An as isAlignAttrib, B as vec2h, Cn as isDisarray, Dt as ptrStorage, En as isUnstruct, Et as ptrPrivate, Fn as isInterpolateAttrib, G as vec3h, H as vec2u, Hn as isSizeAttrib, In as isLocationAttrib, J as vec4b, Jn as isWgslData, K as vec3i, Mn as isBuiltinAttrib, Nn as isDecorated, Ot as ptrUniform, P as struct, Q as vec4u, R as vec2b, Sn as isData, Tn as isLooseDecorated, Tt as ptrHandle, U as vec3b, V as vec2i, Vn as isPtr, W as vec3f, X as vec4h, Y as vec4f, Yn as isWgslStruct, Z as vec4i, _ as mat4x4f, at as i32, d as MatBase, g as mat3x3f, h as mat2x2f, it as f32, jn as isAtomic, kn as Void, kt as ptrWorkgroup, nt as bool, ot as u16, q as vec3u, qn as isWgslArray, rt as f16, st as u32, v as matToArray, wn as isLooseData, wt as ptrFn, yt as _ref, z as vec2f } from "../operators-
|
|
3
|
-
import { $ as uint32x4, A as packedFormats, B as sint8x4, C as float16x4, D as float32x4, E as float32x3, F as sint32x2, G as snorm8x2, H as snorm16x2, I as sint32x3, J as uint16x2, K as snorm8x4, L as sint32x4, M as sint16x2, N as sint16x4, O as formatToWGSLType, P as sint32, Q as uint32x3, R as sint8, S as float16x2, T as float32x2, U as snorm16x4, V as snorm16, W as snorm8, X as uint32, Y as uint16x4, Z as uint32x2, at as unorm16x2, ct as unorm8x2, d as isBuiltin, et as uint8, f as location, i as infixOperators, it as unorm16, j as sint16, k as isPackedData, l as interpolate, lt as unorm8x4, m as PUBLIC_sizeOf, n as arrayOf, nt as uint8x4, ot as unorm16x4, p as size, q as uint16, rt as unorm10_10_10_2, s as align, st as unorm8, t as builtin, tt as uint8x2, u as invariant, ut as unorm8x4_bgra, v as PUBLIC_alignmentOf, w as float32, x as float16, z as sint8x2 } from "../builtin-
|
|
4
|
-
import { a as PUBLIC_getLongestContiguousPrefix, i as memoryLayoutOf, n as unstruct, o as PUBLIC_isContiguous, p as sampler, r as disarrayOf, s as atomic, t as deepEqual, u as comparisonSampler } from "../deepEqual-
|
|
5
|
-
import { _ as textureMultisampled2d, a as texture2d, b as textureStorage2dArray, c as textureCube, d as textureDepth2dArray, f as textureDepthCube, g as textureExternal, i as texture1d, l as textureCubeArray, m as textureDepthMultisampled2d, o as texture2dArray, p as textureDepthCubeArray, s as texture3d, u as textureDepth2d, v as textureStorage1d, x as textureStorage3d, y as textureStorage2d } from "../texture-
|
|
2
|
+
import { $ as VecBase, An as isAlignAttrib, B as vec2h, Cn as isDisarray, Dt as ptrStorage, En as isUnstruct, Et as ptrPrivate, Fn as isInterpolateAttrib, G as vec3h, H as vec2u, Hn as isSizeAttrib, In as isLocationAttrib, J as vec4b, Jn as isWgslData, K as vec3i, Mn as isBuiltinAttrib, Nn as isDecorated, Ot as ptrUniform, P as struct, Q as vec4u, R as vec2b, Sn as isData, Tn as isLooseDecorated, Tt as ptrHandle, U as vec3b, V as vec2i, Vn as isPtr, W as vec3f, X as vec4h, Y as vec4f, Yn as isWgslStruct, Z as vec4i, _ as mat4x4f, at as i32, d as MatBase, g as mat3x3f, h as mat2x2f, it as f32, jn as isAtomic, kn as Void, kt as ptrWorkgroup, nt as bool, ot as u16, q as vec3u, qn as isWgslArray, rt as f16, st as u32, v as matToArray, wn as isLooseData, wt as ptrFn, yt as _ref, z as vec2f } from "../operators-d-PMVTo7.js";
|
|
3
|
+
import { $ as uint32x4, A as packedFormats, B as sint8x4, C as float16x4, D as float32x4, E as float32x3, F as sint32x2, G as snorm8x2, H as snorm16x2, I as sint32x3, J as uint16x2, K as snorm8x4, L as sint32x4, M as sint16x2, N as sint16x4, O as formatToWGSLType, P as sint32, Q as uint32x3, R as sint8, S as float16x2, T as float32x2, U as snorm16x4, V as snorm16, W as snorm8, X as uint32, Y as uint16x4, Z as uint32x2, at as unorm16x2, ct as unorm8x2, d as isBuiltin, et as uint8, f as location, i as infixOperators, it as unorm16, j as sint16, k as isPackedData, l as interpolate, lt as unorm8x4, m as PUBLIC_sizeOf, n as arrayOf, nt as uint8x4, ot as unorm16x4, p as size, q as uint16, rt as unorm10_10_10_2, s as align, st as unorm8, t as builtin, tt as uint8x2, u as invariant, ut as unorm8x4_bgra, v as PUBLIC_alignmentOf, w as float32, x as float16, z as sint8x2 } from "../builtin-DdtWpk2t.js";
|
|
4
|
+
import { a as PUBLIC_getLongestContiguousPrefix, i as memoryLayoutOf, n as unstruct, o as PUBLIC_isContiguous, p as sampler, r as disarrayOf, s as atomic, t as deepEqual, u as comparisonSampler } from "../deepEqual-DQxK4vdp.js";
|
|
5
|
+
import { _ as textureMultisampled2d, a as texture2d, b as textureStorage2dArray, c as textureCube, d as textureDepth2dArray, f as textureDepthCube, g as textureExternal, i as texture1d, l as textureCubeArray, m as textureDepthMultisampled2d, o as texture2dArray, p as textureDepthCubeArray, s as texture3d, u as textureDepth2d, v as textureStorage1d, x as textureStorage3d, y as textureStorage2d } from "../texture-BagDrrks.js";
|
|
6
6
|
import { Operator } from "tsover-runtime";
|
|
7
7
|
|
|
8
8
|
//#region src/data/index.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cn as isDisarray, Dn as undecorate, En as isUnstruct, Nn as isDecorated, Tn as isLooseDecorated, Un as isVec, Vn as isPtr, Yn as isWgslStruct, cr as $internal, dr as $repr, er as getName, gt as schemaCallWrapper, jn as isAtomic, qn as isWgslArray, rr as setName, w as comptime } from "./operators-
|
|
2
|
-
import { _ as roundUp, b as customAlignmentOf, g as getLayoutInfo, h as sizeOf, y as alignmentOf } from "./builtin-
|
|
1
|
+
import { Cn as isDisarray, Dn as undecorate, En as isUnstruct, Nn as isDecorated, Tn as isLooseDecorated, Un as isVec, Vn as isPtr, Yn as isWgslStruct, cr as $internal, dr as $repr, er as getName, gt as schemaCallWrapper, jn as isAtomic, qn as isWgslArray, rr as setName, w as comptime } from "./operators-d-PMVTo7.js";
|
|
2
|
+
import { _ as roundUp, b as customAlignmentOf, g as getLayoutInfo, h as sizeOf, y as alignmentOf } from "./builtin-DdtWpk2t.js";
|
|
3
3
|
import { Measurer } from "typed-binary";
|
|
4
4
|
|
|
5
5
|
//#region src/data/sampler.ts
|
|
@@ -410,4 +410,4 @@ function deepEqual(a, b) {
|
|
|
410
410
|
|
|
411
411
|
//#endregion
|
|
412
412
|
export { PUBLIC_getLongestContiguousPrefix as a, offsetsForProps as c, isWgslComparisonSampler as d, isWgslSampler as f, memoryLayoutOf as i, alignIO as l, unstruct as n, PUBLIC_isContiguous as o, sampler as p, disarrayOf as r, atomic as s, deepEqual as t, comparisonSampler as u };
|
|
413
|
-
//# sourceMappingURL=deepEqual-
|
|
413
|
+
//# sourceMappingURL=deepEqual-DQxK4vdp.js.map
|