graphwise 1.8.1 → 1.9.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/dist/{adjacency-map-D-Ul7V1r.js → adjacency-map-BtKzcuJq.js} +1 -1
- package/dist/{adjacency-map-D-Ul7V1r.js.map → adjacency-map-BtKzcuJq.js.map} +1 -1
- package/dist/{adjacency-map-B6wPtmaq.cjs → adjacency-map-JqBnMNkF.cjs} +1 -1
- package/dist/{adjacency-map-B6wPtmaq.cjs.map → adjacency-map-JqBnMNkF.cjs.map} +1 -1
- package/dist/async/index.cjs +2 -2
- package/dist/async/index.js +2 -2
- package/dist/expansion/index.cjs +1 -1
- package/dist/expansion/index.js +1 -1
- package/dist/{expansion-sldRognt.js → expansion-ClDhlMK8.js} +4 -4
- package/dist/{expansion-sldRognt.js.map → expansion-ClDhlMK8.js.map} +1 -1
- package/dist/{expansion-FkmEYlrQ.cjs → expansion-DaTroIyv.cjs} +4 -4
- package/dist/{expansion-FkmEYlrQ.cjs.map → expansion-DaTroIyv.cjs.map} +1 -1
- package/dist/extraction/index.cjs +1 -1
- package/dist/extraction/index.js +1 -1
- package/dist/gpu/csr.d.ts +29 -30
- package/dist/gpu/csr.d.ts.map +1 -1
- package/dist/gpu/dispatch.d.ts +31 -0
- package/dist/gpu/dispatch.d.ts.map +1 -0
- package/dist/gpu/dispatch.unit.test.d.ts +5 -0
- package/dist/gpu/dispatch.unit.test.d.ts.map +1 -0
- package/dist/gpu/index.cjs +15 -410
- package/dist/gpu/index.d.ts +3 -1
- package/dist/gpu/index.d.ts.map +1 -1
- package/dist/gpu/index.js +2 -400
- package/dist/gpu/kernels/bfs/kernel.d.ts +59 -0
- package/dist/gpu/kernels/bfs/kernel.d.ts.map +1 -0
- package/dist/gpu/kernels/bfs/logic.d.ts +47 -0
- package/dist/gpu/kernels/bfs/logic.d.ts.map +1 -0
- package/dist/gpu/kernels/bfs/logic.unit.test.d.ts +2 -0
- package/dist/gpu/kernels/bfs/logic.unit.test.d.ts.map +1 -0
- package/dist/gpu/kernels/degree-histogram/kernel.d.ts +32 -0
- package/dist/gpu/kernels/degree-histogram/kernel.d.ts.map +1 -0
- package/dist/gpu/kernels/degree-histogram/logic.d.ts +45 -0
- package/dist/gpu/kernels/degree-histogram/logic.d.ts.map +1 -0
- package/dist/gpu/kernels/degree-histogram/logic.unit.test.d.ts +2 -0
- package/dist/gpu/kernels/degree-histogram/logic.unit.test.d.ts.map +1 -0
- package/dist/gpu/kernels/jaccard/kernel.d.ts +40 -0
- package/dist/gpu/kernels/jaccard/kernel.d.ts.map +1 -0
- package/dist/gpu/kernels/jaccard/logic.d.ts +43 -0
- package/dist/gpu/kernels/jaccard/logic.d.ts.map +1 -0
- package/dist/gpu/kernels/jaccard/logic.unit.test.d.ts +2 -0
- package/dist/gpu/kernels/jaccard/logic.unit.test.d.ts.map +1 -0
- package/dist/gpu/kernels/pagerank/kernel.d.ts +44 -0
- package/dist/gpu/kernels/pagerank/kernel.d.ts.map +1 -0
- package/dist/gpu/kernels/pagerank/logic.d.ts +50 -0
- package/dist/gpu/kernels/pagerank/logic.d.ts.map +1 -0
- package/dist/gpu/kernels/pagerank/logic.unit.test.d.ts +2 -0
- package/dist/gpu/kernels/pagerank/logic.unit.test.d.ts.map +1 -0
- package/dist/gpu/kernels/spmv/kernel.d.ts +43 -0
- package/dist/gpu/kernels/spmv/kernel.d.ts.map +1 -0
- package/dist/gpu/kernels/spmv/logic.d.ts +31 -0
- package/dist/gpu/kernels/spmv/logic.d.ts.map +1 -0
- package/dist/gpu/kernels/spmv/logic.unit.test.d.ts +2 -0
- package/dist/gpu/kernels/spmv/logic.unit.test.d.ts.map +1 -0
- package/dist/gpu/operations.d.ts +76 -0
- package/dist/gpu/operations.d.ts.map +1 -0
- package/dist/gpu/operations.unit.test.d.ts +5 -0
- package/dist/gpu/operations.unit.test.d.ts.map +1 -0
- package/dist/gpu/root.d.ts +53 -0
- package/dist/gpu/root.d.ts.map +1 -0
- package/dist/gpu/root.unit.test.d.ts +2 -0
- package/dist/gpu/root.unit.test.d.ts.map +1 -0
- package/dist/gpu/types.d.ts +3 -8
- package/dist/gpu/types.d.ts.map +1 -1
- package/dist/gpu-CHiCN0wa.js +16945 -0
- package/dist/gpu-CHiCN0wa.js.map +1 -0
- package/dist/gpu-Y6owRVMi.cjs +17028 -0
- package/dist/gpu-Y6owRVMi.cjs.map +1 -0
- package/dist/graph/index.cjs +1 -1
- package/dist/graph/index.js +1 -1
- package/dist/index/index.cjs +18 -15
- package/dist/index/index.js +10 -10
- package/dist/{jaccard-Yddrtt5D.js → jaccard-3rCdilwm.js} +2 -2
- package/dist/{jaccard-Yddrtt5D.js.map → jaccard-3rCdilwm.js.map} +1 -1
- package/dist/{jaccard-Bmd1IEFO.cjs → jaccard-Bys9_dGW.cjs} +2 -2
- package/dist/{jaccard-Bmd1IEFO.cjs.map → jaccard-Bys9_dGW.cjs.map} +1 -1
- package/dist/{kmeans-D3yX5QFs.cjs → kmeans-B8x9D1kt.cjs} +1 -1
- package/dist/{kmeans-D3yX5QFs.cjs.map → kmeans-B8x9D1kt.cjs.map} +1 -1
- package/dist/{kmeans-DVCe61Me.js → kmeans-DKkL9rAN.js} +1 -1
- package/dist/{kmeans-DVCe61Me.js.map → kmeans-DKkL9rAN.js.map} +1 -1
- package/dist/{ops-4nmI-pwk.cjs → ops-djAsQQSh.cjs} +2 -2
- package/dist/{ops-4nmI-pwk.cjs.map → ops-djAsQQSh.cjs.map} +1 -1
- package/dist/{ops-Zsu4ecEG.js → ops-upIi6JIi.js} +2 -2
- package/dist/{ops-Zsu4ecEG.js.map → ops-upIi6JIi.js.map} +1 -1
- package/dist/{priority-queue-ChVLoG6T.cjs → priority-queue-BIiD1L0k.cjs} +1 -1
- package/dist/{priority-queue-ChVLoG6T.cjs.map → priority-queue-BIiD1L0k.cjs.map} +1 -1
- package/dist/{priority-queue-DqCuFTR8.js → priority-queue-CFDd5cBg.js} +1 -1
- package/dist/{priority-queue-DqCuFTR8.js.map → priority-queue-CFDd5cBg.js.map} +1 -1
- package/dist/ranking/index.cjs +2 -2
- package/dist/ranking/index.js +2 -2
- package/dist/ranking/mi/index.cjs +2 -2
- package/dist/ranking/mi/index.js +2 -2
- package/dist/{ranking-mUm9rV-C.js → ranking-3ez5m67U.js} +2 -2
- package/dist/{ranking-mUm9rV-C.js.map → ranking-3ez5m67U.js.map} +1 -1
- package/dist/{ranking-riRrEVAR.cjs → ranking-DVvajgUZ.cjs} +2 -2
- package/dist/{ranking-riRrEVAR.cjs.map → ranking-DVvajgUZ.cjs.map} +1 -1
- package/dist/seeds/index.cjs +1 -1
- package/dist/seeds/index.js +1 -1
- package/dist/structures/index.cjs +1 -1
- package/dist/structures/index.js +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/{utils-CcIrKAEb.js → utils-BodeE2Mo.js} +1 -1
- package/dist/{utils-CcIrKAEb.js.map → utils-BodeE2Mo.js.map} +1 -1
- package/dist/{utils-CpyzmzIF.cjs → utils-CDtCcsyF.cjs} +1 -1
- package/dist/{utils-CpyzmzIF.cjs.map → utils-CDtCcsyF.cjs.map} +1 -1
- package/package.json +3 -1
- package/dist/gpu/context.d.ts +0 -118
- package/dist/gpu/context.d.ts.map +0 -1
- package/dist/gpu/context.unit.test.d.ts +0 -2
- package/dist/gpu/context.unit.test.d.ts.map +0 -1
- package/dist/gpu/index.cjs.map +0 -1
- package/dist/gpu/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu-Y6owRVMi.cjs","names":["invariant","add","sub","mul","div","pow","mod","#ptrType","assertExhaustive","bool","u32","i32","u16","f32","f16","f32","i32","bool","f32","f16","i32","u32","bool","vec2f","f32","vec2h","f16","vec2i","i32","vec2u","u32","vec2b","bool","vec3f","vec3h","vec3i","vec3u","vec3b","vec4f","vec4h","vec4i","vec4u","vec4b","u32","vec2u","vec4u","i32","vec2i","vec4i","f32","vec2f","vec4f","vec3f","vec3u","vec3i","#pos","#parseStartPos","#usedNames","#scopeStack","#usedBlockScopeNames","#isUsedInBlocksBefore","#lastUniqueId","#validProps","#typeForExtraProps","#allocated","#locations","#usedWgslKeys","#cachedStruct","f32","vec2f","vec3f","vec4f","clamp","clamp","f32","f16","f32","vec2f","vec3f","vec4f","f16","vec2h","vec3h","vec4h","i32","vec2i","vec3i","vec4i","u32","vec2u","vec3u","vec4u","bool","vec2b","vec3b","vec4b","vec2f","vec3f","vec4f","assertExhaustive","#membership","__defProp","arrayOf","resolveArray","vec2f","vec3f","vec4f","vec2h","vec3h","vec4h","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","#device","#membership","#props","#branch","#sampler","#filtering","f32","f32","vec4f","u32","vec4u","i32","vec4i","#branch","#formatInfo","#destroyed","#texture","#flags","#clearMipLevel","#writeBufferData","#writeSingleLayer","#baseTexture","#descriptor","#view","#membership","#scope","#dataType","#initialValue","assertExhaustive","#usage","#value","#membership","i32","u32","f32","#options","#logIdToMeta","u32","#dataBuffer","#indexBuffer","#firstUnusedId","f32","f16","vec2f","vec3f","vec4f","vec2h","vec3h","vec4h","i32","u32","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","f32","u32","u32","tinyest","bool","#ctx","u32","i32","#unrolling","u32","vec4f","bool","f32","vec3u","#device","u32","vec2f","vec3f","vec4f","f32","vec2i","vec3i","vec4i","i32","TB.BufferWriter","TB.BufferReader","vec2f","u32","vec4f","vec2f","vec3f","vec4f","vec2h","vec3h","vec4h","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","vec2b","vec3b","vec4b","#core","vec4f","vec2b","vec3b","vec4b","bool","f32","#expression","#externalsToApply","bool","f16","f32","i32","u16","u32","vec2b","vec2f","vec2h","vec2i","vec2u","vec3b","vec3f","vec3h","vec3i","vec3u","vec4b","vec4f","vec4h","vec4i","vec4u"],"sources":["../src/gpu/types.ts","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/env.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/package.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/symbols.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/meta.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/errors.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/slot/slotTypes.js","../node_modules/.pnpm/tsover-runtime@0.0.5/node_modules/tsover-runtime/dist/index.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/wgslTypes.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/vertexFormat.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/dataTypes.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/types.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/execMode.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/snippet.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/resolve/stitch.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/schemaCallWrapper.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/ptr.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/ref.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/stringify.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/utilityTypes.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/conversion.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/createCallableSchema.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/numeric.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/generationHelpers.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/dualImpl.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/comptime.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/resolve/externals.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/vectorImpl.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/vector.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/vertexFormatData.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/alignmentOf.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/mathUtils.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/schemaMemoryLayout.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/sizeOf.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/attributes.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/extractArgs.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/fnCore.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/templateUtils.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/tgpuFn.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/extension.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/getGPUValue.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/nameRegistry.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/struct.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/ioSchema.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/autoStruct.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/matrix.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/numberOps.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/vectorOps.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/std/operators.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/accessProp.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/accessIndex.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/valueProxyUtils.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/buffer/bufferUsage.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/alignIO.js","../node_modules/.pnpm/typed-binary@4.3.3/node_modules/typed-binary/dist/index.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/offsets.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/compiledIO.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/dataIO.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/partialIO.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/buffer/buffer.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/sampler.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/sampler/sampler.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/texture.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/texture/textureFormats.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/texture/textureUtils.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/texture/texture.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/texture/usageExtension.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/variable/tgpuVariable.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/buffer/bufferShorthand.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/slot/slot.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/slot/internalSlots.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/tgpuComputeFn.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/tgpuFragmentFn.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/tgpuVertexFn.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/_virtual/_rolldown/runtime.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/constant/tgpuConstant.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/texture/externalTexture.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgpuBindGroupLayout.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/unroll/tgpuUnroll.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/shelllessImpl.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/shellless.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/resolve/namespace.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/vertexLayout/connectAttributesToShader.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/resolve/resolveData.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/root/configurableImpl.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/shared/generators.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/array.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/atomic.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/consoleLog/serializers.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/consoleLog/types.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/consoleLog/logGenerator.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/std/numeric.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/math.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/std/array.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/forOfUtils.js","../node_modules/.pnpm/tinyest@0.3.1/node_modules/tinyest/nodes.js","../node_modules/.pnpm/tinyest@0.3.1/node_modules/tinyest/index.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/wgslGenerator.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/resolutionCtx.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/typeGuards.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/resolve/tgpuResolve.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/vertexLayout/vertexLayout.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/builtin.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/querySet/querySet.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/memo.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/limitsOverflow.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/applyPipelineState.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/std/bitcast.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/std/packing.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgsl/consoleLog/deserializers.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/wgslExtensions.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/isContiguous.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/getLongestContiguousPrefix.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/offsetUtils.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/timeable.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/computePipeline.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/function/autoIO.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/connectAttachmentToShader.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/connectTargetsToShader.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/pipeline/renderPipeline.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/std/boolean.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/root/init.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/slot/lazy.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/slot/accessor.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/declare/tgpuDeclare.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/rawCodeSnippet/tgpuRawCodeSnippet.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/core/simulate/tgpuSimulate.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgpuUnstable.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/tgpu.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/disarray.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/unstruct.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/deepEqual.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/data/index.js","../node_modules/.pnpm/typegpu@0.10.2/node_modules/typegpu/index.js","../src/gpu/csr.ts","../src/gpu/detect.ts","../src/gpu/root.ts","../src/gpu/dispatch.ts","../src/gpu/kernels/spmv/kernel.ts","../src/gpu/kernels/pagerank/kernel.ts","../src/gpu/kernels/jaccard/kernel.ts","../src/gpu/kernels/degree-histogram/kernel.ts","../src/gpu/operations.ts"],"sourcesContent":["/**\n * Type definitions for the WebGPU compute backend.\n *\n * These types define the backend selection options and result types\n * for GPU-accelerated graph operations.\n */\n\nimport type { GraphwiseGPURoot } from \"./root\";\n\n/**\n * Backend selection for compute operations.\n *\n * - 'cpu': Synchronous CPU implementation (default, always available)\n * - 'gpu': Async GPU implementation (throws if WebGPU unavailable)\n * - 'auto': Async, detect WebGPU at runtime, fall back to CPU silently\n */\nexport type ComputeBackend = \"auto\" | \"gpu\" | \"cpu\";\n\n/**\n * Result of WebGPU availability detection.\n */\nexport interface GPUDetectionResult {\n\t/** Whether WebGPU is available in the current environment */\n\treadonly available: boolean;\n\t/** Human-readable reason if unavailable */\n\treadonly reason?: string;\n}\n\n/**\n * Error thrown when GPU backend is requested but unavailable.\n */\nexport class GPUNotAvailableError extends Error {\n\tpublic constructor(reason: string) {\n\t\tsuper(`WebGPU not available: ${reason}`);\n\t\tthis.name = \"GPUNotAvailableError\";\n\t}\n}\n\n/**\n * Result wrapper for GPU operations that may fall back to CPU.\n */\nexport interface ComputeResult<T> {\n\t/** The computed result value */\n\treadonly value: T;\n\t/** Which backend was actually used */\n\treadonly backend: \"gpu\" | \"cpu\";\n\t/** Time taken in milliseconds (optional, for profiling) */\n\treadonly elapsedMs?: number;\n}\n\n/**\n * Configuration options for GPU compute operations.\n */\nexport interface GPUComputeOptions {\n\t/** Backend selection: 'auto', 'gpu', or 'cpu' */\n\treadonly backend?: ComputeBackend;\n\t/** Optional TypeGPU root to reuse (avoids device acquisition overhead) */\n\treadonly root?: GraphwiseGPURoot;\n}\n","//#region src/shared/env.ts\n/**\n* This can be used to branch functionality between \"dev\" and \"prod\" modes, so that our\n* library can omit doing unnecessary work once it's out in the wild\n*\n* Even though the value of this constant uses Node.js specific APIs, pretty much every\n* bundler replaces the expression below with either `development` or `production`\n*/\nconst DEV = process.env.NODE_ENV === \"development\";\nconst TEST = process.env.NODE_ENV === \"test\";\n\n//#endregion\nexport { DEV, TEST };","//#region package.json\nvar version = \"0.10.2\";\n\n//#endregion\nexport { version };","import { version } from \"../package.js\";\n\n//#region src/shared/symbols.ts\nconst $internal = Symbol(`typegpu:${version}:$internal`);\n/**\n* The getter to the value of this resource, accessible on the GPU\n*/\nconst $gpuValueOf = Symbol(`typegpu:${version}:$gpuValueOf`);\n/**\n* If this symbol is present, this means that getName and setName\n* will refer to object behind this property instead.\n*/\nconst $getNameForward = Symbol(`typegpu:${version}:$getNameForward`);\n/**\n* Marks an object with slot-value bindings\n*/\nconst $providing = Symbol(`typegpu:${version}:$providing`);\n/**\n* Objects can provide the snippet that represents them.\n*/\nconst $ownSnippet = Symbol(`typegpu:${version}:$ownSnippet`);\nconst $resolve = Symbol(`typegpu:${version}:$resolve`);\n/**\n* A way for a schema to provide casting behavior, without the need to be explicitly\n* callable by the end-user (e.g. vertex formats)\n*/\nconst $cast = Symbol(`typegpu:${version}:$cast`);\n/**\n* Can be called on the GPU\n*/\nconst $gpuCallable = Symbol(`typegpu:${version}:$gpuCallable`);\n/**\n* Type token for the inferred (CPU & GPU) representation of a resource\n*/\nconst $repr = Symbol(`typegpu:${version}:$repr`);\n/**\n* Type token for the inferred (GPU-side) representation of a resource\n* If present, it shadows the value of `$repr` for GPU-side inference.\n*/\nconst $gpuRepr = Symbol(`typegpu:${version}:$gpuRepr`);\n/**\n* Type token for the inferred partial representation of a resource.\n* If present, it shadows the value of `$repr` for use in partial IO.\n*/\nconst $reprPartial = Symbol(`typegpu:${version}:$reprPartial`);\n/**\n* Type token holding schemas that are identical in memory layout.\n*/\nconst $memIdent = Symbol(`typegpu:${version}:$memIdent`);\n/**\n* Type token, signaling that a schema can be used in a storage buffer.\n*/\nconst $validStorageSchema = Symbol(`typegpu:${version}:$invalidStorageSchema`);\n/**\n* Type token, signaling that a schema can be used in a uniform buffer.\n*/\nconst $validUniformSchema = Symbol(`typegpu:${version}:$validUniformSchema`);\n/**\n* Type token, signaling that a schema can be used in a vertex buffer.\n*/\nconst $validVertexSchema = Symbol(`typegpu:${version}:$validVertexSchema`);\n/**\n* Type token, containing a reason for why the schema is invalid (if it is).\n*/\nconst $invalidSchemaReason = Symbol(`typegpu:${version}:$invalidSchemaReason`);\nfunction isMarkedInternal(value) {\n\treturn !!value?.[$internal];\n}\n\n//#endregion\nexport { $cast, $getNameForward, $gpuCallable, $gpuValueOf, $internal, $ownSnippet, $providing, $repr, $resolve, isMarkedInternal };","import { version } from \"../package.js\";\nimport { DEV, TEST } from \"./env.js\";\nimport { $getNameForward, isMarkedInternal } from \"./symbols.js\";\n\n//#region src/shared/meta.ts\nconst globalWithMeta = globalThis;\nif (globalWithMeta.__TYPEGPU_VERSION__ !== void 0) console.warn(`Found duplicate TypeGPU version. First was ${globalWithMeta.__TYPEGPU_VERSION__}, this one is ${version}. This may cause unexpected behavior.`);\nglobalWithMeta.__TYPEGPU_VERSION__ = version;\nglobalWithMeta.__TYPEGPU_AUTONAME__ = (exp, label) => isNamable(exp) && isMarkedInternal(exp) && !getName(exp) ? exp.$name(label) : exp;\n/**\n* Performance measurements are only enabled in dev & test environments for now\n*/\nconst PERF = (DEV || TEST) && {\n\tget enabled() {\n\t\treturn !!globalWithMeta.__TYPEGPU_MEASURE_PERF__;\n\t},\n\trecord(name, data) {\n\t\tconst records = globalWithMeta.__TYPEGPU_PERF_RECORDS__ ??= /* @__PURE__ */ new Map();\n\t\tlet entries = records.get(name);\n\t\tif (!entries) {\n\t\t\tentries = [];\n\t\t\trecords.set(name, entries);\n\t\t}\n\t\tentries.push(data);\n\t}\n} || void 0;\nfunction isForwarded(value) {\n\treturn !!value?.[$getNameForward];\n}\nfunction getName(definition) {\n\tif (isForwarded(definition)) return getName(definition[$getNameForward]);\n\treturn getMetaData(definition)?.name;\n}\nfunction setName(definition, name) {\n\tif (isForwarded(definition)) {\n\t\tsetName(definition[$getNameForward], name);\n\t\treturn;\n\t}\n\tsetMetaData(definition, { name });\n}\nfunction isNamable(value) {\n\treturn !!value?.$name;\n}\n/**\n* AST's are given to functions with a 'use gpu' directive, which this function checks for.\n*/\nfunction hasTinyestMetadata(value) {\n\treturn !!getMetaData(value)?.ast;\n}\nfunction getMetaData(definition) {\n\treturn globalWithMeta.__TYPEGPU_META__.get(definition);\n}\nfunction setMetaData(definition, metaData) {\n\tglobalWithMeta.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap();\n\tconst map = globalWithMeta.__TYPEGPU_META__;\n\tmap.set(definition, {\n\t\t...map.get(definition),\n\t\t...metaData\n\t});\n}\n\n//#endregion\nexport { PERF, getMetaData, getName, hasTinyestMetadata, isNamable, setName };","import { DEV, TEST } from \"./shared/env.js\";\nimport { getName, hasTinyestMetadata } from \"./shared/meta.js\";\n\n//#region src/errors.ts\nconst prefix = \"Invariant failed\";\n/**\n* Inspired by: https://github.com/alexreardon/tiny-invariant/blob/master/src/tiny-invariant.ts\n*/\nfunction invariant(condition, message) {\n\tif (condition) return;\n\tif (!DEV && !TEST) throw new Error(prefix);\n\tconst provided = typeof message === \"function\" ? message() : message;\n\tconst value = provided ? `${prefix}: ${provided}` : prefix;\n\tthrow new Error(value);\n}\n/**\n* An error that happens during resolution of WGSL code.\n* Contains a trace of all ancestor resolvables in\n* which this error originated.\n*\n* @category Errors\n*/\nvar ResolutionError = class ResolutionError extends Error {\n\tconstructor(cause, trace) {\n\t\tlet entries = trace.map((ancestor) => `- ${hasTinyestMetadata(ancestor) ? `fn*:${getName(ancestor)}` : ancestor}`);\n\t\tif (entries.length > 20) entries = [\n\t\t\t...entries.slice(0, 11),\n\t\t\t\"...\",\n\t\t\t...entries.slice(-10)\n\t\t];\n\t\tsuper(`Resolution of the following tree failed:\\n${entries.join(\"\\n\")}: ${cause && typeof cause === \"object\" && \"message\" in cause ? cause.message : cause}`);\n\t\tthis.cause = cause;\n\t\tthis.trace = trace;\n\t\tObject.setPrototypeOf(this, ResolutionError.prototype);\n\t}\n\tappendToTrace(ancestor) {\n\t\tconst newTrace = [ancestor, ...this.trace];\n\t\treturn new ResolutionError(this.cause, newTrace);\n\t}\n};\n/**\n* An error that happens during execution of TypeGPU functions.\n* Contains a trace of all TypeGPU functions called along the way.\n*\n* @category Errors\n*/\nvar ExecutionError = class ExecutionError extends Error {\n\tconstructor(cause, trace) {\n\t\tlet entries = trace.map((ancestor) => `- ${ancestor}`);\n\t\tif (entries.length > 20) entries = [\n\t\t\t...entries.slice(0, 11),\n\t\t\t\"...\",\n\t\t\t...entries.slice(-10)\n\t\t];\n\t\tsuper(`Execution of the following tree failed:\\n${entries.join(\"\\n\")}: ${cause && typeof cause === \"object\" && \"message\" in cause ? cause.message : cause}`);\n\t\tthis.cause = cause;\n\t\tthis.trace = trace;\n\t\tObject.setPrototypeOf(this, ExecutionError.prototype);\n\t}\n\tappendToTrace(ancestor) {\n\t\tconst newTrace = [ancestor, ...this.trace];\n\t\treturn new ExecutionError(this.cause, newTrace);\n\t}\n};\n/**\n* @category Errors\n*/\nvar MissingSlotValueError = class MissingSlotValueError extends Error {\n\tconstructor(slot) {\n\t\tsuper(`Missing value for '${slot}'`);\n\t\tthis.slot = slot;\n\t\tObject.setPrototypeOf(this, MissingSlotValueError.prototype);\n\t}\n};\n/**\n* @category Errors\n*/\nvar NotUniformError = class NotUniformError extends Error {\n\tconstructor(value) {\n\t\tsuper(`Buffer '${getName(value) ?? \"<unnamed>\"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`);\n\t\tObject.setPrototypeOf(this, NotUniformError.prototype);\n\t}\n};\nvar MissingLinksError = class MissingLinksError extends Error {\n\tconstructor(fnLabel, externalNames) {\n\t\tsuper(`The function '${fnLabel ?? \"<unnamed>\"}' is missing links to the following external values: ${externalNames}.`);\n\t\tObject.setPrototypeOf(this, MissingLinksError.prototype);\n\t}\n};\nvar MissingBindGroupsError = class MissingBindGroupsError extends Error {\n\tconstructor(layouts) {\n\t\tsuper(`Missing bind groups for layouts: '${[...layouts].map((layout) => getName(layout) ?? \"<unnamed>\").join(\", \")}'. Please provide it using pipeline.with(bindGroup).(...)`);\n\t\tObject.setPrototypeOf(this, MissingBindGroupsError.prototype);\n\t}\n};\nvar MissingVertexBuffersError = class MissingVertexBuffersError extends Error {\n\tconstructor(layouts) {\n\t\tsuper(`Missing vertex buffers for layouts: '${[...layouts].map((layout) => getName(layout) ?? \"<unnamed>\").join(\", \")}'. Please provide it using pipeline.with(layout, buffer).(...)`);\n\t\tObject.setPrototypeOf(this, MissingVertexBuffersError.prototype);\n\t}\n};\nvar IllegalVarAccessError = class IllegalVarAccessError extends Error {\n\tconstructor(msg) {\n\t\tsuper(msg);\n\t\tObject.setPrototypeOf(this, IllegalVarAccessError.prototype);\n\t}\n};\nvar IllegalBufferAccessError = class IllegalBufferAccessError extends Error {\n\tconstructor(msg) {\n\t\tsuper(msg);\n\t\tObject.setPrototypeOf(this, IllegalBufferAccessError.prototype);\n\t}\n};\nvar WgslTypeError = class WgslTypeError extends Error {\n\tconstructor(msg) {\n\t\tsuper(msg);\n\t\tObject.setPrototypeOf(this, WgslTypeError.prototype);\n\t}\n};\nvar SignatureNotSupportedError = class SignatureNotSupportedError extends Error {\n\tconstructor(actual, candidates) {\n\t\tsuper(`Unsupported data types: ${actual.map((a) => a.type).join(\", \")}. Supported types are: ${candidates.map((r) => r.type).join(\", \")}.`);\n\t\tObject.setPrototypeOf(this, SignatureNotSupportedError.prototype);\n\t}\n};\n\n//#endregion\nexport { ExecutionError, IllegalBufferAccessError, IllegalVarAccessError, MissingBindGroupsError, MissingLinksError, MissingSlotValueError, MissingVertexBuffersError, NotUniformError, ResolutionError, SignatureNotSupportedError, WgslTypeError, invariant };","import { $providing } from \"../../shared/symbols.js\";\n\n//#region src/core/slot/slotTypes.ts\nfunction isSlot(value) {\n\treturn value?.resourceType === \"slot\";\n}\nfunction isLazy(value) {\n\treturn value?.resourceType === \"lazy\";\n}\nfunction isProviding(value) {\n\treturn value?.[$providing] !== void 0;\n}\nfunction isAccessor(value) {\n\treturn value?.resourceType === \"accessor\";\n}\nfunction isMutableAccessor(value) {\n\treturn value?.resourceType === \"mutable-accessor\";\n}\n\n//#endregion\nexport { isAccessor, isLazy, isMutableAccessor, isProviding, isSlot };","//#region src/index.ts\nfunction polyfillSymbol(name) {\n\tif (typeof Symbol[name] === \"undefined\") Object.defineProperty(Symbol, name, {\n\t\tvalue: Symbol.for(`Symbol.${name}`),\n\t\twritable: false,\n\t\tenumerable: false,\n\t\tconfigurable: false\n\t});\n}\n/**\n* Checks if a value has the [T] property\n*/\nfunction hasOperator(value, operator) {\n\treturn typeof value?.[operator] === \"function\";\n}\nfunction binOp(a, b, opSymbol, fallback) {\n\tlet result = Operator.deferOperation;\n\tif (hasOperator(a, opSymbol)) result = a[opSymbol](a, b);\n\tif (result === Operator.deferOperation && hasOperator(b, opSymbol)) result = b[opSymbol](a, b);\n\tif (result === Operator.deferOperation) return fallback(a, b);\n\treturn result;\n}\nconst normalAdd = (a, b) => a + b;\n/**\n* Performs the + operation with support for operator overloading\n* If either operand has Symbol.operatorPlus, uses that operator\n* Otherwise falls back to standard JavaScript + behavior\n*/\nfunction add(a, b) {\n\tif ((typeof a === \"number\" || typeof a === \"string\") && (typeof b === \"number\" || typeof b === \"string\")) return a + b;\n\treturn binOp(a, b, Operator.plus, normalAdd);\n}\nconst normalSub = (a, b) => a - b;\n/**\n* Performs the - operation with support for operator overloading\n* If either operand has Symbol.operatorMinus, uses that operator\n* Otherwise falls back to standard JavaScript - behavior\n*/\nfunction sub(a, b) {\n\tif (typeof a === \"number\" && typeof b === \"number\") return a - b;\n\treturn binOp(a, b, Operator.minus, normalSub);\n}\nconst normalMul = (a, b) => a * b;\n/**\n* Performs the * operation with support for operator overloading\n* If either operand has Symbol.operatorStar, uses that operator\n* Otherwise falls back to standard JavaScript * behavior\n*/\nfunction mul(a, b) {\n\tif (typeof a === \"number\" && typeof b === \"number\") return a * b;\n\treturn binOp(a, b, Operator.star, normalMul);\n}\nconst normalDiv = (a, b) => a / b;\n/**\n* Performs the / operation with support for operator overloading\n* If either operand has Symbol.operatorSlash, uses that operator\n* Otherwise falls back to standard JavaScript / behavior\n*/\nfunction div(a, b) {\n\tif (typeof a === \"number\" && typeof b === \"number\") return a / b;\n\treturn binOp(a, b, Operator.slash, normalDiv);\n}\nconst normalPow = (a, b) => a ** b;\n/**\n* Performs the ** operation with support for operator overloading\n* If either operand has Symbol.operatorStarStar, uses that operator\n* Otherwise falls back to standard JavaScript ** behavior\n*/\nfunction pow(a, b) {\n\tif (typeof a === \"number\" && typeof b === \"number\") return a ** b;\n\treturn binOp(a, b, Operator.starStar, normalPow);\n}\nconst normalMod = (a, b) => a % b;\n/**\n* Performs the % operation with support for operator overloading\n* If either operand has Symbol.operatorPercent, uses that operator\n* Otherwise falls back to standard JavaScript % behavior\n*/\nfunction mod(a, b) {\n\tif (typeof a === \"number\" && typeof b === \"number\") return a % b;\n\treturn binOp(a, b, Operator.percent, normalMod);\n}\nconst Operator = /* @__PURE__ */ (() => {\n\tpolyfillSymbol(\"deferOperation\");\n\tpolyfillSymbol(\"operatorPlus\");\n\tpolyfillSymbol(\"operatorMinus\");\n\tpolyfillSymbol(\"operatorStar\");\n\tpolyfillSymbol(\"operatorSlash\");\n\tpolyfillSymbol(\"operatorStarStar\");\n\tpolyfillSymbol(\"operatorPercent\");\n\tpolyfillSymbol(\"operatorEqEq\");\n\tpolyfillSymbol(\"operatorPrePlusPlus\");\n\tpolyfillSymbol(\"operatorPreMinusMinus\");\n\tpolyfillSymbol(\"operatorPostPlusPlus\");\n\tpolyfillSymbol(\"operatorPostMinusMinus\");\n\tpolyfillSymbol(\"operatorPreMinus\");\n\tglobalThis.__tsover_add = add;\n\tglobalThis.__tsover_sub = sub;\n\tglobalThis.__tsover_mul = mul;\n\tglobalThis.__tsover_div = div;\n\tglobalThis.__tsover_pow = pow;\n\tglobalThis.__tsover_mod = mod;\n\treturn {\n\t\tdeferOperation: Symbol.deferOperation,\n\t\tplus: Symbol.operatorPlus,\n\t\tminus: Symbol.operatorMinus,\n\t\tstar: Symbol.operatorStar,\n\t\tslash: Symbol.operatorSlash,\n\t\tstarStar: Symbol.operatorStarStar,\n\t\tpercent: Symbol.operatorPercent,\n\t\teqEq: Symbol.operatorEqEq,\n\t\tprePlusPlus: Symbol.operatorPrePlusPlus,\n\t\tpreMinusMinus: Symbol.operatorPreMinusMinus,\n\t\tpostPlusPlus: Symbol.operatorPostPlusPlus,\n\t\tpostMinusMinus: Symbol.operatorPostMinusMinus,\n\t\tpreMinus: Symbol.operatorPreMinus\n\t};\n})();\n\n//#endregion\nexport { Operator };\n//# sourceMappingURL=index.js.map","import { $internal, isMarkedInternal } from \"../shared/symbols.js\";\nimport \"tsover-runtime\";\n\n//#region src/data/wgslTypes.ts\nconst Void = {\n\t[$internal]: {},\n\ttype: \"void\",\n\ttoString() {\n\t\treturn \"void\";\n\t}\n};\nconst wgslTypeLiterals = [\n\t\"bool\",\n\t\"f32\",\n\t\"f16\",\n\t\"i32\",\n\t\"u32\",\n\t\"u16\",\n\t\"vec2f\",\n\t\"vec2h\",\n\t\"vec2i\",\n\t\"vec2u\",\n\t\"vec2<bool>\",\n\t\"vec3f\",\n\t\"vec3h\",\n\t\"vec3i\",\n\t\"vec3u\",\n\t\"vec3<bool>\",\n\t\"vec4f\",\n\t\"vec4h\",\n\t\"vec4i\",\n\t\"vec4u\",\n\t\"vec4<bool>\",\n\t\"mat2x2f\",\n\t\"mat3x3f\",\n\t\"mat4x4f\",\n\t\"struct\",\n\t\"array\",\n\t\"ptr\",\n\t\"atomic\",\n\t\"decorated\",\n\t\"abstractInt\",\n\t\"abstractFloat\",\n\t\"void\",\n\t\"texture_1d\",\n\t\"texture_storage_1d\",\n\t\"texture_2d\",\n\t\"texture_storage_2d\",\n\t\"texture_multisampled_2d\",\n\t\"texture_depth_2d\",\n\t\"texture_depth_multisampled_2d\",\n\t\"texture_2d_array\",\n\t\"texture_storage_2d_array\",\n\t\"texture_depth_2d_array\",\n\t\"texture_cube\",\n\t\"texture_depth_cube\",\n\t\"texture_cube_array\",\n\t\"texture_depth_cube_array\",\n\t\"texture_3d\",\n\t\"texture_storage_3d\",\n\t\"texture_external\",\n\t\"sampler\",\n\t\"sampler_comparison\"\n];\nfunction isVecInstance(value) {\n\tconst v = value;\n\treturn isMarkedInternal(v) && typeof v.kind === \"string\" && v.kind.startsWith(\"vec\");\n}\nfunction isVec2(value) {\n\tconst v = value;\n\treturn isMarkedInternal(v) && typeof v.type === \"string\" && v.type.startsWith(\"vec2\");\n}\nfunction isVec3(value) {\n\tconst v = value;\n\treturn isMarkedInternal(v) && typeof v.type === \"string\" && v.type.startsWith(\"vec3\");\n}\nfunction isVec4(value) {\n\tconst v = value;\n\treturn isMarkedInternal(v) && typeof v.type === \"string\" && v.type.startsWith(\"vec4\");\n}\nfunction isVec(value) {\n\treturn isVec2(value) || isVec3(value) || isVec4(value);\n}\nfunction isVecBool(value) {\n\treturn isVec(value) && value.type.includes(\"b\");\n}\nfunction isMatInstance(value) {\n\tconst v = value;\n\treturn isMarkedInternal(v) && typeof v.kind?.startsWith === \"function\" && v.kind.startsWith(\"mat\");\n}\nfunction isMat2x2f(value) {\n\treturn isMarkedInternal(value) && value?.type === \"mat2x2f\";\n}\nfunction isMat3x3f(value) {\n\treturn isMarkedInternal(value) && value?.type === \"mat3x3f\";\n}\nfunction isMat4x4f(value) {\n\treturn isMarkedInternal(value) && value?.type === \"mat4x4f\";\n}\nfunction isMat(value) {\n\treturn isMat2x2f(value) || isMat3x3f(value) || isMat4x4f(value);\n}\nfunction isFloat32VecInstance(element) {\n\treturn isVecInstance(element) && [\n\t\t\"vec2f\",\n\t\t\"vec3f\",\n\t\t\"vec4f\"\n\t].includes(element.kind);\n}\nfunction isWgslData(value) {\n\treturn isMarkedInternal(value) && wgslTypeLiterals.includes(value?.type);\n}\n/**\n* Checks whether passed in value is an array schema,\n* as opposed to, e.g., a disarray schema.\n*\n* Array schemas can be used to describe uniform and storage buffers,\n* whereas disarray schemas cannot.\n*\n* @example\n* isWgslArray(d.arrayOf(d.u32, 4)) // true\n* isWgslArray(d.disarray(d.u32, 4)) // false\n* isWgslArray(d.vec3f) // false\n*/\nfunction isWgslArray(schema) {\n\treturn isMarkedInternal(schema) && schema?.type === \"array\";\n}\n/**\n* Checks whether passed in value is a struct schema,\n* as opposed to, e.g., an unstruct schema.\n*\n* Struct schemas can be used to describe uniform and storage buffers,\n* whereas unstruct schemas cannot.\n*\n* @example\n* isWgslStruct(d.struct({ a: d.u32 })) // true\n* isWgslStruct(d.unstruct({ a: d.u32 })) // false\n* isWgslStruct(d.vec3f) // false\n*/\nfunction isWgslStruct(schema) {\n\treturn isMarkedInternal(schema) && schema?.type === \"struct\";\n}\n/**\n* Checks whether passed in value is a pointer schema.\n*\n* @example\n* isPtr(d.ptrFn(d.f32)) // true\n* isPtr(d.ptrPrivate(d.f32)) // true\n* isPtr(d.f32) // false\n*/\nfunction isPtr(schema) {\n\treturn isMarkedInternal(schema) && schema?.type === \"ptr\";\n}\n/**\n* Checks whether the passed in value is an atomic schema.\n*\n* @example\n* isAtomic(d.atomic(d.u32)) // true\n* isAtomic(d.u32) // false\n*/\nfunction isAtomic(schema) {\n\treturn isMarkedInternal(schema) && schema?.type === \"atomic\";\n}\nfunction isAlignAttrib(value) {\n\treturn isMarkedInternal(value) && value?.type === \"@align\";\n}\nfunction isSizeAttrib(value) {\n\treturn isMarkedInternal(value) && value?.type === \"@size\";\n}\nfunction isLocationAttrib(value) {\n\treturn isMarkedInternal(value) && value?.type === \"@location\";\n}\nfunction isInterpolateAttrib(value) {\n\treturn isMarkedInternal(value) && value?.type === \"@interpolate\";\n}\nfunction isBuiltinAttrib(value) {\n\treturn isMarkedInternal(value) && value?.type === \"@builtin\";\n}\nfunction isDecorated(value) {\n\treturn isMarkedInternal(value) && value?.type === \"decorated\";\n}\nfunction isVoid(value) {\n\treturn isMarkedInternal(value) && value.type === \"void\";\n}\nfunction isNumericSchema(schema) {\n\tconst type = schema?.type;\n\treturn isMarkedInternal(schema) && (type === \"abstractInt\" || type === \"abstractFloat\" || type === \"f32\" || type === \"f16\" || type === \"i32\" || type === \"u32\");\n}\nfunction isHalfPrecisionSchema(schema) {\n\tconst type = schema?.type;\n\treturn isMarkedInternal(schema) && (type === \"f16\" || type === \"vec2h\" || type === \"vec3h\" || type === \"vec4h\");\n}\nconst ephemeralTypes = [\n\t\"abstractInt\",\n\t\"abstractFloat\",\n\t\"f32\",\n\t\"f16\",\n\t\"i32\",\n\t\"u32\",\n\t\"bool\"\n];\n/**\n* Returns true for schemas that are not naturally referential in JS (primitives).\n* @param schema\n* @returns\n*/\nfunction isNaturallyEphemeral(schema) {\n\treturn !isMarkedInternal(schema) || ephemeralTypes.includes(schema?.type);\n}\nfunction WORKAROUND_getSchema(vec) {\n\treturn vec.schema;\n}\n\n//#endregion\nexport { Void, WORKAROUND_getSchema, isAlignAttrib, isAtomic, isBuiltinAttrib, isDecorated, isFloat32VecInstance, isHalfPrecisionSchema, isInterpolateAttrib, isLocationAttrib, isMat, isMat2x2f, isMat3x3f, isMatInstance, isNaturallyEphemeral, isNumericSchema, isPtr, isSizeAttrib, isVec, isVecBool, isVecInstance, isVoid, isWgslArray, isWgslData, isWgslStruct };","//#region src/shared/vertexFormat.ts\nconst vertexFormats = [\n\t\"uint8\",\n\t\"uint8x2\",\n\t\"uint8x4\",\n\t\"sint8\",\n\t\"sint8x2\",\n\t\"sint8x4\",\n\t\"unorm8\",\n\t\"unorm8x2\",\n\t\"unorm8x4\",\n\t\"snorm8\",\n\t\"snorm8x2\",\n\t\"snorm8x4\",\n\t\"uint16\",\n\t\"uint16x2\",\n\t\"uint16x4\",\n\t\"sint16\",\n\t\"sint16x2\",\n\t\"sint16x4\",\n\t\"unorm16\",\n\t\"unorm16x2\",\n\t\"unorm16x4\",\n\t\"snorm16\",\n\t\"snorm16x2\",\n\t\"snorm16x4\",\n\t\"float16\",\n\t\"float16x2\",\n\t\"float16x4\",\n\t\"float32\",\n\t\"float32x2\",\n\t\"float32x3\",\n\t\"float32x4\",\n\t\"uint32\",\n\t\"uint32x2\",\n\t\"uint32x3\",\n\t\"uint32x4\",\n\t\"sint32\",\n\t\"sint32x2\",\n\t\"sint32x3\",\n\t\"sint32x4\",\n\t\"unorm10-10-10-2\",\n\t\"unorm8x4-bgra\"\n];\nconst kindToDefaultFormatMap = {\n\tf32: \"float32\",\n\tvec2f: \"float32x2\",\n\tvec3f: \"float32x3\",\n\tvec4f: \"float32x4\",\n\tf16: \"float16\",\n\tvec2h: \"float16x2\",\n\tvec4h: \"float16x4\",\n\tu32: \"uint32\",\n\tvec2u: \"uint32x2\",\n\tvec3u: \"uint32x3\",\n\tvec4u: \"uint32x4\",\n\ti32: \"sint32\",\n\tvec2i: \"sint32x2\",\n\tvec3i: \"sint32x3\",\n\tvec4i: \"sint32x4\"\n};\n\n//#endregion\nexport { kindToDefaultFormatMap, vertexFormats };","import { $internal, isMarkedInternal } from \"../shared/symbols.js\";\nimport { setName } from \"../shared/meta.js\";\nimport { vertexFormats } from \"../shared/vertexFormat.js\";\nimport { isAlignAttrib, isDecorated, isLocationAttrib, isPtr, isSizeAttrib, isWgslData } from \"./wgslTypes.js\";\n\n//#region src/data/dataTypes.ts\n/**\n* Runtime function to extract the inner data type from decorated types.\n* If the data is not decorated, returns the data as-is.\n*/\nfunction undecorate(data) {\n\tif (isDecorated(data) || isLooseDecorated(data)) return data.inner;\n\treturn data;\n}\nfunction unptr(data) {\n\tif (isPtr(data)) return data.inner;\n\treturn data;\n}\nconst looseTypeLiterals = [\n\t\"unstruct\",\n\t\"disarray\",\n\t\"loose-decorated\",\n\t...vertexFormats\n];\nfunction isLooseData(data) {\n\treturn isMarkedInternal(data) && looseTypeLiterals.includes(data?.type);\n}\n/**\n* Checks whether the passed in value is a disarray schema,\n* as opposed to, e.g., a regular array schema.\n*\n* Array schemas can be used to describe uniform and storage buffers,\n* whereas disarray schemas cannot. Disarrays are useful for\n* defining vertex buffers instead.\n*\n* @example\n* isDisarray(d.arrayOf(d.u32, 4)) // false\n* isDisarray(d.disarrayOf(d.u32, 4)) // true\n* isDisarray(d.vec3f) // false\n*/\nfunction isDisarray(schema) {\n\treturn isMarkedInternal(schema) && schema?.type === \"disarray\";\n}\n/**\n* Checks whether passed in value is a unstruct schema,\n* as opposed to, e.g., a struct schema.\n*\n* Struct schemas can be used to describe uniform and storage buffers,\n* whereas unstruct schemas cannot. Unstructs are useful for\n* defining vertex buffers instead.\n*\n* @example\n* isUnstruct(d.struct({ a: d.u32 })) // false\n* isUnstruct(d.unstruct({ a: d.u32 })) // true\n* isUnstruct(d.vec3f) // false\n*/\nfunction isUnstruct(schema) {\n\treturn isMarkedInternal(schema) && schema?.type === \"unstruct\";\n}\nfunction isLooseDecorated(value) {\n\treturn isMarkedInternal(value) && value?.type === \"loose-decorated\";\n}\nfunction getCustomAlignment(data) {\n\treturn data.attribs?.find(isAlignAttrib)?.params[0];\n}\nfunction getCustomSize(data) {\n\treturn data.attribs?.find(isSizeAttrib)?.params[0];\n}\nfunction getCustomLocation(data) {\n\treturn data.attribs?.find(isLocationAttrib)?.params[0];\n}\nfunction isData(value) {\n\treturn isWgslData(value) || isLooseData(value);\n}\nconst UnknownData = Symbol(\"UNKNOWN\");\nvar InfixDispatch = class {\n\tconstructor(name, lhs, operator) {\n\t\tthis.name = name;\n\t\tthis.lhs = lhs;\n\t\tthis.operator = operator;\n\t}\n};\nvar MatrixColumnsAccess = class {\n\tconstructor(matrix) {\n\t\tthis.matrix = matrix;\n\t}\n};\nvar ConsoleLog = class {\n\t[$internal] = true;\n\tconstructor(op) {\n\t\tthis.op = op;\n\t\tsetName(this, \"consoleLog\");\n\t}\n};\n\n//#endregion\nexport { ConsoleLog, InfixDispatch, MatrixColumnsAccess, UnknownData, getCustomAlignment, getCustomLocation, getCustomSize, isData, isDisarray, isLooseData, isLooseDecorated, isUnstruct, undecorate, unptr };","import { $cast, $gpuCallable, $ownSnippet, $resolve } from \"./shared/symbols.js\";\nimport { isWgslData } from \"./data/wgslTypes.js\";\nimport { UnknownData } from \"./data/dataTypes.js\";\nimport { isLazy, isProviding, isSlot } from \"./core/slot/slotTypes.js\";\n\n//#region src/types.ts\nvar NormalState = class {\n\ttype = \"normal\";\n};\nvar CodegenState = class {\n\ttype = \"codegen\";\n};\nvar SimulationState = class {\n\ttype = \"simulate\";\n\tconstructor(buffers, vars) {\n\t\tthis.buffers = buffers;\n\t\tthis.vars = vars;\n\t}\n};\nfunction isSelfResolvable(value) {\n\treturn !!value?.[$resolve];\n}\nfunction getOwnSnippet(value) {\n\treturn value?.[$ownSnippet];\n}\nfunction isGPUCallable(value) {\n\treturn !!value?.[$gpuCallable];\n}\nfunction hasCast(value) {\n\treturn !!value?.[$cast];\n}\nfunction isKnownAtComptime(snippet) {\n\treturn (typeof snippet.value !== \"string\" || snippet.dataType === UnknownData) && getOwnSnippet(snippet.value) === void 0;\n}\nfunction isWgsl(value) {\n\treturn typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"string\" || isSelfResolvable(value) || isWgslData(value) || isSlot(value) || isLazy(value) || isProviding(value);\n}\nfunction isGPUBuffer(value) {\n\treturn !!value && typeof value === \"object\" && \"getMappedRange\" in value && \"mapAsync\" in value;\n}\n\n//#endregion\nexport { CodegenState, NormalState, SimulationState, getOwnSnippet, hasCast, isGPUBuffer, isGPUCallable, isKnownAtComptime, isSelfResolvable, isWgsl };","import { invariant } from \"./errors.js\";\nimport { NormalState } from \"./types.js\";\n\n//#region src/execMode.ts\n/**\n* Used to track if the code we're currently\n* executing is inside an executing TypeGPU function.\n*\n* Helpful for providing better error messages.\n*/\nlet insideTgpuFn = false;\nfunction provideInsideTgpuFn(callback) {\n\tif (insideTgpuFn) return callback();\n\ttry {\n\t\tinsideTgpuFn = true;\n\t\treturn callback();\n\t} finally {\n\t\tinsideTgpuFn = false;\n\t}\n}\nfunction isInsideTgpuFn() {\n\treturn insideTgpuFn;\n}\nlet resolutionCtx;\nfunction provideCtx(ctx, callback) {\n\tinvariant(resolutionCtx === void 0 || resolutionCtx === ctx, \"Cannot nest context providers\");\n\tif (resolutionCtx === ctx) return callback();\n\tresolutionCtx = ctx;\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tresolutionCtx = void 0;\n\t}\n}\nfunction getResolutionCtx() {\n\treturn resolutionCtx;\n}\n/**\n* Applicable when code is being executed outside of any\n* execution-altering APIs.\n*/\nconst topLevelState = new NormalState();\nfunction getExecMode() {\n\treturn resolutionCtx?.mode ?? topLevelState;\n}\nfunction inCodegenMode() {\n\treturn resolutionCtx?.mode.type === \"codegen\";\n}\n\n//#endregion\nexport { getExecMode, getResolutionCtx, inCodegenMode, isInsideTgpuFn, provideCtx, provideInsideTgpuFn, topLevelState };","import { DEV } from \"../shared/env.js\";\nimport { isNumericSchema } from \"./wgslTypes.js\";\nimport { undecorate } from \"./dataTypes.js\";\n\n//#region src/data/snippet.ts\nfunction isEphemeralOrigin(space) {\n\treturn space === \"runtime\" || space === \"constant\" || space === \"argument\";\n}\nfunction isEphemeralSnippet(snippet) {\n\treturn isEphemeralOrigin(snippet.origin);\n}\nconst originToPtrParams = {\n\tuniform: {\n\t\tspace: \"uniform\",\n\t\taccess: \"read\"\n\t},\n\treadonly: {\n\t\tspace: \"storage\",\n\t\taccess: \"read\"\n\t},\n\tmutable: {\n\t\tspace: \"storage\",\n\t\taccess: \"read-write\"\n\t},\n\tworkgroup: {\n\t\tspace: \"workgroup\",\n\t\taccess: \"read-write\"\n\t},\n\tprivate: {\n\t\tspace: \"private\",\n\t\taccess: \"read-write\"\n\t},\n\tfunction: {\n\t\tspace: \"function\",\n\t\taccess: \"read-write\"\n\t},\n\t\"this-function\": {\n\t\tspace: \"function\",\n\t\taccess: \"read-write\"\n\t}\n};\nvar SnippetImpl = class {\n\tconstructor(value, dataType, origin) {\n\t\tthis.value = value;\n\t\tthis.dataType = dataType;\n\t\tthis.origin = origin;\n\t}\n};\nfunction isSnippet(value) {\n\treturn value instanceof SnippetImpl;\n}\nfunction isSnippetNumeric(snippet) {\n\treturn isNumericSchema(snippet.dataType);\n}\nfunction snip(value, dataType, origin) {\n\tif (DEV && isSnippet(value)) throw new Error(\"Cannot nest snippets\");\n\treturn new SnippetImpl(value, undecorate(dataType), origin);\n}\n\n//#endregion\nexport { isEphemeralOrigin, isEphemeralSnippet, isSnippet, isSnippetNumeric, originToPtrParams, snip };","import { isSnippet } from \"../../data/snippet.js\";\nimport { getResolutionCtx } from \"../../execMode.js\";\n\n//#region src/core/resolve/stitch.ts\n/**\n* \"The reverse of snipping\"\n* Injects resolved snippets into a template string.\n*/\nfunction stitch(strings, ...snippets) {\n\tconst ctx = getResolutionCtx();\n\tfunction resolveSnippet(maybeSnippet) {\n\t\treturn isSnippet(maybeSnippet) ? ctx.resolve(maybeSnippet.value, maybeSnippet.dataType).value : maybeSnippet;\n\t}\n\tlet result = \"\";\n\tfor (let i = 0; i < strings.length; ++i) {\n\t\tresult += strings[i];\n\t\tconst snippet = snippets[i];\n\t\tif (Array.isArray(snippet)) result += snippet.filter((s) => s !== void 0).map(resolveSnippet).join(\", \");\n\t\telse if (snippet) result += resolveSnippet(snippet);\n\t}\n\treturn result;\n}\n\n//#endregion\nexport { stitch };","import { $cast, $gpuCallable } from \"../shared/symbols.js\";\nimport { hasCast, isGPUCallable } from \"../types.js\";\n\n//#region src/data/schemaCallWrapper.ts\n/**\n* A wrapper for `schema(item)` or `schema()` call on JS side.\n* If the schema is a pointer, returns the value pointed to without copying.\n* If the schema is a TgpuVertexFormatData, calls the corresponding constructible schema instead.\n* If the schema is not callable, throws an error.\n* Otherwise, returns `schema(item)` or `schema()`.\n*/\nfunction schemaCallWrapper(schema, item) {\n\tconst callSchema = schema;\n\tif (hasCast(callSchema)) return callSchema[$cast](item);\n\tif (typeof callSchema !== \"function\") return item;\n\treturn item === void 0 ? callSchema() : callSchema(item);\n}\n/**\n* A wrapper for `schema(item)` or `schema()` call on the GPU side.\n* If the schema is a pointer, returns the value pointed to without copying.\n* If the schema is a TgpuVertexFormatData, calls the corresponding constructible schema instead.\n* If the schema is not callable, throws an error.\n* Otherwise, returns `schema(item)` or `schema()`.\n*/\nfunction schemaCallWrapperGPU(ctx, schema, item) {\n\tif (!isGPUCallable(schema)) return item;\n\tconst callSchema = schema;\n\treturn item === void 0 || item.value === void 0 ? callSchema[$gpuCallable].call(ctx, []) : callSchema[$gpuCallable].call(ctx, [item]);\n}\n\n//#endregion\nexport { schemaCallWrapper, schemaCallWrapperGPU };","import { $internal } from \"../shared/symbols.js\";\nimport { originToPtrParams } from \"./snippet.js\";\n\n//#region src/data/ptr.ts\nfunction ptrFn(inner) {\n\treturn INTERNAL_createPtr(\"function\", inner, \"read-write\");\n}\nfunction ptrPrivate(inner) {\n\treturn INTERNAL_createPtr(\"private\", inner, \"read-write\");\n}\nfunction ptrWorkgroup(inner) {\n\treturn INTERNAL_createPtr(\"workgroup\", inner, \"read-write\");\n}\nfunction ptrStorage(inner, access = \"read\") {\n\treturn INTERNAL_createPtr(\"storage\", inner, access);\n}\nfunction ptrUniform(inner) {\n\treturn INTERNAL_createPtr(\"uniform\", inner, \"read\");\n}\nfunction ptrHandle(inner) {\n\treturn INTERNAL_createPtr(\"handle\", inner, \"read\");\n}\nfunction INTERNAL_createPtr(addressSpace, inner, access, implicit = false) {\n\treturn {\n\t\t[$internal]: {},\n\t\ttype: \"ptr\",\n\t\taddressSpace,\n\t\tinner,\n\t\taccess,\n\t\timplicit,\n\t\ttoString: () => `ptr<${addressSpace}, ${inner}, ${access}>`\n\t};\n}\nfunction createPtrFromOrigin(origin, innerDataType) {\n\tconst ptrParams = originToPtrParams[origin];\n\tif (ptrParams) return INTERNAL_createPtr(ptrParams.space, innerDataType, ptrParams.access);\n}\nfunction implicitFrom(ptr) {\n\treturn INTERNAL_createPtr(ptr.addressSpace, ptr.inner, ptr.access, true);\n}\nfunction explicitFrom(ptr) {\n\treturn INTERNAL_createPtr(ptr.addressSpace, ptr.inner, ptr.access, false);\n}\n\n//#endregion\nexport { createPtrFromOrigin, explicitFrom, implicitFrom, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup };","import { $gpuCallable, $internal, $ownSnippet, $resolve } from \"../shared/symbols.js\";\nimport { setName } from \"../shared/meta.js\";\nimport { isNaturallyEphemeral, isPtr } from \"./wgslTypes.js\";\nimport { UnknownData } from \"./dataTypes.js\";\nimport { snip } from \"./snippet.js\";\nimport { WgslTypeError } from \"../errors.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { createPtrFromOrigin, explicitFrom } from \"./ptr.js\";\n\n//#region src/data/ref.ts\nconst _ref = (() => {\n\tconst impl = ((value) => INTERNAL_createRef(value));\n\tsetName(impl, \"ref\");\n\timpl.toString = () => \"ref\";\n\timpl[$internal] = true;\n\timpl[$gpuCallable] = { call(_ctx, [value]) {\n\t\tif (value.origin === \"argument\") throw new WgslTypeError(stitch`d.ref(${value}) is illegal, cannot take a reference of an argument. Copy the value locally first, and take a reference of the copy.`);\n\t\tif (isPtr(value.dataType)) return snip(value.value, explicitFrom(value.dataType), value.origin);\n\t\t/**\n\t\t* Pointer type only exists if the ref was created from a reference (buttery-butter).\n\t\t*\n\t\t* @example\n\t\t* ```ts\n\t\t* const life = ref(42); // created from a value\n\t\t* const boid = ref(layout.$.boids[0]); // created from a reference\n\t\t* ```\n\t\t*/\n\t\tconst ptrType = createPtrFromOrigin(value.origin, value.dataType);\n\t\treturn snip(new RefOperator(value, ptrType), ptrType ?? UnknownData, \"runtime\");\n\t} };\n\treturn impl;\n})();\nfunction isRef(value) {\n\treturn value?.[$internal]?.type === \"ref\";\n}\nfunction INTERNAL_createRef(value) {\n\tconst target = {\n\t\t[$internal]: { type: \"ref\" },\n\t\tget $() {\n\t\t\treturn value;\n\t\t},\n\t\tset $(newValue) {\n\t\t\tif (newValue && typeof newValue === \"object\") for (const key of Object.keys(newValue)) value[key] = newValue[key];\n\t\t\telse value = newValue;\n\t\t}\n\t};\n\tif (value === void 0 || value === null) throw new Error(\"Cannot create a ref from undefined or null\");\n\tif (typeof value === \"object\") return new Proxy(target, {\n\t\tget(target, prop) {\n\t\t\tif (prop in target) return target[prop];\n\t\t\treturn value[prop];\n\t\t},\n\t\tset(_target, prop, propValue) {\n\t\t\tif (prop === $internal) return false;\n\t\t\tif (prop === \"$\") {\n\t\t\t\tconsole.log(\"Setting ref value:\", propValue);\n\t\t\t\treturn Reflect.set(target, prop, propValue);\n\t\t\t}\n\t\t\treturn Reflect.set(value, prop, propValue);\n\t\t}\n\t});\n\treturn target;\n}\n/**\n* The result of calling `d.ref(...)`. The code responsible for\n* generating shader code can check if the value of a snippet is\n* an instance of `RefOperator`, and act accordingly.\n*/\nvar RefOperator = class {\n\t[$internal];\n\tsnippet;\n\t#ptrType;\n\tconstructor(snippet, ptrType) {\n\t\tthis[$internal] = true;\n\t\tthis.snippet = snippet;\n\t\tthis.#ptrType = ptrType;\n\t}\n\tget [$ownSnippet]() {\n\t\tif (!this.#ptrType) throw new Error(stitch`Cannot take a reference of ${this.snippet}`);\n\t\treturn snip(this, this.#ptrType, this.snippet.origin);\n\t}\n\t[$resolve]() {\n\t\tif (!this.#ptrType) throw new Error(stitch`Cannot take a reference of ${this.snippet}`);\n\t\treturn snip(stitch`(&${this.snippet})`, this.#ptrType, this.snippet.origin);\n\t}\n};\nfunction derefSnippet(snippet) {\n\tif (!isPtr(snippet.dataType)) return snippet;\n\tconst innerType = snippet.dataType.inner;\n\tconst origin = isNaturallyEphemeral(innerType) ? \"runtime\" : snippet.origin;\n\tif (snippet.value instanceof RefOperator) return snip(stitch`${snippet.value.snippet}`, innerType, origin);\n\treturn snip(stitch`(*${snippet})`, innerType, origin);\n}\n\n//#endregion\nexport { RefOperator, _ref, derefSnippet, isRef };","import { isMatInstance, isVecInstance } from \"../data/wgslTypes.js\";\n\n//#region src/shared/stringify.ts\nfunction safeStringify(item) {\n\tconst asString = String(item);\n\tif (asString !== \"[object Object]\") return asString;\n\ttry {\n\t\treturn JSON.stringify(item);\n\t} catch (error) {\n\t\tconsole.error(\"Error parsing JSON:\", error);\n\t\treturn \"<invalid json>\";\n\t}\n}\nfunction niceStringify(item) {\n\tif (isVecInstance(item) || isMatInstance(item)) return item.toString();\n\tif (Array.isArray(item)) return `[${item.map(niceStringify).join(\", \")}]`;\n\tif (item && typeof item === \"object\") return `{ ${Object.entries(item).map(([key, value]) => `${key}: ${niceStringify(value)}`).join(\", \")} }`;\n\treturn String(item);\n}\n\n//#endregion\nexport { niceStringify, safeStringify };","//#region src/shared/utilityTypes.ts\nfunction assertExhaustive(x, location) {\n\tthrow new Error(`Failed to handle ${x} at ${location}`);\n}\n\n//#endregion\nexport { assertExhaustive };","import { DEV, TEST } from \"../shared/env.js\";\nimport { isMat, isPtr, isVec } from \"../data/wgslTypes.js\";\nimport { UnknownData, undecorate } from \"../data/dataTypes.js\";\nimport { snip } from \"../data/snippet.js\";\nimport { WgslTypeError, invariant } from \"../errors.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { RefOperator, derefSnippet } from \"../data/ref.js\";\nimport { schemaCallWrapperGPU } from \"../data/schemaCallWrapper.js\";\nimport { safeStringify } from \"../shared/stringify.js\";\nimport { assertExhaustive } from \"../shared/utilityTypes.js\";\n\n//#region src/tgsl/conversion.ts\nconst INFINITE_RANK = {\n\trank: Number.POSITIVE_INFINITY,\n\taction: \"none\"\n};\nfunction getAutoConversionRank(src, dest) {\n\tconst trueSrc = undecorate(src);\n\tconst trueDst = undecorate(dest);\n\tif (trueSrc.type === trueDst.type) return {\n\t\trank: 0,\n\t\taction: \"none\"\n\t};\n\tif (trueSrc.type === \"abstractFloat\") {\n\t\tif (trueDst.type === \"f32\") return {\n\t\t\trank: 1,\n\t\t\taction: \"none\"\n\t\t};\n\t\tif (trueDst.type === \"f16\") return {\n\t\t\trank: 2,\n\t\t\taction: \"none\"\n\t\t};\n\t}\n\tif (trueSrc.type === \"abstractInt\") {\n\t\tif (trueDst.type === \"i32\") return {\n\t\t\trank: 3,\n\t\t\taction: \"none\"\n\t\t};\n\t\tif (trueDst.type === \"u32\") return {\n\t\t\trank: 4,\n\t\t\taction: \"none\"\n\t\t};\n\t\tif (trueDst.type === \"abstractFloat\") return {\n\t\t\trank: 5,\n\t\t\taction: \"none\"\n\t\t};\n\t\tif (trueDst.type === \"f32\") return {\n\t\t\trank: 6,\n\t\t\taction: \"none\"\n\t\t};\n\t\tif (trueDst.type === \"f16\") return {\n\t\t\trank: 7,\n\t\t\taction: \"none\"\n\t\t};\n\t}\n\tif (isVec(trueSrc) && isVec(trueDst) && trueSrc.type[3] === trueDst.type[3]) return getAutoConversionRank(trueSrc.primitive, trueDst.primitive);\n\tif (isMat(trueSrc) && isMat(trueDst) && trueSrc.type[3] === trueDst.type[3]) return {\n\t\trank: 0,\n\t\taction: \"none\"\n\t};\n\treturn INFINITE_RANK;\n}\nfunction getImplicitConversionRank(src, dest) {\n\tconst trueSrc = undecorate(src);\n\tconst trueDst = undecorate(dest);\n\tif (isPtr(trueSrc) && trueSrc.implicit && getAutoConversionRank(trueSrc.inner, trueDst).rank < Number.POSITIVE_INFINITY) return {\n\t\trank: 0,\n\t\taction: \"deref\"\n\t};\n\tif (isPtr(trueDst) && getAutoConversionRank(trueSrc, trueDst.inner).rank < Number.POSITIVE_INFINITY) return {\n\t\trank: 1,\n\t\taction: \"ref\"\n\t};\n\tconst primitivePreference = {\n\t\tf32: 0,\n\t\tf16: 1,\n\t\ti32: 2,\n\t\tu32: 3,\n\t\tbool: 4\n\t};\n\tif (trueSrc.type in primitivePreference && trueDst.type in primitivePreference) {\n\t\tconst srcType = trueSrc.type;\n\t\tconst destType = trueDst.type;\n\t\tif (srcType !== destType) {\n\t\t\tconst srcPref = primitivePreference[srcType];\n\t\t\treturn {\n\t\t\t\trank: primitivePreference[destType] < srcPref ? 10 : 20,\n\t\t\t\taction: \"cast\",\n\t\t\t\ttargetType: trueDst\n\t\t\t};\n\t\t}\n\t}\n\tif (trueSrc.type === \"abstractFloat\") {\n\t\tif (trueDst.type === \"u32\") return {\n\t\t\trank: 2,\n\t\t\taction: \"cast\",\n\t\t\ttargetType: trueDst\n\t\t};\n\t\tif (trueDst.type === \"i32\") return {\n\t\t\trank: 1,\n\t\t\taction: \"cast\",\n\t\t\ttargetType: trueDst\n\t\t};\n\t}\n\treturn INFINITE_RANK;\n}\nfunction getConversionRank(src, dest, allowImplicit) {\n\tconst autoRank = getAutoConversionRank(src, dest);\n\tif (autoRank.rank < Number.POSITIVE_INFINITY) return autoRank;\n\tif (allowImplicit) return getImplicitConversionRank(src, dest);\n\treturn INFINITE_RANK;\n}\nfunction findBestType(types, uniqueTypes, allowImplicit) {\n\tlet bestResult;\n\tfor (const targetType of uniqueTypes) {\n\t\tconst details = [];\n\t\tlet sum = 0;\n\t\tfor (const sourceType of types) {\n\t\t\tconst conversion = getConversionRank(sourceType, targetType, allowImplicit);\n\t\t\tsum += conversion.rank;\n\t\t\tif (conversion.rank === Number.POSITIVE_INFINITY) break;\n\t\t\tdetails.push(conversion);\n\t\t}\n\t\tif (sum < (bestResult?.sum ?? Number.POSITIVE_INFINITY)) bestResult = {\n\t\t\ttype: targetType,\n\t\t\tdetails,\n\t\t\tsum\n\t\t};\n\t}\n\tif (!bestResult) return;\n\tconst actions = bestResult.details.map((detail, index) => ({\n\t\tsourceIndex: index,\n\t\taction: detail.action,\n\t\t...detail.action === \"cast\" && { targetType: detail.targetType }\n\t}));\n\treturn {\n\t\ttargetType: bestResult.type,\n\t\tactions,\n\t\thasImplicitConversions: actions.some((action) => action.action === \"cast\")\n\t};\n}\nfunction getBestConversion(types, targetTypes) {\n\tif (types.length === 0) return void 0;\n\tconst uniqueTargetTypes = [...new Set((targetTypes || types).map(undecorate))];\n\tconst explicitResult = findBestType(types, uniqueTargetTypes, false);\n\tif (explicitResult) return explicitResult;\n\tconst implicitResult = findBestType(types, uniqueTargetTypes, true);\n\tif (implicitResult) return implicitResult;\n}\nfunction applyActionToSnippet(ctx, snippet, action, targetType) {\n\tif (action.action === \"none\") return snip(snippet.value, targetType, snippet.origin);\n\tswitch (action.action) {\n\t\tcase \"ref\": return snip(new RefOperator(snippet, targetType), targetType, snippet.origin);\n\t\tcase \"deref\": return derefSnippet(snippet);\n\t\tcase \"cast\": return schemaCallWrapperGPU(ctx, targetType, snippet);\n\t\tdefault: assertExhaustive(action.action, \"applyActionToSnippet\");\n\t}\n}\nfunction unify(inTypes, restrictTo) {\n\tif (inTypes.some((type) => type === UnknownData)) return;\n\tconst conversion = getBestConversion(inTypes, restrictTo);\n\tif (!conversion) return;\n\treturn inTypes.map((type) => isVec(type) || isMat(type) ? type : conversion.targetType);\n}\nfunction convertToCommonType(ctx, values, restrictTo, verbose = true) {\n\tconst types = values.map((value) => value.dataType);\n\tif (types.some((type) => type === UnknownData)) return;\n\tif (DEV && Array.isArray(restrictTo) && restrictTo.length === 0) console.warn(\"convertToCommonType was called with an empty restrictTo array, which prevents any conversions from being made. If you intend to allow all conversions, pass undefined instead. If this was intended call the function conditionally since the result will always be undefined.\");\n\tconst conversion = getBestConversion(types, restrictTo);\n\tif (!conversion) return;\n\tif ((TEST || DEV) && verbose && conversion.hasImplicitConversions) console.warn(`Implicit conversions from [\\n${values.map((v) => ` ${v.value}: ${safeStringify(v.dataType)}`).join(\",\\n\")}\\n] to ${conversion.targetType.type} are supported, but not recommended.\nConsider using explicit conversions instead.`);\n\treturn values.map((value, index) => {\n\t\tconst action = conversion.actions[index];\n\t\tinvariant(action, \"Action should not be undefined\");\n\t\treturn applyActionToSnippet(ctx, value, action, conversion.targetType);\n\t});\n}\nfunction tryConvertSnippet(ctx, snippet, targetDataTypes, verbose = true) {\n\tconst targets = Array.isArray(targetDataTypes) ? targetDataTypes : [targetDataTypes];\n\tconst { value, dataType, origin } = snippet;\n\tif (targets.length === 1) {\n\t\tconst target = targets[0];\n\t\tif (target === dataType) return snip(value, target, origin);\n\t\tif (dataType === UnknownData) return snip(stitch`${snip(value, target, origin)}`, target, origin);\n\t}\n\tconst converted = convertToCommonType(ctx, [snippet], targets, verbose);\n\tif (converted) return converted[0];\n\tthrow new WgslTypeError(`Cannot convert value of type '${String(dataType)}' to any of the target types: [${targets.map((t) => t.type).join(\", \")}]`);\n}\nfunction convertStructValues(ctx, structType, values) {\n\treturn Object.entries(structType.propTypes).map(([key, targetType]) => {\n\t\tconst val = values[key];\n\t\tif (!val) throw new Error(`Missing property ${key}`);\n\t\treturn convertToCommonType(ctx, [val], [targetType])?.[0] ?? val;\n\t});\n}\n\n//#endregion\nexport { convertStructValues, convertToCommonType, getBestConversion, tryConvertSnippet, unify };","import { $gpuCallable } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\nimport { isPtr } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { NormalState, isKnownAtComptime } from \"../../types.js\";\nimport { tryConvertSnippet } from \"../../tgsl/conversion.js\";\n\n//#region src/core/function/createCallableSchema.ts\nfunction callableSchema(options) {\n\tconst impl = ((...args) => {\n\t\treturn options.normalImpl(...args);\n\t});\n\tsetName(impl, options.name);\n\timpl.toString = () => options.name;\n\timpl[$gpuCallable] = {\n\t\tget strictSignature() {},\n\t\tcall(ctx, args) {\n\t\t\tconst { argTypes, returnType } = options.signature(...args.map((s) => {\n\t\t\t\tif (isPtr(s.dataType) && s.dataType.implicit) return s.dataType.inner;\n\t\t\t\treturn s.dataType;\n\t\t\t}));\n\t\t\tconst converted = args.map((s, idx) => {\n\t\t\t\tconst argType = argTypes[idx];\n\t\t\t\tif (!argType) throw new Error(\"Function called with invalid arguments\");\n\t\t\t\treturn tryConvertSnippet(ctx, s, argType, false);\n\t\t\t});\n\t\t\tif (converted.every((s) => isKnownAtComptime(s))) {\n\t\t\t\tctx.pushMode(new NormalState());\n\t\t\t\ttry {\n\t\t\t\t\treturn snip(options.normalImpl(...converted.map((s) => s.value)), returnType, \"constant\");\n\t\t\t\t} finally {\n\t\t\t\t\tctx.popMode(\"normal\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn snip(options.codegenImpl(ctx, converted), returnType, \"runtime\");\n\t\t}\n\t};\n\treturn impl;\n}\n\n//#endregion\nexport { callableSchema };","import { $internal } from \"../shared/symbols.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { callableSchema } from \"../core/function/createCallableSchema.js\";\n\n//#region src/data/numeric.ts\nconst abstractInt = {\n\t[$internal]: {},\n\ttype: \"abstractInt\",\n\ttoString() {\n\t\treturn \"abstractInt\";\n\t}\n};\nconst abstractFloat = {\n\t[$internal]: {},\n\ttype: \"abstractFloat\",\n\ttoString() {\n\t\treturn \"abstractFloat\";\n\t}\n};\nconst boolCast = callableSchema({\n\tname: \"bool\",\n\tsignature: (arg) => ({\n\t\targTypes: arg ? [arg] : [],\n\t\treturnType: bool\n\t}),\n\tnormalImpl(v) {\n\t\tif (v === void 0) return false;\n\t\tif (typeof v === \"boolean\") return v;\n\t\treturn !!v;\n\t},\n\tcodegenImpl: (_ctx, [arg]) => arg?.dataType === bool ? stitch`${arg}` : stitch`bool(${arg})`\n});\n/**\n* A schema that represents a boolean value. (equivalent to `bool` in WGSL)\n*\n* Can also be called to cast a value to a bool in accordance with WGSL casting rules.\n*\n* @example\n* const value = bool(); // false\n* @example\n* const value = bool(0); // false\n* @example\n* const value = bool(-0); // false\n* @example\n* const value = bool(21.37); // true\n*/\nconst bool = Object.assign(boolCast, {\n\t[$internal]: {},\n\ttype: \"bool\"\n});\nconst u32Cast = callableSchema({\n\tname: \"u32\",\n\tsignature: (arg) => ({\n\t\targTypes: arg ? [arg] : [],\n\t\treturnType: u32\n\t}),\n\tnormalImpl(v) {\n\t\tif (v === void 0) return 0;\n\t\tif (typeof v === \"boolean\") return v ? 1 : 0;\n\t\tif (!Number.isInteger(v)) {\n\t\t\tconst truncated = Math.trunc(v);\n\t\t\tif (truncated < 0) return 0;\n\t\t\tif (truncated > 4294967295) return 4294967295;\n\t\t\treturn truncated;\n\t\t}\n\t\treturn (v & 4294967295) >>> 0;\n\t},\n\tcodegenImpl: (_ctx, [arg]) => arg?.dataType === u32 ? stitch`${arg}` : stitch`u32(${arg})`\n});\n/**\n* A schema that represents an unsigned 32-bit integer value. (equivalent to `u32` in WGSL)\n*\n* Can also be called to cast a value to an u32 in accordance with WGSL casting rules.\n*\n* @example\n* const value = u32(); // 0\n* @example\n* const value = u32(7); // 7\n* @example\n* const value = u32(3.14); // 3\n* @example\n* const value = u32(-1); // 4294967295\n* @example\n* const value = u32(-3.1); // 0\n*/\nconst u32 = Object.assign(u32Cast, {\n\t[$internal]: {},\n\ttype: \"u32\"\n});\nconst i32Cast = callableSchema({\n\tname: \"i32\",\n\tsignature: (arg) => ({\n\t\targTypes: arg ? [arg] : [],\n\t\treturnType: i32\n\t}),\n\tnormalImpl(v) {\n\t\tif (v === void 0) return 0;\n\t\tif (typeof v === \"boolean\") return v ? 1 : 0;\n\t\treturn v | 0;\n\t},\n\tcodegenImpl: (_ctx, [arg]) => arg?.dataType === i32 ? stitch`${arg}` : stitch`i32(${arg})`\n});\nconst u16 = {\n\t[$internal]: {},\n\ttype: \"u16\"\n};\n/**\n* A schema that represents a signed 32-bit integer value. (equivalent to `i32` in WGSL)\n*\n* Can also be called to cast a value to an i32 in accordance with WGSL casting rules.\n*\n* @example\n* const value = i32(); // 0\n* @example\n* const value = i32(3.14); // 3\n* @example\n* const value = i32(-3.9); // -3\n* @example\n* const value = i32(10000000000) // 1410065408\n*/\nconst i32 = Object.assign(i32Cast, {\n\t[$internal]: {},\n\ttype: \"i32\"\n});\nconst f32Cast = callableSchema({\n\tname: \"f32\",\n\tsignature: (arg) => ({\n\t\targTypes: arg ? [arg] : [],\n\t\treturnType: f32\n\t}),\n\tnormalImpl(v) {\n\t\tif (v === void 0) return 0;\n\t\tif (typeof v === \"boolean\") return v ? 1 : 0;\n\t\treturn Math.fround(v);\n\t},\n\tcodegenImpl: (_ctx, [arg]) => arg?.dataType === f32 ? stitch`${arg}` : stitch`f32(${arg})`\n});\n/**\n* A schema that represents a 32-bit float value. (equivalent to `f32` in WGSL)\n*\n* Can also be called to cast a value to an f32.\n*\n* @example\n* const value = f32(); // 0\n* @example\n* const value = f32(1.23); // 1.23\n* @example\n* const value = f32(true); // 1\n*/\nconst f32 = Object.assign(f32Cast, {\n\t[$internal]: {},\n\ttype: \"f32\"\n});\nconst buf32 = /* @__PURE__ */ new ArrayBuffer(4);\nconst f32arr = new Float32Array(buf32);\nconst u32arr = new Uint32Array(buf32);\n/**\n* Convert a JavaScript number (treated as float32) to **binary16** bit pattern.\n* @param x 32-bit floating-point value\n* @returns 16-bit half-precision encoding (stored in a JS number)\n*/\nfunction toHalfBits(x) {\n\tf32arr[0] = x;\n\tconst bits = u32arr[0];\n\tconst sign = bits >>> 31 & 1;\n\tlet exp = bits >>> 23 & 255;\n\tlet mant = bits & 8388607;\n\tif (exp === 255) return sign << 15 | 31744 | (mant ? 512 : 0);\n\texp = exp - 127 + 15;\n\tif (exp <= 0) {\n\t\tif (exp < -10) return sign << 15;\n\t\tmant = (mant | 8388608) >> 1 - exp;\n\t\tmant = mant + 4096 >> 13;\n\t\treturn sign << 15 | mant;\n\t}\n\tif (exp >= 31) return sign << 15 | 31744;\n\tmant = mant + 4096;\n\tif (mant & 8388608) {\n\t\tmant = 0;\n\t\t++exp;\n\t\tif (exp >= 31) return sign << 15 | 31744;\n\t}\n\treturn sign << 15 | exp << 10 | mant >> 13;\n}\n/**\n* Convert a **binary16** encoded bit pattern back to JavaScript number.\n* @param h 16-bit half-precision bits\n* @returns JavaScript number (64-bit float) with same numerical value\n*/\nfunction fromHalfBits(h) {\n\tconst sign = h & 32768 ? -1 : 1;\n\tconst exp = h >> 10 & 31;\n\tconst mant = h & 1023;\n\tif (exp === 0) return mant ? sign * mant * 2 ** -24 : sign * 0;\n\tif (exp === 31) return mant ? NaN : sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;\n\treturn sign * (1 + mant / 1024) * 2 ** (exp - 15);\n}\nfunction roundToF16(x) {\n\treturn fromHalfBits(toHalfBits(x));\n}\nconst f16Cast = callableSchema({\n\tname: \"f16\",\n\tsignature: (arg) => ({\n\t\targTypes: arg ? [arg] : [],\n\t\treturnType: f16\n\t}),\n\tnormalImpl(v) {\n\t\tif (v === void 0) return 0;\n\t\tif (typeof v === \"boolean\") return v ? 1 : 0;\n\t\treturn roundToF16(v);\n\t},\n\tcodegenImpl: (_ctx, [arg]) => arg?.dataType === f16 ? stitch`${arg}` : stitch`f16(${arg})`\n});\n/**\n* A schema that represents a 16-bit float value. (equivalent to `f16` in WGSL)\n*\n* Can also be called to cast a value to an f16.\n*\n* @example\n* const value = f16(); // 0\n* @example\n* const value = f32(1.23); // 1.23\n* @example\n* const value = f16(true); // 1\n* @example\n* const value = f16(21877.5); // 21872\n*/\nconst f16 = Object.assign(f16Cast, {\n\t[$internal]: {},\n\ttype: \"f16\"\n});\n\n//#endregion\nexport { abstractFloat, abstractInt, bool, f16, f32, i32, u16, u32 };","import { $internal, $resolve } from \"../shared/symbols.js\";\nimport { WORKAROUND_getSchema, isMatInstance, isNaturallyEphemeral, isVecInstance } from \"../data/wgslTypes.js\";\nimport { UnknownData } from \"../data/dataTypes.js\";\nimport { isEphemeralSnippet, isSnippet, snip } from \"../data/snippet.js\";\nimport { WgslTypeError } from \"../errors.js\";\nimport { getOwnSnippet } from \"../types.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { isRef } from \"../data/ref.js\";\nimport { abstractFloat, abstractInt, bool, f32, i32 } from \"../data/numeric.js\";\n\n//#region src/tgsl/generationHelpers.ts\nfunction numericLiteralToSnippet(value) {\n\tif (value >= 2 ** 63 || value < -(2 ** 63)) return snip(value, abstractFloat, \"constant\");\n\tif (Number.isInteger(value)) {\n\t\tif (!Number.isSafeInteger(value)) console.warn(`The integer ${value} exceeds the safe integer range and may have lost precision.`);\n\t\treturn snip(value, abstractInt, \"constant\");\n\t}\n\treturn snip(value, abstractFloat, \"constant\");\n}\nfunction concretize(type) {\n\tif (type.type === \"abstractFloat\") return f32;\n\tif (type.type === \"abstractInt\") return i32;\n\treturn type;\n}\nfunction concretizeSnippet(snippet) {\n\treturn snip(snippet.value, concretize(snippet.dataType), snippet.origin);\n}\nfunction concretizeSnippets(args) {\n\treturn args.map(concretizeSnippet);\n}\nfunction coerceToSnippet(value) {\n\tif (isSnippet(value)) return value;\n\tif (isRef(value)) throw new Error(\"Cannot use refs (d.ref(...)) from the outer scope.\");\n\tconst ownSnippet = getOwnSnippet(value);\n\tif (ownSnippet) return ownSnippet;\n\tif (isVecInstance(value) || isMatInstance(value)) return snip(value, WORKAROUND_getSchema(value), \"constant\");\n\tif (typeof value === \"string\" || typeof value === \"function\" || typeof value === \"object\" || typeof value === \"symbol\" || typeof value === \"undefined\" || value === null) return snip(value, UnknownData, \"constant\");\n\tif (typeof value === \"number\") return numericLiteralToSnippet(value);\n\tif (typeof value === \"boolean\") return snip(value, bool, \"constant\");\n\treturn snip(value, UnknownData, \"constant\");\n}\n/**\n* Intermediate representation for WGSL array expressions.\n* Defers resolution. Stores array elements as snippets so the\n* generator can access them when needed.\n*/\nvar ArrayExpression = class {\n\t[$internal] = true;\n\tconstructor(type, elements) {\n\t\tthis.type = type;\n\t\tthis.elements = elements;\n\t}\n\ttoString() {\n\t\treturn \"ArrayExpression\";\n\t}\n\t[$resolve](ctx) {\n\t\tfor (const elem of this.elements) if (elem.origin === \"argument\" && !isNaturallyEphemeral(elem.dataType) || !isEphemeralSnippet(elem)) {\n\t\t\tconst snippetStr = ctx.resolve(elem.value, elem.dataType).value;\n\t\t\tconst snippetType = ctx.resolve(concretize(elem.dataType)).value;\n\t\t\tthrow new WgslTypeError(`'${snippetStr}' reference cannot be used in an array constructor.\\n-----\\nTry '${snippetType}(${snippetStr})' or 'arrayOf(${snippetType}, count)([...])' to copy the value instead.\\n-----`);\n\t\t}\n\t\treturn snip(stitch`${`array<${ctx.resolve(this.type.elementType).value}, ${this.elements.length}>`}(${this.elements})`, this.type, \"runtime\");\n\t}\n};\n\n//#endregion\nexport { ArrayExpression, coerceToSnippet, concretize, concretizeSnippets, numericLiteralToSnippet };","import { $gpuCallable } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\nimport { isPtr } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { NormalState, isKnownAtComptime } from \"../../types.js\";\nimport { tryConvertSnippet } from \"../../tgsl/conversion.js\";\nimport { concretize } from \"../../tgsl/generationHelpers.js\";\n\n//#region src/core/function/dualImpl.ts\nvar MissingCpuImplError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = this.constructor.name;\n\t}\n};\nfunction dualImpl(options) {\n\tconst impl = ((...args) => {\n\t\tif (typeof options.normalImpl === \"string\") throw new MissingCpuImplError(options.normalImpl);\n\t\treturn options.normalImpl(...args);\n\t});\n\tsetName(impl, options.name);\n\timpl.toString = () => options.name ?? \"<unknown>\";\n\timpl[$gpuCallable] = {\n\t\tget strictSignature() {\n\t\t\treturn typeof options.signature !== \"function\" ? options.signature : void 0;\n\t\t},\n\t\tcall(ctx, args) {\n\t\t\tconst { argTypes, returnType } = typeof options.signature === \"function\" ? options.signature(...args.map((s) => {\n\t\t\t\tif (isPtr(s.dataType) && s.dataType.implicit) return s.dataType.inner;\n\t\t\t\treturn s.dataType;\n\t\t\t})) : options.signature;\n\t\t\tconst converted = args.map((s, idx) => {\n\t\t\t\tconst argType = argTypes[idx];\n\t\t\t\tif (!argType) throw new Error(\"Function called with invalid arguments\");\n\t\t\t\treturn tryConvertSnippet(ctx, s, argType, !options.ignoreImplicitCastWarning);\n\t\t\t});\n\t\t\tif (!options.noComptime && converted.every((s) => isKnownAtComptime(s)) && typeof options.normalImpl === \"function\") {\n\t\t\t\tctx.pushMode(new NormalState());\n\t\t\t\ttry {\n\t\t\t\t\treturn snip(options.normalImpl(...converted.map((s) => s.value)), returnType, \"constant\");\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (!(e instanceof MissingCpuImplError)) throw e;\n\t\t\t\t} finally {\n\t\t\t\t\tctx.popMode(\"normal\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn snip(options.codegenImpl(ctx, converted), concretize(returnType), \"runtime\");\n\t\t}\n\t};\n\treturn impl;\n}\n\n//#endregion\nexport { MissingCpuImplError, dualImpl };","import { $getNameForward, $gpuCallable, $internal } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\nimport { WgslTypeError } from \"../../errors.js\";\nimport { isKnownAtComptime } from \"../../types.js\";\nimport { coerceToSnippet } from \"../../tgsl/generationHelpers.js\";\n\n//#region src/core/function/comptime.ts\n/**\n* Creates a version of `func` that can called safely in a TypeGPU function to\n* precompute and inject a value into the final shader code.\n*\n* Note how the function passed into `comptime` doesn't have to be marked with\n* 'use gpu'. That's because the function doesn't execute on the GPU, it gets\n* executed before the shader code gets sent to the GPU.\n*\n* @example\n* ```ts\n* const color = tgpu.comptime((int: number) => {\n* const r = (int >> 16) & 0xff;\n* const g = (int >> 8) & 0xff;\n* const b = int & 0xff;\n* return d.vec3f(r / 255, g / 255, b / 255);\n* });\n*\n* const material = (diffuse: d.v3f): d.v3f => {\n* 'use gpu';\n* const albedo = color(0xff00ff);\n* return albedo.mul(diffuse);\n* };\n* ```\n*/\nfunction comptime(func) {\n\tconst impl = ((...args) => {\n\t\treturn func(...args);\n\t});\n\timpl.toString = () => \"comptime\";\n\timpl[$getNameForward] = func;\n\timpl[$gpuCallable] = { call(_ctx, args) {\n\t\tif (!args.every((s) => isKnownAtComptime(s))) throw new WgslTypeError(`Called comptime function with runtime-known values: ${args.filter((s) => !isKnownAtComptime(s)).map((s) => `'${s.value}'`).join(\", \")}`);\n\t\treturn coerceToSnippet(func(...args.map((s) => s.value)));\n\t} };\n\timpl.$name = (label) => {\n\t\tsetName(func, label);\n\t\treturn impl;\n\t};\n\tObject.defineProperty(impl, $internal, { value: { isComptime: true } });\n\treturn impl;\n}\n\n//#endregion\nexport { comptime };","import { getName, hasTinyestMetadata, setName } from \"../../shared/meta.js\";\nimport { isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { isLooseData } from \"../../data/dataTypes.js\";\nimport { isWgsl } from \"../../types.js\";\n\n//#region src/core/resolve/externals.ts\n/**\n* Merges two external maps into one. If a key is present in both maps, the value from the new map is used.\n* If the external value is a namable object, it is given a name if it does not already have one.\n* @param existing - The existing external map.\n* @param newExternals - The new external map.\n*/\nfunction applyExternals(existing, newExternals) {\n\tfor (const [key, value] of Object.entries(newExternals)) {\n\t\texisting[key] = value;\n\t\tif (value && (typeof value === \"object\" || typeof value === \"function\") && getName(value) === void 0) setName(value, key);\n\t}\n}\nfunction addArgTypesToExternals(implementation, argTypes, applyExternals) {\n\tconst argTypeNames = [...implementation.matchAll(/:\\s*(?<arg>.*?)\\s*[,)]/g)].map((found) => found ? found[1] : void 0);\n\tapplyExternals(Object.fromEntries(argTypes.flatMap((argType, i) => {\n\t\tconst argTypeName = argTypeNames ? argTypeNames[i] : void 0;\n\t\treturn isWgslStruct(argType) && argTypeName !== void 0 ? [[argTypeName, argType]] : [];\n\t})));\n}\nfunction addReturnTypeToExternals(implementation, returnType, applyExternals) {\n\tconst matched = implementation.match(/->\\s(?<output>[\\w\\d_]+)\\s{/);\n\tconst outputName = matched ? matched[1]?.trim() : void 0;\n\tif (isWgslStruct(returnType) && outputName && !/\\s/g.test(outputName)) applyExternals({ [outputName]: returnType });\n}\nfunction identifierRegex(name) {\n\treturn new RegExp(`(?<![\\\\w\\\\$_.])${name.replaceAll(\".\", \"\\\\.\").replaceAll(\"$\", \"\\\\$\")}(?![\\\\w\\\\$_])`, \"g\");\n}\n/**\n* Replaces all occurrences of external names in WGSL code with their resolved values.\n* It adds all necessary definitions to the resolution context.\n* @param ctx - The resolution context.\n* @param externalMap - The external map.\n* @param wgsl - The WGSL code.\n*\n* @returns The WGSL code with all external names replaced with their resolved values.\n*/\nfunction replaceExternalsInWgsl(ctx, externalMap, wgsl) {\n\treturn Object.entries(externalMap).reduce((acc, [externalName, external]) => {\n\t\tconst externalRegex = identifierRegex(externalName);\n\t\tif (wgsl && externalName !== \"Out\" && externalName !== \"In\" && !externalRegex.test(wgsl)) console.warn(`The external '${externalName}' wasn't used in the resolved template.`);\n\t\tif (isWgsl(external) || isLooseData(external) || hasTinyestMetadata(external)) return acc.replaceAll(externalRegex, ctx.resolve(external).value);\n\t\tif (external !== null && typeof external === \"object\") {\n\t\t\tconst foundProperties = [...wgsl.matchAll(new RegExp(`${externalName.replaceAll(\".\", \"\\\\.\").replaceAll(\"$\", \"\\\\$\")}\\\\.(?<prop>.*?)(?![\\\\w\\\\$_])`, \"g\"))].map((found) => found[1]);\n\t\t\treturn [...new Set(foundProperties)].reduce((innerAcc, prop) => prop && prop in external ? replaceExternalsInWgsl(ctx, { [`${externalName}.${prop}`]: external[prop] }, innerAcc) : innerAcc, acc);\n\t\t}\n\t\tconsole.warn(`During resolution, the external '${externalName}' has been omitted. Only TGPU resources, 'use gpu' functions, primitives, and plain JS objects can be used as externals.`);\n\t\treturn acc;\n\t}, wgsl);\n}\n\n//#endregion\nexport { addArgTypesToExternals, addReturnTypeToExternals, applyExternals, replaceExternalsInWgsl };","import { $internal, $resolve } from \"../shared/symbols.js\";\nimport { snip } from \"./snippet.js\";\nimport { bool, f16, f32, i32, u32 } from \"./numeric.js\";\n\n//#region src/data/vectorImpl.ts\nconst XYZW = [\n\t\"x\",\n\t\"y\",\n\t\"z\",\n\t\"w\"\n];\nconst RGBA = [\n\t\"r\",\n\t\"g\",\n\t\"b\",\n\t\"a\"\n];\nvar VecBase = class VecBase extends Array {\n\tstatic {\n\t\tfor (let e0 = 0; e0 < 4; e0++) for (let e1 = 0; e1 < 4; e1++) for (let e2 = 0; e2 < 4; e2++) for (let e3 = 0; e3 < 4; e3++) {\n\t\t\tconst xyzwProp = `${XYZW[e0]}${XYZW[e1]}${XYZW[e2]}${XYZW[e3]}`;\n\t\t\tconst rgbaProp = `${RGBA[e0]}${RGBA[e1]}${RGBA[e2]}${RGBA[e3]}`;\n\t\t\tObject.defineProperty(VecBase.prototype, xyzwProp, { get() {\n\t\t\t\treturn new this._Vec4(this[e0], this[e1], this[e2], this[e3]);\n\t\t\t} });\n\t\t\tObject.defineProperty(VecBase.prototype, rgbaProp, { get() {\n\t\t\t\treturn new this._Vec4(this[e0], this[e1], this[e2], this[e3]);\n\t\t\t} });\n\t\t}\n\t\tfor (let e0 = 0; e0 < 4; e0++) for (let e1 = 0; e1 < 4; e1++) for (let e2 = 0; e2 < 4; e2++) {\n\t\t\tconst xyzwProp = `${XYZW[e0]}${XYZW[e1]}${XYZW[e2]}`;\n\t\t\tconst rgbaProp = `${RGBA[e0]}${RGBA[e1]}${RGBA[e2]}`;\n\t\t\tObject.defineProperty(VecBase.prototype, xyzwProp, { get() {\n\t\t\t\treturn new this._Vec3(this[e0], this[e1], this[e2]);\n\t\t\t} });\n\t\t\tObject.defineProperty(VecBase.prototype, rgbaProp, { get() {\n\t\t\t\treturn new this._Vec3(this[e0], this[e1], this[e2]);\n\t\t\t} });\n\t\t}\n\t\tfor (let e0 = 0; e0 < 4; e0++) for (let e1 = 0; e1 < 4; e1++) {\n\t\t\tconst xyzwProp = `${XYZW[e0]}${XYZW[e1]}`;\n\t\t\tconst rgbaProp = `${RGBA[e0]}${RGBA[e1]}`;\n\t\t\tObject.defineProperty(VecBase.prototype, xyzwProp, { get() {\n\t\t\t\treturn new this._Vec2(this[e0], this[e1]);\n\t\t\t} });\n\t\t\tObject.defineProperty(VecBase.prototype, rgbaProp, { get() {\n\t\t\t\treturn new this._Vec2(this[e0], this[e1]);\n\t\t\t} });\n\t\t}\n\t}\n\tcastElement() {\n\t\treturn this[$internal].elementSchema;\n\t}\n\t[$resolve]() {\n\t\tconst schema = this[$internal].elementSchema;\n\t\tif (this.every((e) => !e)) return snip(`${this.kind}()`, schema, \"constant\");\n\t\tif (this.every((e) => this[0] === e)) return snip(`${this.kind}(${this[0]})`, schema, \"runtime\");\n\t\treturn snip(`${this.kind}(${this.join(\", \")})`, schema, \"runtime\");\n\t}\n\ttoString() {\n\t\treturn this[$resolve]().value;\n\t}\n};\nvar Vec2 = class extends VecBase {\n\te0;\n\te1;\n\tconstructor(x, y) {\n\t\tsuper(2);\n\t\tthis.e0 = this.castElement()(x);\n\t\tthis.e1 = this.castElement()(y ?? x);\n\t}\n\tget 0() {\n\t\treturn this.e0;\n\t}\n\tget 1() {\n\t\treturn this.e1;\n\t}\n\tset 0(value) {\n\t\tthis.e0 = this.castElement()(value);\n\t}\n\tset 1(value) {\n\t\tthis.e1 = this.castElement()(value);\n\t}\n\tget x() {\n\t\treturn this[0];\n\t}\n\tget y() {\n\t\treturn this[1];\n\t}\n\tset x(value) {\n\t\tthis[0] = this.castElement()(value);\n\t}\n\tset y(value) {\n\t\tthis[1] = this.castElement()(value);\n\t}\n\tget r() {\n\t\treturn this[0];\n\t}\n\tget g() {\n\t\treturn this[1];\n\t}\n\tset r(value) {\n\t\tthis[0] = this.castElement()(value);\n\t}\n\tset g(value) {\n\t\tthis[1] = this.castElement()(value);\n\t}\n};\nvar Vec3 = class extends VecBase {\n\te0;\n\te1;\n\te2;\n\tconstructor(x, y, z) {\n\t\tsuper(3);\n\t\tthis.e0 = this.castElement()(x);\n\t\tthis.e1 = this.castElement()(y ?? x);\n\t\tthis.e2 = this.castElement()(z ?? x);\n\t}\n\tget 0() {\n\t\treturn this.e0;\n\t}\n\tget 1() {\n\t\treturn this.e1;\n\t}\n\tget 2() {\n\t\treturn this.e2;\n\t}\n\tset 0(value) {\n\t\tthis.e0 = this.castElement()(value);\n\t}\n\tset 1(value) {\n\t\tthis.e1 = this.castElement()(value);\n\t}\n\tset 2(value) {\n\t\tthis.e2 = this.castElement()(value);\n\t}\n\tget x() {\n\t\treturn this[0];\n\t}\n\tget y() {\n\t\treturn this[1];\n\t}\n\tget z() {\n\t\treturn this[2];\n\t}\n\tset x(value) {\n\t\tthis[0] = this.castElement()(value);\n\t}\n\tset y(value) {\n\t\tthis[1] = this.castElement()(value);\n\t}\n\tset z(value) {\n\t\tthis[2] = this.castElement()(value);\n\t}\n\tget r() {\n\t\treturn this[0];\n\t}\n\tget g() {\n\t\treturn this[1];\n\t}\n\tget b() {\n\t\treturn this[2];\n\t}\n\tset r(value) {\n\t\tthis[0] = this.castElement()(value);\n\t}\n\tset g(value) {\n\t\tthis[1] = this.castElement()(value);\n\t}\n\tset b(value) {\n\t\tthis[2] = this.castElement()(value);\n\t}\n};\nvar Vec4 = class extends VecBase {\n\te0;\n\te1;\n\te2;\n\te3;\n\tconstructor(x, y, z, w) {\n\t\tsuper(4);\n\t\tthis.e0 = this.castElement()(x);\n\t\tthis.e1 = this.castElement()(y ?? x);\n\t\tthis.e2 = this.castElement()(z ?? x);\n\t\tthis.e3 = this.castElement()(w ?? x);\n\t}\n\tget 0() {\n\t\treturn this.e0;\n\t}\n\tget 1() {\n\t\treturn this.e1;\n\t}\n\tget 2() {\n\t\treturn this.e2;\n\t}\n\tget 3() {\n\t\treturn this.e3;\n\t}\n\tset 0(value) {\n\t\tthis.e0 = this.castElement()(value);\n\t}\n\tset 1(value) {\n\t\tthis.e1 = this.castElement()(value);\n\t}\n\tset 2(value) {\n\t\tthis.e2 = this.castElement()(value);\n\t}\n\tset 3(value) {\n\t\tthis.e3 = this.castElement()(value);\n\t}\n\tget x() {\n\t\treturn this[0];\n\t}\n\tget y() {\n\t\treturn this[1];\n\t}\n\tget r() {\n\t\treturn this[0];\n\t}\n\tget g() {\n\t\treturn this[1];\n\t}\n\tget b() {\n\t\treturn this[2];\n\t}\n\tget a() {\n\t\treturn this[3];\n\t}\n\tset r(value) {\n\t\tthis[0] = value;\n\t}\n\tset g(value) {\n\t\tthis[1] = value;\n\t}\n\tset b(value) {\n\t\tthis[2] = value;\n\t}\n\tset a(value) {\n\t\tthis[3] = value;\n\t}\n\tget z() {\n\t\treturn this[2];\n\t}\n\tget w() {\n\t\treturn this[3];\n\t}\n\tset x(value) {\n\t\tthis[0] = value;\n\t}\n\tset y(value) {\n\t\tthis[1] = value;\n\t}\n\tset z(value) {\n\t\tthis[2] = value;\n\t}\n\tset w(value) {\n\t\tthis[3] = value;\n\t}\n};\nvar Vec2fImpl = class Vec2fImpl extends Vec2 {\n\tget [$internal]() {\n\t\treturn { elementSchema: f32 };\n\t}\n\tget kind() {\n\t\treturn \"vec2f\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2fImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3fImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4fImpl;\n\t}\n};\nvar Vec2hImpl = class Vec2hImpl extends Vec2 {\n\tget [$internal]() {\n\t\treturn { elementSchema: f16 };\n\t}\n\tget kind() {\n\t\treturn \"vec2h\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2hImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3hImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4hImpl;\n\t}\n};\nvar Vec2iImpl = class Vec2iImpl extends Vec2 {\n\tget [$internal]() {\n\t\treturn { elementSchema: i32 };\n\t}\n\tget kind() {\n\t\treturn \"vec2i\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2iImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3iImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4iImpl;\n\t}\n};\nvar Vec2uImpl = class Vec2uImpl extends Vec2 {\n\tget [$internal]() {\n\t\treturn { elementSchema: u32 };\n\t}\n\tget kind() {\n\t\treturn \"vec2u\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2uImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3uImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4uImpl;\n\t}\n};\nvar Vec2bImpl = class Vec2bImpl extends Vec2 {\n\tget [$internal]() {\n\t\treturn { elementSchema: bool };\n\t}\n\tget kind() {\n\t\treturn \"vec2<bool>\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2bImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3bImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4bImpl;\n\t}\n};\nvar Vec3fImpl = class Vec3fImpl extends Vec3 {\n\tget [$internal]() {\n\t\treturn { elementSchema: f32 };\n\t}\n\tget kind() {\n\t\treturn \"vec3f\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2fImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3fImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4fImpl;\n\t}\n};\nvar Vec3hImpl = class Vec3hImpl extends Vec3 {\n\tget [$internal]() {\n\t\treturn { elementSchema: f16 };\n\t}\n\tget kind() {\n\t\treturn \"vec3h\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2hImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3hImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4hImpl;\n\t}\n};\nvar Vec3iImpl = class Vec3iImpl extends Vec3 {\n\tget [$internal]() {\n\t\treturn { elementSchema: i32 };\n\t}\n\tget kind() {\n\t\treturn \"vec3i\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2iImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3iImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4iImpl;\n\t}\n};\nvar Vec3uImpl = class Vec3uImpl extends Vec3 {\n\tget [$internal]() {\n\t\treturn { elementSchema: u32 };\n\t}\n\tget kind() {\n\t\treturn \"vec3u\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2uImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3uImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4uImpl;\n\t}\n};\nvar Vec3bImpl = class Vec3bImpl extends Vec3 {\n\tget [$internal]() {\n\t\treturn { elementSchema: bool };\n\t}\n\tget kind() {\n\t\treturn \"vec3<bool>\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2bImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3bImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4bImpl;\n\t}\n};\nvar Vec4fImpl = class Vec4fImpl extends Vec4 {\n\tget [$internal]() {\n\t\treturn { elementSchema: f32 };\n\t}\n\tget kind() {\n\t\treturn \"vec4f\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2fImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3fImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4fImpl;\n\t}\n};\nvar Vec4hImpl = class Vec4hImpl extends Vec4 {\n\tget [$internal]() {\n\t\treturn { elementSchema: f16 };\n\t}\n\tget kind() {\n\t\treturn \"vec4h\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2hImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3hImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4hImpl;\n\t}\n};\nvar Vec4iImpl = class Vec4iImpl extends Vec4 {\n\tget [$internal]() {\n\t\treturn { elementSchema: i32 };\n\t}\n\tget kind() {\n\t\treturn \"vec4i\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2iImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3iImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4iImpl;\n\t}\n};\nvar Vec4uImpl = class Vec4uImpl extends Vec4 {\n\tget [$internal]() {\n\t\treturn { elementSchema: u32 };\n\t}\n\tget kind() {\n\t\treturn \"vec4u\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2uImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3uImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4uImpl;\n\t}\n};\nvar Vec4bImpl = class Vec4bImpl extends Vec4 {\n\tget [$internal]() {\n\t\treturn { elementSchema: bool };\n\t}\n\tget kind() {\n\t\treturn \"vec4<bool>\";\n\t}\n\tget _Vec2() {\n\t\treturn Vec2bImpl;\n\t}\n\tget _Vec3() {\n\t\treturn Vec3bImpl;\n\t}\n\tget _Vec4() {\n\t\treturn Vec4bImpl;\n\t}\n};\n\n//#endregion\nexport { Vec2bImpl, Vec2fImpl, Vec2hImpl, Vec2iImpl, Vec2uImpl, Vec3bImpl, Vec3fImpl, Vec3hImpl, Vec3iImpl, Vec3uImpl, Vec4bImpl, Vec4fImpl, Vec4hImpl, Vec4iImpl, Vec4uImpl, VecBase };","import { $internal, $repr } from \"../shared/symbols.js\";\nimport { isVec } from \"./wgslTypes.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { callableSchema } from \"../core/function/createCallableSchema.js\";\nimport { bool, f16, f32, i32, u32 } from \"./numeric.js\";\nimport { Vec2bImpl, Vec2fImpl, Vec2hImpl, Vec2iImpl, Vec2uImpl, Vec3bImpl, Vec3fImpl, Vec3hImpl, Vec3iImpl, Vec3uImpl, Vec4bImpl, Vec4fImpl, Vec4hImpl, Vec4iImpl, Vec4uImpl } from \"./vectorImpl.js\";\n\n//#region src/data/vector.ts\n/**\n* Schema representing vec2f - a vector with 2 elements of type f32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec2f(); // (0.0, 0.0)\n* const vector = d.vec2f(1); // (1.0, 1.0)\n* const vector = d.vec2f(0.5, 0.1); // (0.5, 0.1)\n*\n* @example\n* const buffer = root.createBuffer(d.vec2f, d.vec2f(0, 1)); // buffer holding a d.vec2f value, with an initial value of vec2f(0, 1);\n*/\nconst vec2f = makeVecSchema(Vec2fImpl, f32);\n/**\n* Schema representing vec2h - a vector with 2 elements of type f16.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec2h(); // (0.0, 0.0)\n* const vector = d.vec2h(1); // (1.0, 1.0)\n* const vector = d.vec2h(0.5, 0.1); // (0.5, 0.1)\n*\n* @example\n* const buffer = root.createBuffer(d.vec2h, d.vec2h(0, 1)); // buffer holding a d.vec2h value, with an initial value of vec2h(0, 1);\n*/\nconst vec2h = makeVecSchema(Vec2hImpl, f16);\n/**\n* Schema representing vec2i - a vector with 2 elements of type i32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec2i(); // (0, 0)\n* const vector = d.vec2i(1); // (1, 1)\n* const vector = d.vec2i(-1, 1); // (-1, 1)\n*\n* @example\n* const buffer = root.createBuffer(d.vec2i, d.vec2i(0, 1)); // buffer holding a d.vec2i value, with an initial value of vec2i(0, 1);\n*/\nconst vec2i = makeVecSchema(Vec2iImpl, i32);\n/**\n* Schema representing vec2u - a vector with 2 elements of type u32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec2u(); // (0, 0)\n* const vector = d.vec2u(1); // (1, 1)\n* const vector = d.vec2u(1, 2); // (1, 2)\n*\n* @example\n* const buffer = root.createBuffer(d.vec2u, d.vec2u(0, 1)); // buffer holding a d.vec2u value, with an initial value of vec2u(0, 1);\n*/\nconst vec2u = makeVecSchema(Vec2uImpl, u32);\n/**\n* Schema representing `vec2<bool>` - a vector with 2 elements of type `bool`.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec2b(); // (false, false)\n* const vector = d.vec2b(true); // (true, true)\n* const vector = d.vec2b(false, true); // (false, true)\n*/\nconst vec2b = makeVecSchema(Vec2bImpl, bool);\n/**\n* Schema representing vec3f - a vector with 3 elements of type f32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec3f(); // (0.0, 0.0, 0.0)\n* const vector = d.vec3f(1); // (1.0, 1.0, 1.0)\n* const vector = d.vec3f(1, 2, 3.5); // (1.0, 2.0, 3.5)\n*\n* @example\n* const buffer = root.createBuffer(d.vec3f, d.vec3f(0, 1, 2)); // buffer holding a d.vec3f value, with an initial value of vec3f(0, 1, 2);\n*/\nconst vec3f = makeVecSchema(Vec3fImpl, f32);\n/**\n* Schema representing vec3h - a vector with 3 elements of type f16.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec3h(); // (0.0, 0.0, 0.0)\n* const vector = d.vec3h(1); // (1.0, 1.0, 1.0)\n* const vector = d.vec3h(1, 2, 3.5); // (1.0, 2.0, 3.5)\n*\n* @example\n* const buffer = root.createBuffer(d.vec3h, d.vec3h(0, 1, 2)); // buffer holding a d.vec3h value, with an initial value of vec3h(0, 1, 2);\n*/\nconst vec3h = makeVecSchema(Vec3hImpl, f16);\n/**\n* Schema representing vec3i - a vector with 3 elements of type i32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec3i(); // (0, 0, 0)\n* const vector = d.vec3i(1); // (1, 1, 1)\n* const vector = d.vec3i(1, 2, -3); // (1, 2, -3)\n*\n* @example\n* const buffer = root.createBuffer(d.vec3i, d.vec3i(0, 1, 2)); // buffer holding a d.vec3i value, with an initial value of vec3i(0, 1, 2);\n*/\nconst vec3i = makeVecSchema(Vec3iImpl, i32);\n/**\n* Schema representing vec3u - a vector with 3 elements of type u32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec3u(); // (0, 0, 0)\n* const vector = d.vec3u(1); // (1, 1, 1)\n* const vector = d.vec3u(1, 2, 3); // (1, 2, 3)\n*\n* @example\n* const buffer = root.createBuffer(d.vec3u, d.vec3u(0, 1, 2)); // buffer holding a d.vec3u value, with an initial value of vec3u(0, 1, 2);\n*/\nconst vec3u = makeVecSchema(Vec3uImpl, u32);\n/**\n* Schema representing `vec3<bool>` - a vector with 3 elements of type `bool`.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec3b(); // (false, false, false)\n* const vector = d.vec3b(true); // (true, true, true)\n* const vector = d.vec3b(false, true, false); // (false, true, false)\n*/\nconst vec3b = makeVecSchema(Vec3bImpl, bool);\n/**\n* Schema representing vec4f - a vector with 4 elements of type f32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec4f(); // (0.0, 0.0, 0.0, 0.0)\n* const vector = d.vec4f(1); // (1.0, 1.0, 1.0, 1.0)\n* const vector = d.vec4f(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)\n*\n* @example\n* const buffer = root.createBuffer(d.vec4f, d.vec4f(0, 1, 2, 3)); // buffer holding a d.vec4f value, with an initial value of vec4f(0, 1, 2, 3);\n*/\nconst vec4f = makeVecSchema(Vec4fImpl, f32);\n/**\n* Schema representing vec4h - a vector with 4 elements of type f16.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec4h(); // (0.0, 0.0, 0.0, 0.0)\n* const vector = d.vec4h(1); // (1.0, 1.0, 1.0, 1.0)\n* const vector = d.vec4h(1, 2, 3, 4.5); // (1.0, 2.0, 3.0, 4.5)\n*\n* @example\n* const buffer = root.createBuffer(d.vec4h, d.vec4h(0, 1, 2, 3)); // buffer holding a d.vec4h value, with an initial value of vec4h(0, 1, 2, 3);\n*/\nconst vec4h = makeVecSchema(Vec4hImpl, f16);\n/**\n* Schema representing vec4i - a vector with 4 elements of type i32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec4i(); // (0, 0, 0, 0)\n* const vector = d.vec4i(1); // (1, 1, 1, 1)\n* const vector = d.vec4i(1, 2, 3, -4); // (1, 2, 3, -4)\n*\n* @example\n* const buffer = root.createBuffer(d.vec4i, d.vec4i(0, 1, 2, 3)); // buffer holding a d.vec4i value, with an initial value of vec4i(0, 1, 2, 3);\n*/\nconst vec4i = makeVecSchema(Vec4iImpl, i32);\n/**\n* Schema representing vec4u - a vector with 4 elements of type u32.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec4u(); // (0, 0, 0, 0)\n* const vector = d.vec4u(1); // (1, 1, 1, 1)\n* const vector = d.vec4u(1, 2, 3, 4); // (1, 2, 3, 4)\n*\n* @example\n* const buffer = root.createBuffer(d.vec4u, d.vec4u(0, 1, 2, 3)); // buffer holding a d.vec4u value, with an initial value of vec4u(0, 1, 2, 3);\n*/\nconst vec4u = makeVecSchema(Vec4uImpl, u32);\n/**\n* Schema representing `vec4<bool>` - a vector with 4 elements of type `bool`.\n* Also a constructor function for this vector value.\n*\n* @example\n* const vector = d.vec4b(); // (false, false, false, false)\n* const vector = d.vec4b(true); // (true, true, true, true)\n* const vector = d.vec4b(false, true, false, true); // (false, true, false, true)\n*/\nconst vec4b = makeVecSchema(Vec4bImpl, bool);\nconst vecTypeToConstructor = {\n\tvec2f,\n\tvec2h,\n\tvec2i,\n\tvec2u,\n\t\"vec2<bool>\": vec2b,\n\tvec3f,\n\tvec3h,\n\tvec3i,\n\tvec3u,\n\t\"vec3<bool>\": vec3b,\n\tvec4f,\n\tvec4h,\n\tvec4i,\n\tvec4u,\n\t\"vec4<bool>\": vec4b\n};\nfunction makeVecSchema(VecImpl, primitive) {\n\tconst { kind: type, length } = new VecImpl();\n\tconst componentCount = length;\n\tconst cpuConstruct = (...args) => {\n\t\tconst values = Array.from({ length: args.length });\n\t\tlet j = 0;\n\t\tfor (const arg of args) if (typeof arg === \"number\" || typeof arg === \"boolean\") values[j++] = arg;\n\t\telse for (let c = 0; c < arg.length; ++c) values[j++] = arg[c];\n\t\tif (values.length <= 1 || values.length === componentCount) return new VecImpl(...values);\n\t\tthrow new Error(`'${type}' constructor called with invalid number of arguments.`);\n\t};\n\tconst construct = callableSchema({\n\t\tname: type,\n\t\tsignature: (...args) => ({\n\t\t\targTypes: args.map((arg) => isVec(arg) ? arg : primitive),\n\t\t\treturnType: schema\n\t\t}),\n\t\tnormalImpl: cpuConstruct,\n\t\tcodegenImpl: (_ctx, args) => {\n\t\t\tif (args.length === 1 && args[0]?.dataType === schema) return stitch`${args[0]}`;\n\t\t\treturn stitch`${type}(${args})`;\n\t\t}\n\t});\n\tconst schema = Object.assign(construct, {\n\t\t[$internal]: {},\n\t\ttype,\n\t\tprimitive,\n\t\tcomponentCount,\n\t\t[$repr]: void 0\n\t});\n\tVecImpl.prototype.schema = schema;\n\treturn schema;\n}\n\n//#endregion\nexport { vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u, vecTypeToConstructor };","import { $cast, $gpuCallable, $internal, isMarkedInternal } from \"../shared/symbols.js\";\nimport { schemaCallWrapper, schemaCallWrapperGPU } from \"./schemaCallWrapper.js\";\nimport { f32, i32, u32 } from \"./numeric.js\";\nimport { vec2f, vec2i, vec2u, vec3f, vec3i, vec3u, vec4f, vec4i, vec4u } from \"./vector.js\";\n\n//#region src/data/vertexFormatData.ts\nvar TgpuVertexFormatDataImpl = class {\n\t[$internal] = {};\n\t[$gpuCallable];\n\tconstructor(type) {\n\t\tthis.type = type;\n\t\tthis[$gpuCallable] = { call: (ctx, [v]) => {\n\t\t\treturn schemaCallWrapperGPU(ctx, formatToWGSLType[this.type], v);\n\t\t} };\n\t}\n\t[$cast](v) {\n\t\treturn schemaCallWrapper(formatToWGSLType[this.type], v);\n\t}\n};\nconst formatToWGSLType = {\n\tuint8: u32,\n\tuint8x2: vec2u,\n\tuint8x4: vec4u,\n\tsint8: i32,\n\tsint8x2: vec2i,\n\tsint8x4: vec4i,\n\tunorm8: f32,\n\tunorm8x2: vec2f,\n\tunorm8x4: vec4f,\n\tsnorm8: f32,\n\tsnorm8x2: vec2f,\n\tsnorm8x4: vec4f,\n\tuint16: u32,\n\tuint16x2: vec2u,\n\tuint16x4: vec4u,\n\tsint16: i32,\n\tsint16x2: vec2i,\n\tsint16x4: vec4i,\n\tunorm16: f32,\n\tunorm16x2: vec2f,\n\tunorm16x4: vec4f,\n\tsnorm16: f32,\n\tsnorm16x2: vec2f,\n\tsnorm16x4: vec4f,\n\tfloat16: f32,\n\tfloat16x2: vec2f,\n\tfloat16x4: vec4f,\n\tfloat32: f32,\n\tfloat32x2: vec2f,\n\tfloat32x3: vec3f,\n\tfloat32x4: vec4f,\n\tuint32: u32,\n\tuint32x2: vec2u,\n\tuint32x3: vec3u,\n\tuint32x4: vec4u,\n\tsint32: i32,\n\tsint32x2: vec2i,\n\tsint32x3: vec3i,\n\tsint32x4: vec4i,\n\t\"unorm10-10-10-2\": vec4f,\n\t\"unorm8x4-bgra\": vec4f\n};\nconst packedFormats = new Set(Object.keys(formatToWGSLType));\nconst uint8 = new TgpuVertexFormatDataImpl(\"uint8\");\nconst uint8x2 = new TgpuVertexFormatDataImpl(\"uint8x2\");\nconst uint8x4 = new TgpuVertexFormatDataImpl(\"uint8x4\");\nconst sint8 = new TgpuVertexFormatDataImpl(\"sint8\");\nconst sint8x2 = new TgpuVertexFormatDataImpl(\"sint8x2\");\nconst sint8x4 = new TgpuVertexFormatDataImpl(\"sint8x4\");\nconst unorm8 = new TgpuVertexFormatDataImpl(\"unorm8\");\nconst unorm8x2 = new TgpuVertexFormatDataImpl(\"unorm8x2\");\nconst unorm8x4 = new TgpuVertexFormatDataImpl(\"unorm8x4\");\nconst snorm8 = new TgpuVertexFormatDataImpl(\"snorm8\");\nconst snorm8x2 = new TgpuVertexFormatDataImpl(\"snorm8x2\");\nconst snorm8x4 = new TgpuVertexFormatDataImpl(\"snorm8x4\");\nconst uint16 = new TgpuVertexFormatDataImpl(\"uint16\");\nconst uint16x2 = new TgpuVertexFormatDataImpl(\"uint16x2\");\nconst uint16x4 = new TgpuVertexFormatDataImpl(\"uint16x4\");\nconst sint16 = new TgpuVertexFormatDataImpl(\"sint16\");\nconst sint16x2 = new TgpuVertexFormatDataImpl(\"sint16x2\");\nconst sint16x4 = new TgpuVertexFormatDataImpl(\"sint16x4\");\nconst unorm16 = new TgpuVertexFormatDataImpl(\"unorm16\");\nconst unorm16x2 = new TgpuVertexFormatDataImpl(\"unorm16x2\");\nconst unorm16x4 = new TgpuVertexFormatDataImpl(\"unorm16x4\");\nconst snorm16 = new TgpuVertexFormatDataImpl(\"snorm16\");\nconst snorm16x2 = new TgpuVertexFormatDataImpl(\"snorm16x2\");\nconst snorm16x4 = new TgpuVertexFormatDataImpl(\"snorm16x4\");\nconst float16 = new TgpuVertexFormatDataImpl(\"float16\");\nconst float16x2 = new TgpuVertexFormatDataImpl(\"float16x2\");\nconst float16x4 = new TgpuVertexFormatDataImpl(\"float16x4\");\nconst float32 = new TgpuVertexFormatDataImpl(\"float32\");\nconst float32x2 = new TgpuVertexFormatDataImpl(\"float32x2\");\nconst float32x3 = new TgpuVertexFormatDataImpl(\"float32x3\");\nconst float32x4 = new TgpuVertexFormatDataImpl(\"float32x4\");\nconst uint32 = new TgpuVertexFormatDataImpl(\"uint32\");\nconst uint32x2 = new TgpuVertexFormatDataImpl(\"uint32x2\");\nconst uint32x3 = new TgpuVertexFormatDataImpl(\"uint32x3\");\nconst uint32x4 = new TgpuVertexFormatDataImpl(\"uint32x4\");\nconst sint32 = new TgpuVertexFormatDataImpl(\"sint32\");\nconst sint32x2 = new TgpuVertexFormatDataImpl(\"sint32x2\");\nconst sint32x3 = new TgpuVertexFormatDataImpl(\"sint32x3\");\nconst sint32x4 = new TgpuVertexFormatDataImpl(\"sint32x4\");\nconst unorm10_10_10_2 = new TgpuVertexFormatDataImpl(\"unorm10-10-10-2\");\nconst unorm8x4_bgra = new TgpuVertexFormatDataImpl(\"unorm8x4-bgra\");\nfunction isPackedData(value) {\n\treturn isMarkedInternal(value) && packedFormats.has(value?.type);\n}\n\n//#endregion\nexport { float16, float16x2, float16x4, float32, float32x2, float32x3, float32x4, formatToWGSLType, isPackedData, packedFormats, sint16, sint16x2, sint16x4, sint32, sint32x2, sint32x3, sint32x4, sint8, sint8x2, sint8x4, snorm16, snorm16x2, snorm16x4, snorm8, snorm8x2, snorm8x4, uint16, uint16x2, uint16x4, uint32, uint32x2, uint32x3, uint32x4, uint8, uint8x2, uint8x4, unorm10_10_10_2, unorm16, unorm16x2, unorm16x4, unorm8, unorm8x2, unorm8x4, unorm8x4_bgra };","import { isDecorated, isWgslArray, isWgslStruct } from \"./wgslTypes.js\";\nimport { getCustomAlignment, isDisarray, isLooseDecorated, isUnstruct } from \"./dataTypes.js\";\nimport { safeStringify } from \"../shared/stringify.js\";\nimport { packedFormats } from \"./vertexFormatData.js\";\n\n//#region src/data/alignmentOf.ts\nconst knownAlignmentMap = {\n\tf32: 4,\n\tf16: 2,\n\ti32: 4,\n\tu32: 4,\n\tbool: 4,\n\tu16: 2,\n\tvec2f: 8,\n\tvec2h: 4,\n\tvec2i: 8,\n\tvec2u: 8,\n\t\"vec2<bool>\": 8,\n\tvec3f: 16,\n\tvec3h: 8,\n\tvec3i: 16,\n\tvec3u: 16,\n\t\"vec3<bool>\": 16,\n\tvec4f: 16,\n\tvec4h: 8,\n\tvec4i: 16,\n\tvec4u: 16,\n\t\"vec4<bool>\": 16,\n\tmat2x2f: 8,\n\tmat3x3f: 16,\n\tmat4x4f: 16,\n\tatomic: 4\n};\nfunction computeAlignment(data) {\n\tconst dataType = data?.type;\n\tconst knownAlignment = knownAlignmentMap[dataType];\n\tif (knownAlignment !== void 0) return knownAlignment;\n\tif (isWgslStruct(data)) return Object.values(data.propTypes).map(alignmentOf).reduce((a, b) => a > b ? a : b);\n\tif (isWgslArray(data)) return alignmentOf(data.elementType);\n\tif (isUnstruct(data)) {\n\t\tconst firstProp = Object.values(data.propTypes)[0];\n\t\treturn firstProp ? getCustomAlignment(firstProp) ?? 1 : 1;\n\t}\n\tif (isDisarray(data)) return getCustomAlignment(data.elementType) ?? 1;\n\tif (isDecorated(data) || isLooseDecorated(data)) return getCustomAlignment(data) ?? alignmentOf(data.inner);\n\tif (packedFormats.has(dataType)) return 1;\n\tthrow new Error(`Cannot determine alignment of data: ${safeStringify(data)}`);\n}\nfunction computeCustomAlignment(data) {\n\tif (isUnstruct(data)) {\n\t\tconst firstProp = Object.values(data.propTypes)[0];\n\t\treturn firstProp ? customAlignmentOf(firstProp) : 1;\n\t}\n\tif (isDisarray(data)) return customAlignmentOf(data.elementType);\n\tif (isLooseDecorated(data)) return getCustomAlignment(data) ?? customAlignmentOf(data.inner);\n\treturn getCustomAlignment(data) ?? 1;\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 = /* @__PURE__ */ new WeakMap();\nconst cachedCustomAlignments = /* @__PURE__ */ new WeakMap();\nfunction alignmentOf(data) {\n\tlet alignment = cachedAlignments.get(data);\n\tif (alignment === void 0) {\n\t\talignment = computeAlignment(data);\n\t\tcachedAlignments.set(data, alignment);\n\t}\n\treturn alignment;\n}\nfunction customAlignmentOf(data) {\n\tlet alignment = cachedCustomAlignments.get(data);\n\tif (alignment === void 0) {\n\t\talignment = computeCustomAlignment(data);\n\t\tcachedCustomAlignments.set(data, alignment);\n\t}\n\treturn alignment;\n}\n/**\n* Returns the alignment (in bytes) of data represented by the `schema`.\n*/\nfunction PUBLIC_alignmentOf(schema) {\n\treturn alignmentOf(schema);\n}\n\n//#endregion\nexport { PUBLIC_alignmentOf, alignmentOf, customAlignmentOf };","//#region src/mathUtils.ts\n/**\n* @param value\n* @param modulo has to be power of 2\n*/\nconst roundUp = (value, modulo) => {\n\tconst bitMask = modulo - 1;\n\tconst invBitMask = ~bitMask;\n\treturn (value & bitMask) === 0 ? value : (value & invBitMask) + modulo;\n};\n\n//#endregion\nexport { roundUp };","import { isDecorated, isWgslArray, isWgslStruct } from \"./wgslTypes.js\";\nimport { getCustomSize, isDisarray, isLooseDecorated, isUnstruct, undecorate } from \"./dataTypes.js\";\nimport { alignmentOf, customAlignmentOf } from \"./alignmentOf.js\";\nimport { roundUp } from \"../mathUtils.js\";\n\n//#region src/data/schemaMemoryLayout.ts\nconst knownSizesMap = {\n\tbool: 4,\n\tf32: 4,\n\tf16: 2,\n\ti32: 4,\n\tu32: 4,\n\tu16: 2,\n\tvec2f: 8,\n\tvec2h: 4,\n\tvec2i: 8,\n\tvec2u: 8,\n\t\"vec2<bool>\": 8,\n\tvec3f: 12,\n\tvec3h: 6,\n\tvec3i: 12,\n\tvec3u: 12,\n\t\"vec3<bool>\": 12,\n\tvec4f: 16,\n\tvec4h: 8,\n\tvec4i: 16,\n\tvec4u: 16,\n\t\"vec4<bool>\": 16,\n\tmat2x2f: 16,\n\tmat3x3f: 48,\n\tmat4x4f: 64,\n\tuint8: 1,\n\tuint8x2: 2,\n\tuint8x4: 4,\n\tsint8: 1,\n\tsint8x2: 2,\n\tsint8x4: 4,\n\tunorm8: 1,\n\tunorm8x2: 2,\n\tunorm8x4: 4,\n\tsnorm8: 1,\n\tsnorm8x2: 2,\n\tsnorm8x4: 4,\n\tuint16: 2,\n\tuint16x2: 4,\n\tuint16x4: 8,\n\tsint16: 2,\n\tsint16x2: 4,\n\tsint16x4: 8,\n\tunorm16: 2,\n\tunorm16x2: 4,\n\tunorm16x4: 8,\n\tsnorm16: 2,\n\tsnorm16x2: 4,\n\tsnorm16x4: 8,\n\tfloat16: 2,\n\tfloat16x2: 4,\n\tfloat16x4: 8,\n\tfloat32: 4,\n\tfloat32x2: 8,\n\tfloat32x3: 12,\n\tfloat32x4: 16,\n\tuint32: 4,\n\tuint32x2: 8,\n\tuint32x3: 12,\n\tuint32x4: 16,\n\tsint32: 4,\n\tsint32x2: 8,\n\tsint32x3: 12,\n\tsint32x4: 16,\n\t\"unorm10-10-10-2\": 4,\n\t\"unorm8x4-bgra\": 4,\n\tatomic: 4\n};\nfunction computeMLOfStruct(struct) {\n\tlet size = 0;\n\tlet longestContiguousPrefix = 0;\n\tlet isContiguous = true;\n\tlet prefixEnd = false;\n\tfor (const property of Object.values(struct.propTypes)) {\n\t\tif (Number.isNaN(size)) throw new Error(\"Only the last property of a struct can be unbounded\");\n\t\tconst prevSize = size;\n\t\tsize = roundUp(size, alignmentOf(property));\n\t\tconst hasPadding = prevSize !== size;\n\t\tconst propLayout = computeMemoryLayout(property);\n\t\tsize += propLayout.size;\n\t\tif (Number.isNaN(size) && property.type !== \"array\") throw new Error(\"Cannot nest unbounded struct within another struct\");\n\t\tif (prefixEnd) continue;\n\t\tif (!hasPadding && propLayout.isContiguous) longestContiguousPrefix += propLayout.size;\n\t\telse {\n\t\t\tprefixEnd = true;\n\t\t\tisContiguous = false;\n\t\t\tif (!hasPadding) longestContiguousPrefix += propLayout.longestContiguousPrefix;\n\t\t}\n\t}\n\tconst trueSize = roundUp(size, alignmentOf(struct));\n\treturn {\n\t\tisContiguous: size === trueSize && isContiguous,\n\t\tsize: trueSize,\n\t\tlongestContiguousPrefix\n\t};\n}\nfunction computeMLOfUnstruct(data) {\n\tlet size = 0;\n\tlet longestContiguousPrefix = 0;\n\tlet isContiguous = true;\n\tlet prefixEnd = false;\n\tfor (const property of Object.values(data.propTypes)) {\n\t\tconst alignment = customAlignmentOf(property);\n\t\tconst prevSize = size;\n\t\tsize = roundUp(size, alignment);\n\t\tconst hasPadding = prevSize !== size;\n\t\tif (hasPadding) isContiguous = false;\n\t\tconst propLayout = computeMemoryLayout(property);\n\t\tsize += propLayout.size;\n\t\tif (prefixEnd) continue;\n\t\tif (!hasPadding && propLayout.isContiguous) longestContiguousPrefix += propLayout.size;\n\t\telse {\n\t\t\tprefixEnd = true;\n\t\t\tisContiguous = false;\n\t\t\tif (!hasPadding) longestContiguousPrefix += propLayout.longestContiguousPrefix;\n\t\t}\n\t}\n\treturn {\n\t\tisContiguous,\n\t\tsize,\n\t\tlongestContiguousPrefix\n\t};\n}\nfunction computeMLOfWgslArray(data) {\n\tconst elementType = data.elementType;\n\tconst elementMemoryLayout = computeMemoryLayout(elementType);\n\tconst elementSize = elementMemoryLayout.size;\n\tconst stride = roundUp(elementSize, alignmentOf(elementType));\n\tconst isContiguous = !(stride > elementSize) && elementMemoryLayout.isContiguous;\n\tconst size = data.elementCount === 0 ? NaN : data.elementCount * stride;\n\tlet longestContiguousPrefix;\n\tif (isContiguous) longestContiguousPrefix = size;\n\telse longestContiguousPrefix = elementMemoryLayout.longestContiguousPrefix;\n\treturn {\n\t\tsize,\n\t\tisContiguous,\n\t\tlongestContiguousPrefix\n\t};\n}\nfunction computeMLOfDisarray(data) {\n\tconst elementType = data.elementType;\n\tconst elementMemoryLayout = computeMemoryLayout(elementType);\n\tconst elementSize = elementMemoryLayout.size;\n\tconst stride = roundUp(elementSize, customAlignmentOf(elementType));\n\tconst isContiguous = !(stride > elementSize) && elementMemoryLayout.isContiguous;\n\tconst size = data.elementCount * stride;\n\tlet longestContiguousPrefix;\n\tif (isContiguous) longestContiguousPrefix = size;\n\telse longestContiguousPrefix = elementMemoryLayout.longestContiguousPrefix;\n\treturn {\n\t\tsize,\n\t\tisContiguous,\n\t\tlongestContiguousPrefix\n\t};\n}\nfunction computeMemoryLayout(data) {\n\tconst knownSize = knownSizesMap[data.type];\n\tif (knownSize !== void 0) return {\n\t\tisContiguous: data.type !== \"mat3x3f\",\n\t\tsize: knownSize,\n\t\tlongestContiguousPrefix: data.type === \"mat3x3f\" ? 12 : knownSize\n\t};\n\tif (isWgslStruct(data)) return computeMLOfStruct(data);\n\tif (isUnstruct(data)) return computeMLOfUnstruct(data);\n\tif (isWgslArray(data)) return computeMLOfWgslArray(data);\n\tif (isDisarray(data)) return computeMLOfDisarray(data);\n\tif (isDecorated(data) || isLooseDecorated(data)) {\n\t\tconst size = getCustomSize(data);\n\t\tconst undecoratedLayout = computeMemoryLayout(undecorate(data));\n\t\tif (size) return {\n\t\t\tisContiguous: size === undecoratedLayout.size && undecoratedLayout.isContiguous,\n\t\t\tsize,\n\t\t\tlongestContiguousPrefix: undecoratedLayout.longestContiguousPrefix\n\t\t};\n\t\treturn computeMemoryLayout(data.inner);\n\t}\n\tthrow new Error(`Cannot determine memory layout of data: ${data}`);\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 = /* @__PURE__ */ new WeakMap();\nfunction getLayoutInfo(schema, key) {\n\tlet layout = cachedLayouts.get(schema);\n\tif (layout === void 0) {\n\t\tlayout = computeMemoryLayout(schema);\n\t\tcachedLayouts.set(schema, layout);\n\t}\n\treturn layout[key];\n}\n\n//#endregion\nexport { getLayoutInfo };","import { getLayoutInfo } from \"./schemaMemoryLayout.js\";\n\n//#region src/data/sizeOf.ts\nfunction sizeOf(schema) {\n\treturn getLayoutInfo(schema, \"size\");\n}\n/**\n* Returns the size (in bytes) of data represented by the `schema`.\n*/\nfunction PUBLIC_sizeOf(schema) {\n\treturn sizeOf(schema);\n}\n\n//#endregion\nexport { PUBLIC_sizeOf, sizeOf };","import { $internal } from \"../shared/symbols.js\";\nimport { isAlignAttrib, isBuiltinAttrib, isDecorated, isSizeAttrib, isWgslData } from \"./wgslTypes.js\";\nimport { isLooseData, isLooseDecorated } from \"./dataTypes.js\";\nimport { alignmentOf } from \"./alignmentOf.js\";\nimport { sizeOf } from \"./sizeOf.js\";\n\n//#region src/data/attributes.ts\nfunction attribute(data, attrib) {\n\tif (isDecorated(data)) return new DecoratedImpl(data.inner, [attrib, ...data.attribs]);\n\tif (isLooseDecorated(data)) return new LooseDecoratedImpl(data.inner, [attrib, ...data.attribs]);\n\tif (isLooseData(data)) return new LooseDecoratedImpl(data, [attrib]);\n\treturn new DecoratedImpl(data, [attrib]);\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*/\nfunction align(alignment, data) {\n\treturn attribute(data, {\n\t\t[$internal]: true,\n\t\ttype: \"@align\",\n\t\tparams: [alignment]\n\t});\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*/\nfunction size(size, data) {\n\treturn attribute(data, {\n\t\t[$internal]: true,\n\t\ttype: \"@size\",\n\t\tparams: [size]\n\t});\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*/\nfunction location(location, data) {\n\treturn attribute(data, {\n\t\t[$internal]: true,\n\t\ttype: \"@location\",\n\t\tparams: [location]\n\t});\n}\nfunction interpolate(interpolationType, data) {\n\treturn attribute(data, {\n\t\t[$internal]: true,\n\t\ttype: \"@interpolate\",\n\t\tparams: [interpolationType]\n\t});\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*/\nfunction invariant(data) {\n\tif (!isBuiltin(data)) throw new Error(\"The @invariant attribute must only be applied to the position built-in value.\");\n\tconst builtinAttrib = isDecorated(data) || isLooseDecorated(data) ? data.attribs.find(isBuiltinAttrib) : void 0;\n\tif (!builtinAttrib || builtinAttrib.params[0] !== \"position\") throw new Error(\"The @invariant attribute must only be applied to the position built-in value.\");\n\treturn attribute(data, {\n\t\t[$internal]: true,\n\t\ttype: \"@invariant\",\n\t\tparams: []\n\t});\n}\nfunction isBuiltin(value) {\n\treturn (isDecorated(value) || isLooseDecorated(value)) && value.attribs.find(isBuiltinAttrib) !== void 0;\n}\nfunction getAttributesString(field) {\n\tif (!isDecorated(field) && !isLooseDecorated(field)) return \"\";\n\treturn field.attribs.map((attrib) => {\n\t\tif (attrib.params.length === 0) return `${attrib.type} `;\n\t\treturn `${attrib.type}(${attrib.params.join(\", \")}) `;\n\t}).join(\"\");\n}\nvar BaseDecoratedImpl = class {\n\t[$internal] = {};\n\tconstructor(inner, attribs) {\n\t\tthis.inner = inner;\n\t\tthis.attribs = attribs;\n\t\tconst alignAttrib = attribs.find(isAlignAttrib)?.params[0];\n\t\tconst sizeAttrib = attribs.find(isSizeAttrib)?.params[0];\n\t\tif (alignAttrib !== void 0) {\n\t\t\tif (alignAttrib <= 0) throw new Error(`Custom data alignment must be a positive number, got: ${alignAttrib}.`);\n\t\t\tif (Math.log2(alignAttrib) % 1 !== 0) throw new Error(`Alignment has to be a power of 2, got: ${alignAttrib}.`);\n\t\t\tif (isWgslData(this.inner)) {\n\t\t\t\tif (alignAttrib % alignmentOf(this.inner) !== 0) throw new Error(`Custom alignment has to be a multiple of the standard data alignment. Got: ${alignAttrib}, expected multiple of: ${alignmentOf(this.inner)}.`);\n\t\t\t}\n\t\t}\n\t\tif (sizeAttrib !== void 0) {\n\t\t\tif (sizeAttrib < sizeOf(this.inner)) throw new Error(`Custom data size cannot be smaller then the standard data size. Got: ${sizeAttrib}, expected at least: ${sizeOf(this.inner)}.`);\n\t\t\tif (sizeAttrib <= 0) throw new Error(`Custom data size must be a positive number. Got: ${sizeAttrib}.`);\n\t\t}\n\t}\n};\nvar DecoratedImpl = class extends BaseDecoratedImpl {\n\t[$internal] = {};\n\ttype = \"decorated\";\n};\nvar LooseDecoratedImpl = class extends BaseDecoratedImpl {\n\t[$internal] = {};\n\ttype = \"loose-decorated\";\n};\n\n//#endregion\nexport { align, attribute, getAttributesString, interpolate, invariant, isBuiltin, location, size };","//#region src/core/function/extractArgs.ts\n/**\n* Extracts info about arguments of a given WGSL function string.\n* @example\n* const code = `\n* fn add(a: i32, @location(0) b: i32, c) -> i32 {\n* return a + b + c;\n* }`;\n*\n* extractArgs(code);\n* // {\n* // args: [\n* // { identifier: 'a', attributes: [], type: 'i32' },\n* // { identifier: 'b', attributes: ['@location(0)'], type: 'i32' },\n* // { identifier: 'c', attributes: [], type: undefined }\n* // ],\n* // ret: { type: 'i32', attributes: [] },\n* // range: { begin: 11, end: 51 }\n* // }\n*/\nfunction extractArgs(rawCode) {\n\tconst { strippedCode, argRange: range } = strip(rawCode);\n\tconst code = new ParsableString(strippedCode);\n\tcode.consume(\"(\");\n\tconst args = [];\n\twhile (!code.isAt(\")\")) {\n\t\tconst attributes = [];\n\t\twhile (code.isAt(\"@\")) {\n\t\t\tcode.parseUntil(closingParenthesis, parentheses);\n\t\t\tcode.consume(\")\");\n\t\t\tattributes.push(code.lastParsed);\n\t\t}\n\t\tcode.parseUntil(identifierEndSymbols);\n\t\tconst identifier = code.lastParsed;\n\t\tlet maybeType;\n\t\tif (code.isAt(\":\")) {\n\t\t\tcode.consume(\":\");\n\t\t\tcode.parseUntil(typeEndSymbols, angleBrackets);\n\t\t\tmaybeType = code.lastParsed;\n\t\t}\n\t\targs.push({\n\t\t\tidentifier,\n\t\t\tattributes,\n\t\t\ttype: maybeType\n\t\t});\n\t\tif (code.isAt(\",\")) code.consume(\",\");\n\t}\n\tcode.consume(\")\");\n\tlet maybeRet;\n\tif (code.isAt(\"->\")) {\n\t\tcode.consume(\"->\");\n\t\tconst attributes = [];\n\t\twhile (code.isAt(\"@\")) {\n\t\t\tcode.parseUntil(closingParenthesis, parentheses);\n\t\t\tcode.consume(\")\");\n\t\t\tattributes.push(code.lastParsed);\n\t\t}\n\t\tmaybeRet = {\n\t\t\ttype: code.str.slice(code.pos),\n\t\t\tattributes\n\t\t};\n\t}\n\treturn {\n\t\targs,\n\t\tret: maybeRet,\n\t\trange: {\n\t\t\tbegin: range[0],\n\t\t\tend: range[1]\n\t\t}\n\t};\n}\n/**\n* Strips comments, whitespaces, the name and the body of the function.\n* @example\n* const code = `\n* fn add( a, // first argument\n* @location(0) b : i32 ) -> i32 {\n* return a + b; // returns the sum\n* }`;\n*\n* strip(code); // \"(a,@location(0)b:i32)->i32\"\n*/\nfunction strip(rawCode) {\n\tconst code = new ParsableString(rawCode);\n\tlet strippedCode = \"\";\n\tlet argsStart;\n\twhile (!code.isFinished()) {\n\t\tif (code.isAt(blankSpaces)) {\n\t\t\tcode.advanceBy(1);\n\t\t\tcontinue;\n\t\t}\n\t\tif (code.isAt(\"//\")) {\n\t\t\tcode.consume(\"//\");\n\t\t\tcode.parseUntil(lineBreaks);\n\t\t\tcode.advanceBy(1);\n\t\t\tcontinue;\n\t\t}\n\t\tif (code.isAt(\"/*\")) {\n\t\t\tcode.parseUntil(openingCommentBlock, commentBlocks);\n\t\t\tcode.consume(\"*/\");\n\t\t\tcontinue;\n\t\t}\n\t\tif (code.isAt(\"{\")) return {\n\t\t\tstrippedCode,\n\t\t\targRange: [argsStart, code.pos]\n\t\t};\n\t\tif (code.isAt(\"(\") && argsStart === void 0) argsStart = code.pos;\n\t\tif (argsStart !== void 0) strippedCode += code.str[code.pos];\n\t\tcode.advanceBy(1);\n\t}\n\tthrow new Error(\"Invalid wgsl code!\");\n}\nvar ParsableString = class {\n\t#parseStartPos;\n\t#pos;\n\tconstructor(str) {\n\t\tthis.str = str;\n\t\tthis.#pos = 0;\n\t}\n\tget pos() {\n\t\treturn this.#pos;\n\t}\n\t/**\n\t* This property is equivalent to the substring of `this.str`\n\t* from the position of the last `parseUntil` call, to the current position.\n\t*/\n\tget lastParsed() {\n\t\tif (this.#parseStartPos === void 0) throw new Error(\"Parse was not called yet!\");\n\t\treturn this.str.slice(this.#parseStartPos, this.pos);\n\t}\n\tisFinished() {\n\t\treturn this.#pos >= this.str.length;\n\t}\n\tisAt(substr) {\n\t\tif (typeof substr === \"string\") {\n\t\t\tfor (let i = 0; i < substr.length; i++) if (this.str[this.#pos + i] !== substr[i]) return false;\n\t\t\treturn true;\n\t\t}\n\t\tfor (const elem of substr) if (this.isAt(elem)) return true;\n\t\treturn false;\n\t}\n\t/**\n\t* @param toFind a set of strings either of which satisfy the search.\n\t* @param brackets a pair of brackets that has to be closed for result to be valid. This includes the found character(s).\n\t* @example\n\t* // internal state:\n\t* // '(@attribute(0) identifier: type)'\n\t* // ^\n\t* this.parse(new Set(')'), ['(', ')']);\n\t* // internal state:\n\t* // '(@attribute(0) identifier: type)'\n\t* // ^\n\t*/\n\tparseUntil(toFind, brackets) {\n\t\tthis.#parseStartPos = this.#pos;\n\t\tlet openedBrackets = 0;\n\t\twhile (this.#pos < this.str.length) {\n\t\t\tif (brackets && this.isAt(brackets[0])) openedBrackets += 1;\n\t\t\tif (brackets && this.isAt(brackets[1])) openedBrackets -= 1;\n\t\t\tif (openedBrackets === 0) {\n\t\t\t\tif (this.isAt(toFind)) return this.#pos;\n\t\t\t}\n\t\t\tthis.#pos += 1;\n\t\t}\n\t\tthrow new Error(\"Reached the end of the string without finding a match!\");\n\t}\n\tadvanceBy(steps) {\n\t\tthis.#pos += steps;\n\t}\n\tconsume(str) {\n\t\tif (!this.isAt(str)) throw new Error(`Expected '${str}' at position ${this.#pos}, but found '${this.str.slice(this.#pos, this.#pos + str.length)}'`);\n\t\tthis.advanceBy(str.length);\n\t}\n};\nconst lineBreaks = new Set([\n\t\"\\n\",\n\t\"\\v\",\n\t\"\\f\",\n\t\"\\r\",\n\t\"
\",\n\t\"\\u2028\",\n\t\"\\u2029\"\n]);\nconst blankSpaces = new Set([\n\t...lineBreaks,\n\t\" \",\n\t\"\t\",\n\t\"\",\n\t\"\"\n]);\nconst closingParenthesis = new Set([\")\"]);\nconst identifierEndSymbols = new Set([\n\t\":\",\n\t\",\",\n\t\")\"\n]);\nconst typeEndSymbols = new Set([\",\", \")\"]);\nconst openingCommentBlock = new Set([\"*/\"]);\nconst parentheses = [\"(\", \")\"];\nconst angleBrackets = [\"<\", \">\"];\nconst commentBlocks = [\"/*\", \"*/\"];\n\n//#endregion\nexport { extractArgs };","import { $getNameForward } from \"../../shared/symbols.js\";\nimport { getMetaData, getName } from \"../../shared/meta.js\";\nimport { Void, isWgslData, isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { undecorate } from \"../../data/dataTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { MissingLinksError } from \"../../errors.js\";\nimport { getAttributesString } from \"../../data/attributes.js\";\nimport { applyExternals, replaceExternalsInWgsl } from \"../resolve/externals.js\";\nimport { extractArgs } from \"./extractArgs.js\";\n\n//#region src/core/function/fnCore.ts\nfunction createFnCore(implementation, fnAttribute = \"\") {\n\t/**\n\t* External application has to be deferred until resolution because\n\t* some externals can reference the owner function which has not been\n\t* initialized yet (like when accessing the Output struct of a vertex\n\t* entry fn).\n\t*/\n\tconst externalsToApply = [];\n\treturn {\n\t\t[$getNameForward]: typeof implementation === \"function\" ? implementation : void 0,\n\t\tapplyExternals(newExternals) {\n\t\t\texternalsToApply.push(newExternals);\n\t\t},\n\t\tresolve(ctx, argTypes, returnType) {\n\t\t\tconst externalMap = {};\n\t\t\tfor (const externals of externalsToApply) applyExternals(externalMap, externals);\n\t\t\tconst id = ctx.getUniqueName(this);\n\t\t\tif (typeof implementation === \"string\") {\n\t\t\t\tif (!returnType) throw new Error(\"Explicit return type is required for string implementation\");\n\t\t\t\tconst replacedImpl = replaceExternalsInWgsl(ctx, externalMap, implementation);\n\t\t\t\tlet header = \"\";\n\t\t\t\tlet body = \"\";\n\t\t\t\tif (fnAttribute !== \"\") {\n\t\t\t\t\tconst input = isWgslStruct(argTypes[0]) ? `(in: ${ctx.resolve(argTypes[0]).value})` : \"()\";\n\t\t\t\t\tconst attributes = isWgslData(returnType) ? getAttributesString(returnType) : \"\";\n\t\t\t\t\theader = `${input} ${returnType !== Void ? isWgslStruct(returnType) ? `-> ${ctx.resolve(returnType).value}` : `-> ${attributes !== \"\" ? attributes : \"@location(0)\"} ${ctx.resolve(returnType).value}` : \"\"} `;\n\t\t\t\t\tbody = replacedImpl;\n\t\t\t\t} else {\n\t\t\t\t\tconst providedArgs = extractArgs(replacedImpl);\n\t\t\t\t\tif (providedArgs.args.length !== argTypes.length) throw new Error(`WGSL implementation has ${providedArgs.args.length} arguments, while the shell has ${argTypes.length} arguments.`);\n\t\t\t\t\theader = `(${providedArgs.args.map((argInfo, i) => `${argInfo.identifier}: ${checkAndReturnType(ctx, `parameter ${argInfo.identifier}`, argInfo.type, argTypes[i])}`).join(\", \")}) ${returnType === Void ? \"\" : `-> ${checkAndReturnType(ctx, \"return type\", providedArgs.ret?.type, returnType)}`}`;\n\t\t\t\t\tbody = replacedImpl.slice(providedArgs.range.end);\n\t\t\t\t}\n\t\t\t\tctx.addDeclaration(`${fnAttribute}fn ${id}${header}${body}`);\n\t\t\t\treturn snip(id, returnType, \"runtime\");\n\t\t\t}\n\t\t\tconst pluginData = getMetaData(implementation);\n\t\t\tconst pluginExternals = typeof pluginData?.externals === \"function\" ? pluginData.externals() : pluginData?.externals;\n\t\t\tif (pluginExternals) applyExternals(externalMap, Object.fromEntries(Object.entries(pluginExternals).filter(([name]) => !(name in externalMap))));\n\t\t\tconst ast = pluginData?.ast;\n\t\t\tif (!ast) throw new Error(\"Missing metadata for tgpu.fn function body (either missing 'use gpu' directive, or misconfigured `unplugin-typegpu`)\");\n\t\t\tconst missingExternals = ast.externalNames.filter((name) => !(name in externalMap));\n\t\t\tif (missingExternals.length > 0) throw new MissingLinksError(getName(this), missingExternals);\n\t\t\tconst maybeSecondArg = ast.params[1];\n\t\t\tif (maybeSecondArg && maybeSecondArg.type === \"i\" && fnAttribute !== \"\") applyExternals(externalMap, { [maybeSecondArg.name]: undecorate(returnType) });\n\t\t\tconst { head, body, returnType: actualReturnType } = ctx.fnToWgsl({\n\t\t\t\tfunctionType: fnAttribute.includes(\"@compute\") ? \"compute\" : fnAttribute.includes(\"@vertex\") ? \"vertex\" : fnAttribute.includes(\"@fragment\") ? \"fragment\" : \"normal\",\n\t\t\t\targTypes,\n\t\t\t\tparams: ast.params,\n\t\t\t\treturnType,\n\t\t\t\tbody: ast.body,\n\t\t\t\texternalMap\n\t\t\t});\n\t\t\tctx.addDeclaration(`${fnAttribute}fn ${id}${ctx.resolve(head).value}${ctx.resolve(body).value}`);\n\t\t\treturn snip(id, actualReturnType, \"runtime\");\n\t\t}\n\t};\n}\nfunction checkAndReturnType(ctx, name, wgslType, jsType) {\n\tconst resolvedJsType = ctx.resolve(jsType).value.replace(/\\s/g, \"\");\n\tif (!wgslType) return resolvedJsType;\n\tconst resolvedWgslType = wgslType.replace(/\\s/g, \"\");\n\tif (resolvedWgslType !== resolvedJsType) throw new Error(`Type mismatch between TGPU shell and WGSL code string: ${name}, JS type \"${resolvedJsType}\", WGSL type \"${resolvedWgslType}\".`);\n\treturn wgslType;\n}\n\n//#endregion\nexport { createFnCore };","//#region src/core/function/templateUtils.ts\nfunction stripTemplate(arg, ...values) {\n\treturn isTemplateStringsArray(arg) ? templateLiteralIdentity(arg, ...values) : arg;\n}\nfunction isTemplateStringsArray(value) {\n\treturn Array.isArray(value) && \"raw\" in value && Array.isArray(value.raw) && value.raw.every((item) => typeof item === \"string\");\n}\nfunction templateLiteralIdentity(strings, ...values) {\n\treturn strings.slice(1).reduce((acc, elem, index) => `${acc}${values[index]}${elem}`, strings[0]);\n}\n\n//#endregion\nexport { stripTemplate };","import { $getNameForward, $internal, $providing, $resolve, isMarkedInternal } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { Void } from \"../../data/wgslTypes.js\";\nimport { ExecutionError } from \"../../errors.js\";\nimport { isAccessor, isMutableAccessor } from \"../slot/slotTypes.js\";\nimport { provideInsideTgpuFn } from \"../../execMode.js\";\nimport { stitch } from \"../resolve/stitch.js\";\nimport { schemaCallWrapper } from \"../../data/schemaCallWrapper.js\";\nimport { dualImpl } from \"./dualImpl.js\";\nimport { comptime } from \"./comptime.js\";\nimport { addArgTypesToExternals, addReturnTypeToExternals } from \"../resolve/externals.js\";\nimport { createFnCore } from \"./fnCore.js\";\nimport { stripTemplate } from \"./templateUtils.js\";\n\n//#region src/core/function/tgpuFn.ts\nfunction fn(argTypesOrCallback, returnType) {\n\tif (typeof argTypesOrCallback === \"function\") return createGenericFn(argTypesOrCallback, []);\n\tconst argTypes = argTypesOrCallback;\n\tconst shell = {\n\t\t[$internal]: true,\n\t\targTypes,\n\t\treturnType: returnType ?? Void\n\t};\n\tconst call = (arg, ...values) => createFn(shell, stripTemplate(arg, ...values));\n\treturn Object.assign(call, shell);\n}\nfunction isTgpuFn(value) {\n\treturn isMarkedInternal(value) && value?.resourceType === \"function\";\n}\nfunction isGenericFn(value) {\n\treturn isMarkedInternal(value) && value?.resourceType === \"generic-function\";\n}\nfunction stringifyPair([slot, value]) {\n\treturn `${getName(slot) ?? \"<unnamed>\"}=${value}`;\n}\nfunction createFn(shell, _implementation) {\n\tlet pairs = [];\n\tlet implementation;\n\tif (isGenericFn(_implementation)) {\n\t\tpairs = _implementation[$providing]?.pairs ?? [];\n\t\timplementation = _implementation[$internal].inner;\n\t} else implementation = _implementation;\n\tconst core = createFnCore(implementation, \"\");\n\tconst fnBase = {\n\t\tshell,\n\t\tresourceType: \"function\",\n\t\t[$internal]: { implementation },\n\t\t$uses(newExternals) {\n\t\t\tcore.applyExternals(newExternals);\n\t\t\treturn this;\n\t\t},\n\t\t[$getNameForward]: core,\n\t\t$name(label) {\n\t\t\tsetName(this, label);\n\t\t\treturn this;\n\t\t},\n\t\twith: comptime((slot, value) => {\n\t\t\treturn createBoundFunction(fn, [[isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot, value]]);\n\t\t}),\n\t\t[$resolve](ctx) {\n\t\t\tif (typeof implementation === \"string\") {\n\t\t\t\taddArgTypesToExternals(implementation, shell.argTypes, core.applyExternals);\n\t\t\t\taddReturnTypeToExternals(implementation, shell.returnType, core.applyExternals);\n\t\t\t}\n\t\t\treturn core.resolve(ctx, shell.argTypes, shell.returnType);\n\t\t}\n\t};\n\tconst call = dualImpl({\n\t\tname: void 0,\n\t\tnoComptime: true,\n\t\tsignature: {\n\t\t\targTypes: shell.argTypes,\n\t\t\treturnType: shell.returnType\n\t\t},\n\t\tnormalImpl: (...args) => provideInsideTgpuFn(() => {\n\t\t\ttry {\n\t\t\t\tif (typeof implementation === \"string\") throw new Error(\"Cannot execute on the CPU functions constructed with raw WGSL\");\n\t\t\t\tconst castAndCopiedArgs = args.map((arg, index) => schemaCallWrapper(shell.argTypes[index], arg));\n\t\t\t\tconst result = implementation(...castAndCopiedArgs);\n\t\t\t\treturn schemaCallWrapper(shell.returnType, result);\n\t\t\t} catch (err) {\n\t\t\t\tif (err instanceof ExecutionError) throw err.appendToTrace(fn);\n\t\t\t\tthrow new ExecutionError(err, [fn]);\n\t\t\t}\n\t\t}),\n\t\tcodegenImpl: (ctx, args) => ctx.withResetIndentLevel(() => stitch`${ctx.resolve(fn).value}(${args})`)\n\t});\n\tconst fn = Object.assign(call, fnBase);\n\tObject.defineProperty(fn, \"toString\", { value() {\n\t\treturn `fn:${getName(core) ?? \"<unnamed>\"}`;\n\t} });\n\tif (pairs.length > 0) return createBoundFunction(fn, pairs);\n\treturn fn;\n}\nfunction createBoundFunction(innerFn, pairs) {\n\tconst fnBase = {\n\t\tresourceType: \"function\",\n\t\tshell: innerFn.shell,\n\t\t[$internal]: { implementation: innerFn[$internal].implementation },\n\t\t[$providing]: {\n\t\t\tinner: innerFn,\n\t\t\tpairs\n\t\t},\n\t\t$uses(newExternals) {\n\t\t\tinnerFn.$uses(newExternals);\n\t\t\treturn this;\n\t\t},\n\t\t$name(label) {\n\t\t\tsetName(this, label);\n\t\t\treturn this;\n\t\t},\n\t\twith: comptime((slot, value) => {\n\t\t\tconst s = isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot;\n\t\t\treturn createBoundFunction(innerFn, [...pairs, [s, value]]);\n\t\t})\n\t};\n\tconst call = dualImpl({\n\t\tname: void 0,\n\t\tnoComptime: true,\n\t\tsignature: {\n\t\t\targTypes: innerFn.shell.argTypes,\n\t\t\treturnType: innerFn.shell.returnType\n\t\t},\n\t\tnormalImpl: innerFn,\n\t\tcodegenImpl: (ctx, args) => ctx.withResetIndentLevel(() => stitch`${ctx.resolve(fn).value}(${args})`)\n\t});\n\tconst fn = Object.assign(call, fnBase);\n\tObject.defineProperty(fn, \"toString\", { value() {\n\t\treturn `fn:${getName(this) ?? \"<unnamed>\"}[${pairs.map(stringifyPair).join(\", \")}]`;\n\t} });\n\tconst innerName = getName(innerFn);\n\tif (innerName) setName(fn, innerName);\n\treturn fn;\n}\nfunction createGenericFn(inner, pairs) {\n\tconst fnBase = {\n\t\t[$internal]: { inner },\n\t\tresourceType: \"generic-function\",\n\t\t[$providing]: pairs.length > 0 ? {\n\t\t\tinner,\n\t\t\tpairs\n\t\t} : void 0,\n\t\t$name(label) {\n\t\t\tsetName(this, label);\n\t\t\tif (!getName(inner)) setName(inner, label);\n\t\t\treturn this;\n\t\t},\n\t\t[$resolve](ctx) {\n\t\t\treturn ctx.resolve(inner);\n\t\t},\n\t\twith(slot, value) {\n\t\t\tconst s = isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot;\n\t\t\treturn createGenericFn(inner, [...pairs, [s, value]]);\n\t\t}\n\t};\n\tconst call = (...args) => {\n\t\treturn inner(...args);\n\t};\n\tconst genericFn = Object.assign(call, fnBase);\n\tif (getName(inner)) setName(genericFn, getName(inner));\n\tObject.defineProperty(genericFn, \"toString\", { value() {\n\t\tconst fnLabel = getName(genericFn) ?? \"<unnamed>\";\n\t\tif (pairs.length > 0) return `fn*:${fnLabel}[${pairs.map(stringifyPair).join(\", \")}]`;\n\t\treturn `fn*:${fnLabel}`;\n\t} });\n\treturn genericFn;\n}\n\n//#endregion\nexport { fn, isGenericFn, isTgpuFn };","import { getName } from \"./shared/meta.js\";\n\n//#region src/extension.ts\nfunction isUsableAsStorage(value) {\n\treturn !!value?.usableAsStorage;\n}\n/**\n* @category Errors\n*/\nvar NotStorageError = class NotStorageError extends Error {\n\tconstructor(value) {\n\t\tsuper(`Resource '${getName(value) ?? \"<unnamed>\"}' cannot be bound as 'storage'. Use .$usage('storage') to allow it.`);\n\t\tObject.setPrototypeOf(this, NotStorageError.prototype);\n\t}\n};\n\n//#endregion\nexport { NotStorageError, isUsableAsStorage };","import { $gpuValueOf } from \"./shared/symbols.js\";\n\n//#region src/getGPUValue.ts\nfunction getGPUValue(object) {\n\treturn object?.[$gpuValueOf];\n}\n\n//#endregion\nexport { getGPUValue };","import { invariant } from \"./errors.js\";\n\n//#region src/nameRegistry.ts\nconst bannedTokens = new Set([\n\t\"alias\",\n\t\"break\",\n\t\"case\",\n\t\"const\",\n\t\"const_assert\",\n\t\"continue\",\n\t\"continuing\",\n\t\"default\",\n\t\"diagnostic\",\n\t\"discard\",\n\t\"else\",\n\t\"enable\",\n\t\"false\",\n\t\"fn\",\n\t\"for\",\n\t\"if\",\n\t\"let\",\n\t\"loop\",\n\t\"override\",\n\t\"requires\",\n\t\"return\",\n\t\"struct\",\n\t\"switch\",\n\t\"true\",\n\t\"var\",\n\t\"while\",\n\t\"NULL\",\n\t\"Self\",\n\t\"abstract\",\n\t\"active\",\n\t\"alignas\",\n\t\"alignof\",\n\t\"as\",\n\t\"asm\",\n\t\"asm_fragment\",\n\t\"async\",\n\t\"attribute\",\n\t\"auto\",\n\t\"await\",\n\t\"become\",\n\t\"cast\",\n\t\"catch\",\n\t\"class\",\n\t\"co_await\",\n\t\"co_return\",\n\t\"co_yield\",\n\t\"coherent\",\n\t\"column_major\",\n\t\"common\",\n\t\"compile\",\n\t\"compile_fragment\",\n\t\"concept\",\n\t\"const_cast\",\n\t\"consteval\",\n\t\"constexpr\",\n\t\"constinit\",\n\t\"crate\",\n\t\"debugger\",\n\t\"decltype\",\n\t\"delete\",\n\t\"demote\",\n\t\"demote_to_helper\",\n\t\"do\",\n\t\"dynamic_cast\",\n\t\"enum\",\n\t\"explicit\",\n\t\"export\",\n\t\"extends\",\n\t\"extern\",\n\t\"external\",\n\t\"fallthrough\",\n\t\"filter\",\n\t\"final\",\n\t\"finally\",\n\t\"friend\",\n\t\"from\",\n\t\"fxgroup\",\n\t\"get\",\n\t\"goto\",\n\t\"groupshared\",\n\t\"highp\",\n\t\"impl\",\n\t\"implements\",\n\t\"import\",\n\t\"inline\",\n\t\"instanceof\",\n\t\"interface\",\n\t\"layout\",\n\t\"lowp\",\n\t\"macro\",\n\t\"macro_rules\",\n\t\"match\",\n\t\"mediump\",\n\t\"meta\",\n\t\"mod\",\n\t\"module\",\n\t\"move\",\n\t\"mut\",\n\t\"mutable\",\n\t\"namespace\",\n\t\"new\",\n\t\"nil\",\n\t\"noexcept\",\n\t\"noinline\",\n\t\"nointerpolation\",\n\t\"non_coherent\",\n\t\"noncoherent\",\n\t\"noperspective\",\n\t\"null\",\n\t\"nullptr\",\n\t\"of\",\n\t\"operator\",\n\t\"package\",\n\t\"packoffset\",\n\t\"partition\",\n\t\"pass\",\n\t\"patch\",\n\t\"pixelfragment\",\n\t\"precise\",\n\t\"precision\",\n\t\"premerge\",\n\t\"priv\",\n\t\"protected\",\n\t\"pub\",\n\t\"public\",\n\t\"readonly\",\n\t\"ref\",\n\t\"regardless\",\n\t\"register\",\n\t\"reinterpret_cast\",\n\t\"require\",\n\t\"resource\",\n\t\"restrict\",\n\t\"self\",\n\t\"set\",\n\t\"shared\",\n\t\"sizeof\",\n\t\"smooth\",\n\t\"snorm\",\n\t\"static\",\n\t\"static_assert\",\n\t\"static_cast\",\n\t\"std\",\n\t\"subroutine\",\n\t\"super\",\n\t\"target\",\n\t\"template\",\n\t\"this\",\n\t\"thread_local\",\n\t\"throw\",\n\t\"trait\",\n\t\"try\",\n\t\"type\",\n\t\"typedef\",\n\t\"typeid\",\n\t\"typename\",\n\t\"typeof\",\n\t\"union\",\n\t\"unless\",\n\t\"unorm\",\n\t\"unsafe\",\n\t\"unsized\",\n\t\"use\",\n\t\"using\",\n\t\"varying\",\n\t\"virtual\",\n\t\"volatile\",\n\t\"wgsl\",\n\t\"where\",\n\t\"with\",\n\t\"writeonly\",\n\t\"yield\",\n\t\"sampler\",\n\t\"uniform\",\n\t\"storage\"\n]);\nconst builtins = new Set([\n\t\"array\",\n\t\"bool\",\n\t\"f16\",\n\t\"f32\",\n\t\"i32\",\n\t\"u32\",\n\t\"mat2x2\",\n\t\"mat2x3\",\n\t\"mat2x4\",\n\t\"mat3x2\",\n\t\"mat3x3\",\n\t\"mat3x4\",\n\t\"mat4x2\",\n\t\"mat4x3\",\n\t\"mat4x4\",\n\t\"vec2\",\n\t\"vec3\",\n\t\"vec4\",\n\t\"bitcast\",\n\t\"all\",\n\t\"any\",\n\t\"select\",\n\t\"arrayLength\",\n\t\"abs\",\n\t\"acos\",\n\t\"acosh\",\n\t\"asin\",\n\t\"asinh\",\n\t\"atan\",\n\t\"atanh\",\n\t\"atan2\",\n\t\"ceil\",\n\t\"clamp\",\n\t\"cos\",\n\t\"cosh\",\n\t\"countLeadingZeros\",\n\t\"countOneBits\",\n\t\"countTrailingZeros\",\n\t\"cross\",\n\t\"degrees\",\n\t\"determinant\",\n\t\"distance\",\n\t\"dot\",\n\t\"dot4U8Packed\",\n\t\"dot4I8Packed\",\n\t\"exp\",\n\t\"exp2\",\n\t\"extractBits\",\n\t\"faceForward\",\n\t\"firstLeadingBit\",\n\t\"firstTrailingBit\",\n\t\"floor\",\n\t\"fma\",\n\t\"fract\",\n\t\"frexp\",\n\t\"insertBits\",\n\t\"inverseSqrt\",\n\t\"ldexp\",\n\t\"length\",\n\t\"log\",\n\t\"log2\",\n\t\"max\",\n\t\"min\",\n\t\"mix\",\n\t\"modf\",\n\t\"normalize\",\n\t\"pow\",\n\t\"quantizeToF16\",\n\t\"radians\",\n\t\"reflect\",\n\t\"refract\",\n\t\"reverseBits\",\n\t\"round\",\n\t\"saturate\",\n\t\"sign\",\n\t\"sin\",\n\t\"sinh\",\n\t\"smoothstep\",\n\t\"sqrt\",\n\t\"step\",\n\t\"tan\",\n\t\"tanh\",\n\t\"transpose\",\n\t\"trunc\",\n\t\"dpdx\",\n\t\"dpdxCoarse\",\n\t\"dpdxFine\",\n\t\"dpdy\",\n\t\"dpdyCoarse\",\n\t\"dpdyFine\",\n\t\"fwidth\",\n\t\"fwidthCoarse\",\n\t\"fwidthFine\",\n\t\"textureDimensions\",\n\t\"textureGather\",\n\t\"textureGatherCompare\",\n\t\"textureLoad\",\n\t\"textureNumLayers\",\n\t\"textureNumLevels\",\n\t\"textureNumSamples\",\n\t\"textureSample\",\n\t\"textureSampleBias\",\n\t\"textureSampleCompare\",\n\t\"textureSampleCompareLevel\",\n\t\"textureSampleGrad\",\n\t\"textureSampleLevel\",\n\t\"textureSampleBaseClampToEdge\",\n\t\"textureStore\",\n\t\"atomicLoad\",\n\t\"atomicStore\",\n\t\"atomicAdd\",\n\t\"atomicSub\",\n\t\"atomicMax\",\n\t\"atomicMin\",\n\t\"atomicAnd\",\n\t\"atomicOr\",\n\t\"atomicXor\",\n\t\"atomicExchange\",\n\t\"atomicCompareExchangeWeak\",\n\t\"pack4x8snorm\",\n\t\"pack4x8unorm\",\n\t\"pack4xI8\",\n\t\"pack4xU8\",\n\t\"pack4xI8Clamp\",\n\t\"pack4xU8Clamp\",\n\t\"pack2x16snorm\",\n\t\"pack2x16unorm\",\n\t\"pack2x16float\",\n\t\"unpack4x8snorm\",\n\t\"unpack4x8unorm\",\n\t\"unpack4xI8\",\n\t\"unpack4xU8\",\n\t\"unpack2x16snorm\",\n\t\"unpack2x16unorm\",\n\t\"unpack2x16float\",\n\t\"storageBarrier\",\n\t\"textureBarrier\",\n\t\"workgroupBarrier\",\n\t\"workgroupUniformLoad\",\n\t\"subgroupAdd\",\n\t\"subgroupExclusiveAdd\",\n\t\"subgroupInclusiveAdd\",\n\t\"subgroupAll\",\n\t\"subgroupAnd\",\n\t\"subgroupAny\",\n\t\"subgroupBallot\",\n\t\"subgroupBroadcast\",\n\t\"subgroupBroadcastFirst\",\n\t\"subgroupElect\",\n\t\"subgroupMax\",\n\t\"subgroupMin\",\n\t\"subgroupMul\",\n\t\"subgroupExclusiveMul\",\n\t\"subgroupInclusiveMul\",\n\t\"subgroupOr\",\n\t\"subgroupShuffle\",\n\t\"subgroupShuffleDown\",\n\t\"subgroupShuffleUp\",\n\t\"subgroupShuffleXor\",\n\t\"subgroupXor\",\n\t\"quadBroadcast\",\n\t\"quadSwapDiagonal\",\n\t\"quadSwapX\",\n\t\"quadSwapY\"\n]);\nfunction sanitizePrimer(primer) {\n\tif (primer) return primer.replaceAll(/\\s/g, \"_\").replaceAll(/[^\\w\\d]/g, \"\");\n\treturn \"item\";\n}\n/**\n* A function for checking whether an identifier needs renaming.\n* Throws if provided with an invalid identifier that cannot be easily renamed.\n* @example\n* isValidIdentifier(\"ident\"); // true\n* isValidIdentifier(\"struct\"); // false\n* isValidIdentifier(\"struct_1\"); // false\n* isValidIdentifier(\"_\"); // ERROR\n* isValidIdentifier(\"my variable\"); // ERROR\n*/\nfunction isValidIdentifier(ident) {\n\tif (ident === \"_\" || ident.startsWith(\"__\") || /\\s/.test(ident)) throw new Error(`Invalid identifier '${ident}'. Choose an identifier without whitespaces or leading underscores.`);\n\tconst prefix = ident.split(\"_\")[0];\n\treturn !bannedTokens.has(prefix) && !builtins.has(prefix);\n}\n/**\n* Same as `isValidIdentifier`, except does not check for builtin clashes.\n*/\nfunction isValidProp(ident) {\n\tif (ident === \"_\" || ident.startsWith(\"__\") || /\\s/.test(ident)) throw new Error(`Invalid identifier '${ident}'. Choose an identifier without whitespaces or leading underscores.`);\n\tconst prefix = ident.split(\"_\")[0];\n\treturn !bannedTokens.has(prefix);\n}\nvar NameRegistryImpl = class {\n\t#usedNames;\n\t#scopeStack;\n\tconstructor() {\n\t\tthis.#usedNames = new Set([...bannedTokens, ...builtins]);\n\t\tthis.#scopeStack = [];\n\t}\n\tget #usedBlockScopeNames() {\n\t\treturn this.#scopeStack[this.#scopeStack.length - 1]?.usedBlockScopeNames;\n\t}\n\tmakeUnique(primer, global) {\n\t\tconst sanitizedPrimer = sanitizePrimer(primer);\n\t\tconst name = this.getUniqueVariant(sanitizedPrimer);\n\t\tif (global) this.#usedNames.add(name);\n\t\telse this.#usedBlockScopeNames?.add(name);\n\t\treturn name;\n\t}\n\t#isUsedInBlocksBefore(name) {\n\t\tconst functionScopeIndex = this.#scopeStack.findLastIndex((scope) => scope.type === \"functionScope\");\n\t\treturn this.#scopeStack.slice(functionScopeIndex + 1).some((scope) => scope.usedBlockScopeNames.has(name));\n\t}\n\tmakeValid(primer) {\n\t\tif (isValidIdentifier(primer) && !this.#usedNames.has(primer) && !this.#isUsedInBlocksBefore(primer)) {\n\t\t\tthis.#usedBlockScopeNames?.add(primer);\n\t\t\treturn primer;\n\t\t}\n\t\treturn this.makeUnique(primer, false);\n\t}\n\tisUsed(name) {\n\t\treturn this.#usedNames.has(name) || this.#isUsedInBlocksBefore(name);\n\t}\n\tpushFunctionScope() {\n\t\tthis.#scopeStack.push({ type: \"functionScope\" });\n\t\tthis.#scopeStack.push({\n\t\t\ttype: \"blockScope\",\n\t\t\tusedBlockScopeNames: /* @__PURE__ */ new Set()\n\t\t});\n\t}\n\tpopFunctionScope() {\n\t\tconst functionScopeIndex = this.#scopeStack.findLastIndex((scope) => scope.type === \"functionScope\");\n\t\tif (functionScopeIndex === -1) throw new Error(\"Tried to pop function scope when no scope was present.\");\n\t\tthis.#scopeStack.splice(functionScopeIndex);\n\t}\n\tpushBlockScope() {\n\t\tthis.#scopeStack.push({\n\t\t\ttype: \"blockScope\",\n\t\t\tusedBlockScopeNames: /* @__PURE__ */ new Set()\n\t\t});\n\t}\n\tpopBlockScope() {\n\t\tinvariant(this.#scopeStack[this.#scopeStack.length - 1]?.type === \"blockScope\", \"Tried to pop block scope, but it is not present\");\n\t\tthis.#scopeStack.pop();\n\t}\n};\nvar RandomNameRegistry = class extends NameRegistryImpl {\n\t#lastUniqueId = 0;\n\tgetUniqueVariant(base) {\n\t\tlet name = `${base}_${this.#lastUniqueId++}`;\n\t\twhile (this.isUsed(name)) name = `${base}_${this.#lastUniqueId++}`;\n\t\treturn name;\n\t}\n};\nvar StrictNameRegistry = class extends NameRegistryImpl {\n\tgetUniqueVariant(base) {\n\t\tlet index = 0;\n\t\tlet name = base;\n\t\twhile (this.isUsed(name)) {\n\t\t\tindex++;\n\t\t\tname = `${base}_${index}`;\n\t\t}\n\t\treturn name;\n\t}\n};\n\n//#endregion\nexport { RandomNameRegistry, StrictNameRegistry, isValidProp };","import { $internal } from \"../shared/symbols.js\";\nimport { getName, setName } from \"../shared/meta.js\";\nimport { schemaCallWrapper } from \"./schemaCallWrapper.js\";\nimport { isValidProp } from \"../nameRegistry.js\";\n\n//#region src/data/struct.ts\n/**\n* Creates a struct schema that can be used to construct GPU buffers.\n* Ensures proper alignment and padding of properties (as opposed to a `d.unstruct` schema).\n* The order of members matches the passed in properties object.\n*\n* @example\n* const CircleStruct = d.struct({ radius: d.f32, pos: d.vec3f });\n*\n* @param props Record with `string` keys and `TgpuData` values,\n* each entry describing one struct member.\n*/\nfunction struct(props) {\n\treturn INTERNAL_createStruct(props, false);\n}\nfunction abstruct(props) {\n\treturn INTERNAL_createStruct(props, true);\n}\nfunction INTERNAL_createStruct(props, isAbstruct) {\n\tObject.keys(props).forEach((key) => {\n\t\tif (!isValidProp(key)) throw new Error(`Property key '${key}' is a reserved WGSL word. Choose a different name.`);\n\t});\n\tconst structSchema = (instanceProps) => Object.fromEntries(Object.entries(props).map(([key, schema]) => [key, schemaCallWrapper(schema, instanceProps?.[key])]));\n\tObject.setPrototypeOf(structSchema, WgslStructImpl);\n\tstructSchema.propTypes = props;\n\tObject.defineProperty(structSchema, $internal, { value: { isAbstruct } });\n\treturn structSchema;\n}\nconst WgslStructImpl = {\n\ttype: \"struct\",\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t},\n\ttoString() {\n\t\treturn `struct:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\n\n//#endregion\nexport { INTERNAL_createStruct, abstruct, struct };","import { isVoid } from \"../../data/wgslTypes.js\";\nimport { getCustomLocation, isData } from \"../../data/dataTypes.js\";\nimport { isBuiltin, location } from \"../../data/attributes.js\";\nimport { INTERNAL_createStruct } from \"../../data/struct.js\";\n\n//#region src/core/function/ioSchema.ts\nfunction withLocations(members, locations = {}) {\n\tlet nextLocation = 0;\n\tconst usedCustomLocations = /* @__PURE__ */ new Set();\n\treturn Object.fromEntries(Object.entries(members ?? {}).map(([key, member]) => {\n\t\tconst customLocation = getCustomLocation(member);\n\t\tif (customLocation !== void 0) {\n\t\t\tif (usedCustomLocations.has(customLocation)) throw new Error(\"Duplicate custom location attributes found\");\n\t\t\tusedCustomLocations.add(customLocation);\n\t\t}\n\t\treturn [key, member];\n\t}).map(([key, member]) => {\n\t\tif (isBuiltin(member)) return [key, member];\n\t\tif (getCustomLocation(member) !== void 0) return [key, member];\n\t\tif (locations[key]) return [key, location(locations[key], member)];\n\t\twhile (usedCustomLocations.has(nextLocation)) nextLocation++;\n\t\treturn [key, location(nextLocation++, member)];\n\t}));\n}\nfunction createIoSchema(layout, locations = {}) {\n\treturn isData(layout) ? isVoid(layout) ? layout : isBuiltin(layout) ? layout : getCustomLocation(layout) !== void 0 ? layout : location(0, layout) : INTERNAL_createStruct(withLocations(layout, locations), false);\n}\n\n//#endregion\nexport { createIoSchema };","import { $internal, $resolve } from \"../shared/symbols.js\";\nimport { getName, setName } from \"../shared/meta.js\";\nimport { isValidProp } from \"../nameRegistry.js\";\nimport { createIoSchema } from \"../core/function/ioSchema.js\";\n\n//#region src/data/autoStruct.ts\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*/\nvar AutoStruct = class {\n\t/**\n\t* js key -> data type\n\t*/\n\t#validProps;\n\t/**\n\t* js key -> { prop: 'wgsl key', type: ... }\n\t* @example '$position' -> { prop: 'position', type: ... }\n\t*/\n\t#allocated;\n\t#usedWgslKeys;\n\t#locations;\n\t#cachedStruct;\n\t#typeForExtraProps;\n\tconstructor(validProps, typeForExtraProps, locations) {\n\t\tthis.#validProps = validProps;\n\t\tthis.#typeForExtraProps = typeForExtraProps;\n\t\tthis.#allocated = {};\n\t\tthis.#locations = locations;\n\t\tthis.#usedWgslKeys = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Used for accessing builtins, varying and attributes in code.\n\t*/\n\taccessProp(key) {\n\t\tconst dataType = this.#validProps[key] ?? this.#typeForExtraProps;\n\t\tif (!dataType) return;\n\t\treturn this.provideProp(key, dataType);\n\t}\n\t/**\n\t* Used for providing new varyings.\n\t*\n\t* @privateRemarks\n\t* Internally used by `accessProp`.\n\t*/\n\tprovideProp(key, dataType) {\n\t\tlet alloc = this.#allocated[key];\n\t\tif (!alloc) {\n\t\t\tconst wgslKey = key.replaceAll(\"$\", \"\");\n\t\t\tif (this.#usedWgslKeys.has(wgslKey)) throw new Error(`Property name '${wgslKey}' causes naming clashes. Choose a different name.`);\n\t\t\tif (!isValidProp(wgslKey)) throw new Error(`Property key '${key}' is a reserved WGSL word. Choose a different name.`);\n\t\t\tthis.#usedWgslKeys.add(wgslKey);\n\t\t\talloc = {\n\t\t\t\tprop: wgslKey,\n\t\t\t\ttype: dataType\n\t\t\t};\n\t\t\tthis.#allocated[key] = alloc;\n\t\t}\n\t\treturn alloc;\n\t}\n\tget completeStruct() {\n\t\tif (!this.#cachedStruct) {\n\t\t\tthis.#cachedStruct = createIoSchema(Object.fromEntries(Object.values(this.#allocated).map((alloc) => {\n\t\t\t\treturn [alloc.prop, alloc.type];\n\t\t\t})), this.#locations);\n\t\t\tconst ownName = getName(this);\n\t\t\tif (ownName) setName(this.#cachedStruct, ownName);\n\t\t}\n\t\treturn this.#cachedStruct;\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.resolve(this.completeStruct);\n\t}\n\ttoString() {\n\t\treturn `auto-struct:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\nAutoStruct.prototype[$internal] = {};\nAutoStruct.prototype.type = \"auto-struct\";\n\n//#endregion\nexport { AutoStruct };","import { $internal, $resolve } from \"../shared/symbols.js\";\nimport { isVec } from \"./wgslTypes.js\";\nimport { snip } from \"./snippet.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { callableSchema } from \"../core/function/createCallableSchema.js\";\nimport { f32 } from \"./numeric.js\";\nimport { vec2f, vec3f, vec4f } from \"./vector.js\";\nimport { dualImpl } from \"../core/function/dualImpl.js\";\nimport { comptime } from \"../core/function/comptime.js\";\n\n//#region src/data/matrix.ts\nvar MatBase = class {};\nfunction createMatSchema(options) {\n\tconst construct = callableSchema({\n\t\tname: options.type,\n\t\tnormalImpl: (...args) => {\n\t\t\tconst elements = [];\n\t\t\tfor (const arg of args) if (typeof arg === \"number\") elements.push(arg);\n\t\t\telse for (let i = 0; i < arg.length; ++i) elements.push(arg[i]);\n\t\t\tif (elements.length !== 0 && elements.length !== options.columns * options.rows) throw new Error(`'${options.type}' constructor called with invalid number of arguments.`);\n\t\t\tfor (let i = elements.length; i < options.columns * options.rows; ++i) elements.push(0);\n\t\t\treturn new options.MatImpl(...elements);\n\t\t},\n\t\tsignature: (...args) => ({\n\t\t\targTypes: args.map((arg) => isVec(arg) ? arg : f32),\n\t\t\treturnType: schema\n\t\t}),\n\t\tcodegenImpl: (_ctx, args) => stitch`${options.type}(${args})`\n\t});\n\tconst schema = Object.assign(construct, {\n\t\t[$internal]: {},\n\t\ttype: options.type,\n\t\tprimitive: f32,\n\t\tidentity: identityFunctions[options.columns],\n\t\ttranslation: options.columns === 4 ? translation4 : void 0,\n\t\tscaling: options.columns === 4 ? scaling4 : void 0,\n\t\trotationX: options.columns === 4 ? rotationX4 : void 0,\n\t\trotationY: options.columns === 4 ? rotationY4 : void 0,\n\t\trotationZ: options.columns === 4 ? rotationZ4 : void 0\n\t});\n\toptions.MatImpl.prototype.schema = schema;\n\treturn schema;\n}\nvar mat2x2Impl = class extends MatBase {\n\t[$internal] = true;\n\tcolumns;\n\tlength = 4;\n\tconstructor(...elements) {\n\t\tsuper();\n\t\tthis.columns = [this.makeColumn(elements[0], elements[1]), this.makeColumn(elements[2], elements[3])];\n\t}\n\tget 0() {\n\t\treturn this.columns[0].x;\n\t}\n\tget 1() {\n\t\treturn this.columns[0].y;\n\t}\n\tget 2() {\n\t\treturn this.columns[1].x;\n\t}\n\tget 3() {\n\t\treturn this.columns[1].y;\n\t}\n\tset 0(value) {\n\t\tthis.columns[0].x = value;\n\t}\n\tset 1(value) {\n\t\tthis.columns[0].y = value;\n\t}\n\tset 2(value) {\n\t\tthis.columns[1].x = value;\n\t}\n\tset 3(value) {\n\t\tthis.columns[1].y = value;\n\t}\n\t*[Symbol.iterator]() {\n\t\tyield this[0];\n\t\tyield this[1];\n\t\tyield this[2];\n\t\tyield this[3];\n\t}\n\t[$resolve]() {\n\t\treturn snip(`${this.kind}(${Array.from({ length: this.length }).map((_, i) => this[i]).join(\", \")})`, mat2x2f, \"runtime\");\n\t}\n\ttoString() {\n\t\treturn this[$resolve]().value;\n\t}\n};\nvar mat2x2fImpl = class extends mat2x2Impl {\n\tkind = \"mat2x2f\";\n\tmakeColumn(e0, e1) {\n\t\treturn vec2f(e0, e1);\n\t}\n};\nvar mat3x3Impl = class extends MatBase {\n\t[$internal] = true;\n\tcolumns;\n\tlength = 12;\n\tconstructor(...elements) {\n\t\tsuper();\n\t\tthis.columns = [\n\t\t\tthis.makeColumn(elements[0], elements[1], elements[2]),\n\t\t\tthis.makeColumn(elements[3], elements[4], elements[5]),\n\t\t\tthis.makeColumn(elements[6], elements[7], elements[8])\n\t\t];\n\t}\n\tget 0() {\n\t\treturn this.columns[0].x;\n\t}\n\tget 1() {\n\t\treturn this.columns[0].y;\n\t}\n\tget 2() {\n\t\treturn this.columns[0].z;\n\t}\n\tget 3() {\n\t\treturn 0;\n\t}\n\tget 4() {\n\t\treturn this.columns[1].x;\n\t}\n\tget 5() {\n\t\treturn this.columns[1].y;\n\t}\n\tget 6() {\n\t\treturn this.columns[1].z;\n\t}\n\tget 7() {\n\t\treturn 0;\n\t}\n\tget 8() {\n\t\treturn this.columns[2].x;\n\t}\n\tget 9() {\n\t\treturn this.columns[2].y;\n\t}\n\tget 10() {\n\t\treturn this.columns[2].z;\n\t}\n\tget 11() {\n\t\treturn 0;\n\t}\n\tset 0(value) {\n\t\tthis.columns[0].x = value;\n\t}\n\tset 1(value) {\n\t\tthis.columns[0].y = value;\n\t}\n\tset 2(value) {\n\t\tthis.columns[0].z = value;\n\t}\n\tset 3(_) {}\n\tset 4(value) {\n\t\tthis.columns[1].x = value;\n\t}\n\tset 5(value) {\n\t\tthis.columns[1].y = value;\n\t}\n\tset 6(value) {\n\t\tthis.columns[1].z = value;\n\t}\n\tset 7(_) {}\n\tset 8(value) {\n\t\tthis.columns[2].x = value;\n\t}\n\tset 9(value) {\n\t\tthis.columns[2].y = value;\n\t}\n\tset 10(value) {\n\t\tthis.columns[2].z = value;\n\t}\n\tset 11(_) {}\n\t*[Symbol.iterator]() {\n\t\tfor (let i = 0; i < 12; i++) yield this[i];\n\t}\n\t[$resolve]() {\n\t\treturn snip(`${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`, mat3x3f, \"runtime\");\n\t}\n\ttoString() {\n\t\treturn this[$resolve]().value;\n\t}\n};\nvar mat3x3fImpl = class extends mat3x3Impl {\n\tkind = \"mat3x3f\";\n\tmakeColumn(x, y, z) {\n\t\treturn vec3f(x, y, z);\n\t}\n};\nvar mat4x4Impl = class extends MatBase {\n\t[$internal] = true;\n\tcolumns;\n\tconstructor(...elements) {\n\t\tsuper();\n\t\tthis.columns = [\n\t\t\tthis.makeColumn(elements[0], elements[1], elements[2], elements[3]),\n\t\t\tthis.makeColumn(elements[4], elements[5], elements[6], elements[7]),\n\t\t\tthis.makeColumn(elements[8], elements[9], elements[10], elements[11]),\n\t\t\tthis.makeColumn(elements[12], elements[13], elements[14], elements[15])\n\t\t];\n\t}\n\tlength = 16;\n\tget 0() {\n\t\treturn this.columns[0].x;\n\t}\n\tget 1() {\n\t\treturn this.columns[0].y;\n\t}\n\tget 2() {\n\t\treturn this.columns[0].z;\n\t}\n\tget 3() {\n\t\treturn this.columns[0].w;\n\t}\n\tget 4() {\n\t\treturn this.columns[1].x;\n\t}\n\tget 5() {\n\t\treturn this.columns[1].y;\n\t}\n\tget 6() {\n\t\treturn this.columns[1].z;\n\t}\n\tget 7() {\n\t\treturn this.columns[1].w;\n\t}\n\tget 8() {\n\t\treturn this.columns[2].x;\n\t}\n\tget 9() {\n\t\treturn this.columns[2].y;\n\t}\n\tget 10() {\n\t\treturn this.columns[2].z;\n\t}\n\tget 11() {\n\t\treturn this.columns[2].w;\n\t}\n\tget 12() {\n\t\treturn this.columns[3].x;\n\t}\n\tget 13() {\n\t\treturn this.columns[3].y;\n\t}\n\tget 14() {\n\t\treturn this.columns[3].z;\n\t}\n\tget 15() {\n\t\treturn this.columns[3].w;\n\t}\n\tset 0(value) {\n\t\tthis.columns[0].x = value;\n\t}\n\tset 1(value) {\n\t\tthis.columns[0].y = value;\n\t}\n\tset 2(value) {\n\t\tthis.columns[0].z = value;\n\t}\n\tset 3(value) {\n\t\tthis.columns[0].w = value;\n\t}\n\tset 4(value) {\n\t\tthis.columns[1].x = value;\n\t}\n\tset 5(value) {\n\t\tthis.columns[1].y = value;\n\t}\n\tset 6(value) {\n\t\tthis.columns[1].z = value;\n\t}\n\tset 7(value) {\n\t\tthis.columns[1].w = value;\n\t}\n\tset 8(value) {\n\t\tthis.columns[2].x = value;\n\t}\n\tset 9(value) {\n\t\tthis.columns[2].y = value;\n\t}\n\tset 10(value) {\n\t\tthis.columns[2].z = value;\n\t}\n\tset 11(value) {\n\t\tthis.columns[2].w = value;\n\t}\n\tset 12(value) {\n\t\tthis.columns[3].x = value;\n\t}\n\tset 13(value) {\n\t\tthis.columns[3].y = value;\n\t}\n\tset 14(value) {\n\t\tthis.columns[3].z = value;\n\t}\n\tset 15(value) {\n\t\tthis.columns[3].w = value;\n\t}\n\t*[Symbol.iterator]() {\n\t\tfor (let i = 0; i < 16; i++) yield this[i];\n\t}\n\t[$resolve]() {\n\t\treturn snip(`${this.kind}(${Array.from({ length: this.length }).map((_, i) => this[i]).join(\", \")})`, mat4x4f, \"runtime\");\n\t}\n\ttoString() {\n\t\treturn this[$resolve]().value;\n\t}\n};\nvar mat4x4fImpl = class extends mat4x4Impl {\n\tkind = \"mat4x4f\";\n\tmakeColumn(x, y, z, w) {\n\t\treturn vec4f(x, y, z, w);\n\t}\n};\n/**\n* Returns a 2-by-2 identity matrix.\n* @returns {m2x2f} The result matrix.\n*/\nconst identity2 = comptime(() => mat2x2f(1, 0, 0, 1)).$name(\"identity2\");\n/**\n* Returns a 3-by-3 identity matrix.\n* @returns {m3x3f} The result matrix.\n*/\nconst identity3 = comptime(() => mat3x3f(1, 0, 0, 0, 1, 0, 0, 0, 1)).$name(\"identity3\");\n/**\n* Returns a 4-by-4 identity matrix.\n* @returns {m4x4f} The result matrix.\n*/\nconst identity4 = comptime(() => mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)).$name(\"identity4\");\nconst identityFunctions = {\n\t2: identity2,\n\t3: identity3,\n\t4: identity4\n};\n/**\n* Creates a 4-by-4 matrix which translates by the given vector v.\n* @param {v3f} vector - The vector by which to translate.\n* @returns {m4x4f} The translation matrix.\n*/\nconst translation4 = dualImpl({\n\tname: \"translation4\",\n\tnormalImpl: (vector) => mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, vector.x, vector.y, vector.z, 1),\n\tget signature() {\n\t\treturn {\n\t\t\targTypes: [vec3f],\n\t\t\treturnType: mat4x4f\n\t\t};\n\t},\n\tcodegenImpl: (_ctx, [v]) => stitch`mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ${v}.x, ${v}.y, ${v}.z, 1)`\n});\n/**\n* Creates a 4-by-4 matrix which scales in each dimension by an amount given by the corresponding entry in the given vector.\n* @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.\n* @returns {m4x4f} The scaling matrix.\n*/\nconst scaling4 = dualImpl({\n\tname: \"scaling4\",\n\tnormalImpl: (vector) => mat4x4f(vector.x, 0, 0, 0, 0, vector.y, 0, 0, 0, 0, vector.z, 0, 0, 0, 0, 1),\n\tget signature() {\n\t\treturn {\n\t\t\targTypes: [vec3f],\n\t\t\treturnType: mat4x4f\n\t\t};\n\t},\n\tcodegenImpl: (_ctx, [v]) => stitch`mat4x4f(${v}.x, 0, 0, 0, 0, ${v}.y, 0, 0, 0, 0, ${v}.z, 0, 0, 0, 0, 1)`\n});\n/**\n* Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n* @param {number} angle - The angle by which to rotate (in radians).\n* @returns {m4x4f} The rotation matrix.\n*/\nconst rotationX4 = dualImpl({\n\tname: \"rotationX4\",\n\tnormalImpl: (a) => mat4x4f(1, 0, 0, 0, 0, Math.cos(a), Math.sin(a), 0, 0, -Math.sin(a), Math.cos(a), 0, 0, 0, 0, 1),\n\tget signature() {\n\t\treturn {\n\t\t\targTypes: [f32],\n\t\t\treturnType: mat4x4f\n\t\t};\n\t},\n\tcodegenImpl: (_ctx, [a]) => stitch`mat4x4f(1, 0, 0, 0, 0, cos(${a}), sin(${a}), 0, 0, -sin(${a}), cos(${a}), 0, 0, 0, 0, 1)`\n});\n/**\n* Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n* @param {number} angle - The angle by which to rotate (in radians).\n* @returns {m4x4f} The rotation matrix.\n*/\nconst rotationY4 = dualImpl({\n\tname: \"rotationY4\",\n\tnormalImpl: (a) => mat4x4f(Math.cos(a), 0, -Math.sin(a), 0, 0, 1, 0, 0, Math.sin(a), 0, Math.cos(a), 0, 0, 0, 0, 1),\n\tget signature() {\n\t\treturn {\n\t\t\targTypes: [f32],\n\t\t\treturnType: mat4x4f\n\t\t};\n\t},\n\tcodegenImpl: (_ctx, [a]) => stitch`mat4x4f(cos(${a}), 0, -sin(${a}), 0, 0, 1, 0, 0, sin(${a}), 0, cos(${a}), 0, 0, 0, 0, 1)`\n});\n/**\n* Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n* @param {number} angle - The angle by which to rotate (in radians).\n* @returns {m4x4f} The rotation matrix.\n*/\nconst rotationZ4 = dualImpl({\n\tname: \"rotationZ4\",\n\tnormalImpl: (a) => mat4x4f(Math.cos(a), Math.sin(a), 0, 0, -Math.sin(a), Math.cos(a), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),\n\tget signature() {\n\t\treturn {\n\t\t\targTypes: [f32],\n\t\t\treturnType: mat4x4f\n\t\t};\n\t},\n\tcodegenImpl: (_ctx, [a]) => stitch`mat4x4f(cos(${a}), sin(${a}), 0, 0, -sin(${a}), cos(${a}), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)`\n});\n/**\n* Schema representing mat2x2f - a matrix with 2 rows and 2 columns, with elements of type f32.\n* Also a constructor function for this matrix type.\n*\n* @example\n* const zero2x2 = mat2x2f(); // filled with zeros\n*\n* @example\n* const mat = mat2x2f(0, 1, 2, 3);\n* mat.columns[0] // vec2f(0, 1)\n* mat.columns[1] // vec2f(2, 3)\n*\n* @example\n* const mat = mat2x2f(\n* vec2f(0, 1), // column 0\n* vec2f(1, 2), // column 1\n* );\n*\n* @example\n* const buffer = root.createBuffer(d.mat2x2f, d.mat2x2f(0, 1, 2, 3)); // buffer holding a d.mat2x2f value, with an initial value of ((0, 1), (2, 3))\n*/\nconst mat2x2f = createMatSchema({\n\ttype: \"mat2x2f\",\n\trows: 2,\n\tcolumns: 2,\n\tMatImpl: mat2x2fImpl\n});\n/**\n* Schema representing mat3x3f - a matrix with 3 rows and 3 columns, with elements of type f32.\n* Also a constructor function for this matrix type.\n*\n* @example\n* const zero3x3 = mat3x3f(); // filled with zeros\n*\n* @example\n* const mat = mat3x3f(0, 1, 2, 3, 4, 5, 6, 7, 8);\n* mat.columns[0] // vec3f(0, 1, 2)\n* mat.columns[1] // vec3f(3, 4, 5)\n* mat.columns[2] // vec3f(6, 7, 8)\n*\n* @example\n* const mat = mat3x3f(\n* vec3f(0, 1, 2), // column 0\n* vec3f(2, 3, 4), // column 1\n* vec3f(5, 6, 7), // column 2\n* );\n*\n* @example\n* const buffer = root.createBuffer(d.mat3x3f, d.mat3x3f()); // buffer holding a d.mat3x3f value, with an initial value of mat3x3f filled with zeros\n*/\nconst mat3x3f = createMatSchema({\n\ttype: \"mat3x3f\",\n\trows: 3,\n\tcolumns: 3,\n\tMatImpl: mat3x3fImpl\n});\n/**\n* Schema representing mat4x4f - a matrix with 4 rows and 4 columns, with elements of type f32.\n* Also a constructor function for this matrix type.\n*\n* @example\n* const zero4x4 = mat4x4f(); // filled with zeros\n*\n* @example\n* const mat = mat4x4f(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);\n* mat.columns[0] // vec4f(0, 1, 2, 3)\n* mat.columns[1] // vec4f(4, 5, 6, 7)\n* mat.columns[2] // vec4f(8, 9, 10, 11)\n* mat.columns[3] // vec4f(12, 13, 14, 15)\n*\n* @example\n* const mat = mat4x4f(\n* vec4f(0, 1, 2, 3), // column 0\n* vec4f(4, 5, 6, 7), // column 1\n* vec4f(8, 9, 10, 11), // column 2\n* vec4f(12, 13, 14, 15), // column 3\n* );\n*\n* @example\n* const buffer = root.createBuffer(d.mat4x4f, d.mat4x4f()); // buffer holding a d.mat4x4f value, with an initial value of mat4x4f filled with zeros\n*/\nconst mat4x4f = createMatSchema({\n\ttype: \"mat4x4f\",\n\trows: 4,\n\tcolumns: 4,\n\tMatImpl: mat4x4fImpl\n});\nfunction matToArray(mat) {\n\tif (mat.kind === \"mat3x3f\") return [\n\t\tmat[0],\n\t\tmat[1],\n\t\tmat[2],\n\t\tmat[4],\n\t\tmat[5],\n\t\tmat[6],\n\t\tmat[8],\n\t\tmat[9],\n\t\tmat[10]\n\t];\n\treturn Array.from({ length: mat.length }).map((_, idx) => mat[idx]);\n}\n\n//#endregion\nexport { MatBase, identity2, identity3, identity4, mat2x2f, mat3x3f, mat4x4f, matToArray, rotationX4, rotationY4, rotationZ4, scaling4, translation4 };","//#region src/data/numberOps.ts\nconst smoothstepScalar = (edge0, edge1, x) => {\n\tif (edge0 === edge1) return 0;\n\tconst t = clamp((x - edge0) / (edge1 - edge0), 0, 1);\n\treturn t * t * (3 - 2 * t);\n};\nconst clamp = (value, low, high) => Math.min(Math.max(low, value), high);\nconst divInteger = (lhs, rhs) => {\n\tif (rhs === 0) return lhs;\n\treturn Math.trunc(lhs / rhs);\n};\nfunction bitcastU32toF32Impl(n) {\n\tconst dataView = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4));\n\tdataView.setUint32(0, n, true);\n\treturn dataView.getFloat32(0, true);\n}\nfunction bitcastU32toI32Impl(n) {\n\tconst dataView = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4));\n\tdataView.setUint32(0, n, true);\n\treturn dataView.getInt32(0, true);\n}\n\n//#endregion\nexport { bitcastU32toF32Impl, bitcastU32toI32Impl, clamp, divInteger, smoothstepScalar };","import { vec2b as vec2b$1, vec2f as vec2f$1, vec2h as vec2h$1, vec2i as vec2i$1, vec2u as vec2u$1, vec3b as vec3b$1, vec3f as vec3f$1, vec3h as vec3h$1, vec3i as vec3i$1, vec3u as vec3u$1, vec4b as vec4b$1, vec4f as vec4f$1, vec4h as vec4h$1, vec4i as vec4i$1, vec4u as vec4u$1 } from \"./vector.js\";\nimport { mat2x2f, mat3x3f, mat4x4f } from \"./matrix.js\";\nimport { bitcastU32toF32Impl, bitcastU32toI32Impl, clamp, divInteger, smoothstepScalar } from \"./numberOps.js\";\n\n//#region src/data/vectorOps.ts\nconst vec2b = vec2b$1;\nconst vec2f = vec2f$1;\nconst vec2h = vec2h$1;\nconst vec2i = vec2i$1;\nconst vec2u = vec2u$1;\nconst vec3b = vec3b$1;\nconst vec3f = vec3f$1;\nconst vec3h = vec3h$1;\nconst vec3i = vec3i$1;\nconst vec3u = vec3u$1;\nconst vec4b = vec4b$1;\nconst vec4f = vec4f$1;\nconst vec4h = vec4h$1;\nconst vec4i = vec4i$1;\nconst vec4u = vec4u$1;\nconst lengthVec2 = (v) => Math.sqrt(v.x ** 2 + v.y ** 2);\nconst lengthVec3 = (v) => Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2);\nconst lengthVec4 = (v) => Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2 + v.w ** 2);\nconst dotVec2 = (lhs, rhs) => lhs.x * rhs.x + lhs.y * rhs.y;\nconst dotVec3 = (lhs, rhs) => lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z;\nconst dotVec4 = (lhs, rhs) => lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z + lhs.w * rhs.w;\nconst unary2f = (op) => (a) => vec2f(op(a.x), op(a.y));\nconst unary2h = (op) => (a) => vec2h(op(a.x), op(a.y));\nconst unary2i = (op) => (a) => vec2i(op(a.x), op(a.y));\nconst unary2u = (op) => (a) => vec2u(op(a.x), op(a.y));\nconst unary3f = (op) => (a) => vec3f(op(a.x), op(a.y), op(a.z));\nconst unary3h = (op) => (a) => vec3h(op(a.x), op(a.y), op(a.z));\nconst unary3i = (op) => (a) => vec3i(op(a.x), op(a.y), op(a.z));\nconst unary3u = (op) => (a) => vec3u(op(a.x), op(a.y), op(a.z));\nconst unary4f = (op) => (a) => vec4f(op(a.x), op(a.y), op(a.z), op(a.w));\nconst unary4h = (op) => (a) => vec4h(op(a.x), op(a.y), op(a.z), op(a.w));\nconst unary4i = (op) => (a) => vec4i(op(a.x), op(a.y), op(a.z), op(a.w));\nconst unary4u = (op) => (a) => vec4u(op(a.x), op(a.y), op(a.z), op(a.w));\nconst unary2x2f = (op) => (a) => {\n\tconst a_ = a.columns;\n\treturn mat2x2f(unary2f(op)(a_[0]), unary2f(op)(a_[1]));\n};\nconst unary3x3f = (op) => (a) => {\n\tconst a_ = a.columns;\n\treturn mat3x3f(unary3f(op)(a_[0]), unary3f(op)(a_[1]), unary3f(op)(a_[2]));\n};\nconst unary4x4f = (op) => (a) => {\n\tconst a_ = a.columns;\n\treturn mat4x4f(unary4f(op)(a_[0]), unary4f(op)(a_[1]), unary4f(op)(a_[2]), unary4f(op)(a_[3]));\n};\nconst binaryComponentWise2f = (op) => (a, b) => vec2f(op(a.x, b.x), op(a.y, b.y));\nconst binaryComponentWise2h = (op) => (a, b) => vec2h(op(a.x, b.x), op(a.y, b.y));\nconst binaryComponentWise2i = (op) => (a, b) => vec2i(op(a.x, b.x), op(a.y, b.y));\nconst binaryComponentWise2u = (op) => (a, b) => vec2u(op(a.x, b.x), op(a.y, b.y));\nconst binaryComponentWise3f = (op) => (a, b) => vec3f(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\nconst binaryComponentWise3h = (op) => (a, b) => vec3h(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\nconst binaryComponentWise3i = (op) => (a, b) => vec3i(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\nconst binaryComponentWise3u = (op) => (a, b) => vec3u(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));\nconst binaryComponentWise4f = (op) => (a, b) => vec4f(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\nconst binaryComponentWise4h = (op) => (a, b) => vec4h(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\nconst binaryComponentWise4i = (op) => (a, b) => vec4i(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\nconst binaryComponentWise4u = (op) => (a, b) => vec4u(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));\nconst binaryComponentWise2x2f = (op) => (a, b) => {\n\tconst a_ = a.columns;\n\tconst b_ = b.columns;\n\treturn mat2x2f(binaryComponentWise2f(op)(a_[0], b_[0]), binaryComponentWise2f(op)(a_[1], b_[1]));\n};\nconst binaryComponentWise3x3f = (op) => (a, b) => {\n\tconst a_ = a.columns;\n\tconst b_ = b.columns;\n\treturn mat3x3f(binaryComponentWise3f(op)(a_[0], b_[0]), binaryComponentWise3f(op)(a_[1], b_[1]), binaryComponentWise3f(op)(a_[2], b_[2]));\n};\nconst binaryComponentWise4x4f = (op) => (a, b) => {\n\tconst a_ = a.columns;\n\tconst b_ = b.columns;\n\treturn mat4x4f(binaryComponentWise4f(op)(a_[0], b_[0]), binaryComponentWise4f(op)(a_[1], b_[1]), binaryComponentWise4f(op)(a_[2], b_[2]), binaryComponentWise4f(op)(a_[3], b_[3]));\n};\nconst ternaryComponentWise2f = (op) => (a, b, c) => vec2f(op(a.x, b.x, c.x), op(a.y, b.y, c.y));\nconst ternaryComponentWise2h = (op) => (a, b, c) => vec2h(op(a.x, b.x, c.x), op(a.y, b.y, c.y));\nconst ternaryComponentWise3f = (op) => (a, b, c) => vec3f(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z));\nconst ternaryComponentWise3h = (op) => (a, b, c) => vec3h(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z));\nconst ternaryComponentWise4f = (op) => (a, b, c) => vec4f(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w));\nconst ternaryComponentWise4h = (op) => (a, b, c) => vec4h(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w));\nconst VectorOps = {\n\teq: {\n\t\tvec2f: (e1, e2) => vec2b(e1.x === e2.x, e1.y === e2.y),\n\t\tvec2h: (e1, e2) => vec2b(e1.x === e2.x, e1.y === e2.y),\n\t\tvec2i: (e1, e2) => vec2b(e1.x === e2.x, e1.y === e2.y),\n\t\tvec2u: (e1, e2) => vec2b(e1.x === e2.x, e1.y === e2.y),\n\t\t\"vec2<bool>\": (e1, e2) => vec2b(e1.x === e2.x, e1.y === e2.y),\n\t\tvec3f: (e1, e2) => vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n\t\tvec3h: (e1, e2) => vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n\t\tvec3i: (e1, e2) => vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n\t\tvec3u: (e1, e2) => vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n\t\t\"vec3<bool>\": (e1, e2) => vec3b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z),\n\t\tvec4f: (e1, e2) => vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n\t\tvec4h: (e1, e2) => vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n\t\tvec4i: (e1, e2) => vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n\t\tvec4u: (e1, e2) => vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w),\n\t\t\"vec4<bool>\": (e1, e2) => vec4b(e1.x === e2.x, e1.y === e2.y, e1.z === e2.z, e1.w === e2.w)\n\t},\n\tlt: {\n\t\tvec2f: (e1, e2) => vec2b(e1.x < e2.x, e1.y < e2.y),\n\t\tvec2h: (e1, e2) => vec2b(e1.x < e2.x, e1.y < e2.y),\n\t\tvec2i: (e1, e2) => vec2b(e1.x < e2.x, e1.y < e2.y),\n\t\tvec2u: (e1, e2) => vec2b(e1.x < e2.x, e1.y < e2.y),\n\t\tvec3f: (e1, e2) => vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n\t\tvec3h: (e1, e2) => vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n\t\tvec3i: (e1, e2) => vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n\t\tvec3u: (e1, e2) => vec3b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z),\n\t\tvec4f: (e1, e2) => vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n\t\tvec4h: (e1, e2) => vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n\t\tvec4i: (e1, e2) => vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w),\n\t\tvec4u: (e1, e2) => vec4b(e1.x < e2.x, e1.y < e2.y, e1.z < e2.z, e1.w < e2.w)\n\t},\n\tor: {\n\t\t\"vec2<bool>\": (e1, e2) => vec2b(e1.x || e2.x, e1.y || e2.y),\n\t\t\"vec3<bool>\": (e1, e2) => vec3b(e1.x || e2.x, e1.y || e2.y, e1.z || e2.z),\n\t\t\"vec4<bool>\": (e1, e2) => vec4b(e1.x || e2.x, e1.y || e2.y, e1.z || e2.z, e1.w || e2.w)\n\t},\n\tall: {\n\t\t\"vec2<bool>\": (e) => e.x && e.y,\n\t\t\"vec3<bool>\": (e) => e.x && e.y && e.z,\n\t\t\"vec4<bool>\": (e) => e.x && e.y && e.z && e.w\n\t},\n\tabs: {\n\t\tvec2f: unary2f(Math.abs),\n\t\tvec2h: unary2h(Math.abs),\n\t\tvec2i: unary2i(Math.abs),\n\t\tvec2u: unary2u(Math.abs),\n\t\tvec3f: unary3f(Math.abs),\n\t\tvec3h: unary3h(Math.abs),\n\t\tvec3i: unary3i(Math.abs),\n\t\tvec3u: unary3u(Math.abs),\n\t\tvec4f: unary4f(Math.abs),\n\t\tvec4h: unary4h(Math.abs),\n\t\tvec4i: unary4i(Math.abs),\n\t\tvec4u: unary4u(Math.abs)\n\t},\n\tatan2: {\n\t\tvec2f: binaryComponentWise2f(Math.atan2),\n\t\tvec2h: binaryComponentWise2h(Math.atan2),\n\t\tvec3f: binaryComponentWise3f(Math.atan2),\n\t\tvec3h: binaryComponentWise3h(Math.atan2),\n\t\tvec4f: binaryComponentWise4f(Math.atan2),\n\t\tvec4h: binaryComponentWise4h(Math.atan2)\n\t},\n\tacos: {\n\t\tvec2f: unary2f(Math.acos),\n\t\tvec2h: unary2h(Math.acos),\n\t\tvec2i: unary2i(Math.acos),\n\t\tvec2u: unary2u(Math.acos),\n\t\tvec3f: unary3f(Math.acos),\n\t\tvec3h: unary3h(Math.acos),\n\t\tvec3i: unary3i(Math.acos),\n\t\tvec3u: unary3u(Math.acos),\n\t\tvec4f: unary4f(Math.acos),\n\t\tvec4h: unary4h(Math.acos),\n\t\tvec4i: unary4i(Math.acos),\n\t\tvec4u: unary4u(Math.acos)\n\t},\n\tacosh: {\n\t\tvec2f: unary2f(Math.acosh),\n\t\tvec2h: unary2h(Math.acosh),\n\t\tvec3f: unary3f(Math.acosh),\n\t\tvec3h: unary3h(Math.acosh),\n\t\tvec4f: unary4f(Math.acosh),\n\t\tvec4h: unary4h(Math.acosh)\n\t},\n\tasin: {\n\t\tvec2f: unary2f(Math.asin),\n\t\tvec2h: unary2h(Math.asin),\n\t\tvec3f: unary3f(Math.asin),\n\t\tvec3h: unary3h(Math.asin),\n\t\tvec4f: unary4f(Math.asin),\n\t\tvec4h: unary4h(Math.asin)\n\t},\n\tasinh: {\n\t\tvec2f: unary2f(Math.asinh),\n\t\tvec2h: unary2h(Math.asinh),\n\t\tvec3f: unary3f(Math.asinh),\n\t\tvec3h: unary3h(Math.asinh),\n\t\tvec4f: unary4f(Math.asinh),\n\t\tvec4h: unary4h(Math.asinh)\n\t},\n\tatan: {\n\t\tvec2f: unary2f(Math.atan),\n\t\tvec2h: unary2h(Math.atan),\n\t\tvec3f: unary3f(Math.atan),\n\t\tvec3h: unary3h(Math.atan),\n\t\tvec4f: unary4f(Math.atan),\n\t\tvec4h: unary4h(Math.atan)\n\t},\n\tatanh: {\n\t\tvec2f: unary2f(Math.atanh),\n\t\tvec2h: unary2h(Math.atanh),\n\t\tvec3f: unary3f(Math.atanh),\n\t\tvec3h: unary3h(Math.atanh),\n\t\tvec4f: unary4f(Math.atanh),\n\t\tvec4h: unary4h(Math.atanh)\n\t},\n\tceil: {\n\t\tvec2f: unary2f(Math.ceil),\n\t\tvec2h: unary2h(Math.ceil),\n\t\tvec3f: unary3f(Math.ceil),\n\t\tvec3h: unary3h(Math.ceil),\n\t\tvec4f: unary4f(Math.ceil),\n\t\tvec4h: unary4h(Math.ceil)\n\t},\n\tclamp: {\n\t\tvec2f: (v, low, high) => vec2f(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n\t\tvec2h: (v, low, high) => vec2h(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n\t\tvec2i: (v, low, high) => vec2i(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n\t\tvec2u: (v, low, high) => vec2u(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y)),\n\t\tvec3f: (v, low, high) => vec3f(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z)),\n\t\tvec3h: (v, low, high) => vec3h(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z)),\n\t\tvec3i: (v, low, high) => vec3i(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z)),\n\t\tvec3u: (v, low, high) => vec3u(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z)),\n\t\tvec4f: (v, low, high) => vec4f(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z), clamp(v.w, low.w, high.w)),\n\t\tvec4h: (v, low, high) => vec4h(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z), clamp(v.w, low.w, high.w)),\n\t\tvec4i: (v, low, high) => vec4i(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z), clamp(v.w, low.w, high.w)),\n\t\tvec4u: (v, low, high) => vec4u(clamp(v.x, low.x, high.x), clamp(v.y, low.y, high.y), clamp(v.z, low.z, high.z), clamp(v.w, low.w, high.w))\n\t},\n\tlength: {\n\t\tvec2f: lengthVec2,\n\t\tvec2h: lengthVec2,\n\t\tvec3f: lengthVec3,\n\t\tvec3h: lengthVec3,\n\t\tvec4f: lengthVec4,\n\t\tvec4h: lengthVec4\n\t},\n\tadd: {\n\t\tvec2f: binaryComponentWise2f((a, b) => a + b),\n\t\tvec2h: binaryComponentWise2h((a, b) => a + b),\n\t\tvec2i: binaryComponentWise2i((a, b) => a + b),\n\t\tvec2u: binaryComponentWise2u((a, b) => a + b),\n\t\tvec3f: binaryComponentWise3f((a, b) => a + b),\n\t\tvec3h: binaryComponentWise3h((a, b) => a + b),\n\t\tvec3i: binaryComponentWise3i((a, b) => a + b),\n\t\tvec3u: binaryComponentWise3u((a, b) => a + b),\n\t\tvec4f: binaryComponentWise4f((a, b) => a + b),\n\t\tvec4h: binaryComponentWise4h((a, b) => a + b),\n\t\tvec4i: binaryComponentWise4i((a, b) => a + b),\n\t\tvec4u: binaryComponentWise4u((a, b) => a + b),\n\t\tmat2x2f: binaryComponentWise2x2f((a, b) => a + b),\n\t\tmat3x3f: binaryComponentWise3x3f((a, b) => a + b),\n\t\tmat4x4f: binaryComponentWise4x4f((a, b) => a + b)\n\t},\n\tsmoothstep: {\n\t\tvec2f: ternaryComponentWise2f(smoothstepScalar),\n\t\tvec2h: ternaryComponentWise2h(smoothstepScalar),\n\t\tvec3f: ternaryComponentWise3f(smoothstepScalar),\n\t\tvec3h: ternaryComponentWise3h(smoothstepScalar),\n\t\tvec4f: ternaryComponentWise4f(smoothstepScalar),\n\t\tvec4h: ternaryComponentWise4h(smoothstepScalar)\n\t},\n\taddMixed: {\n\t\tvec2f: (a, b) => unary2f((e) => e + b)(a),\n\t\tvec2h: (a, b) => unary2h((e) => e + b)(a),\n\t\tvec2i: (a, b) => unary2i((e) => e + b)(a),\n\t\tvec2u: (a, b) => unary2u((e) => e + b)(a),\n\t\tvec3f: (a, b) => unary3f((e) => e + b)(a),\n\t\tvec3h: (a, b) => unary3h((e) => e + b)(a),\n\t\tvec3i: (a, b) => unary3i((e) => e + b)(a),\n\t\tvec3u: (a, b) => unary3u((e) => e + b)(a),\n\t\tvec4f: (a, b) => unary4f((e) => e + b)(a),\n\t\tvec4h: (a, b) => unary4h((e) => e + b)(a),\n\t\tvec4i: (a, b) => unary4i((e) => e + b)(a),\n\t\tvec4u: (a, b) => unary4u((e) => e + b)(a),\n\t\tmat2x2f: (a, b) => unary2x2f((e) => e + b)(a),\n\t\tmat3x3f: (a, b) => unary3x3f((e) => e + b)(a),\n\t\tmat4x4f: (a, b) => unary4x4f((e) => e + b)(a)\n\t},\n\tmulSxV: {\n\t\tvec2f: (s, v) => unary2f((e) => s * e)(v),\n\t\tvec2h: (s, v) => unary2h((e) => s * e)(v),\n\t\tvec2i: (s, v) => unary2i((e) => s * e)(v),\n\t\tvec2u: (s, v) => unary2u((e) => s * e)(v),\n\t\tvec3f: (s, v) => unary3f((e) => s * e)(v),\n\t\tvec3h: (s, v) => unary3h((e) => s * e)(v),\n\t\tvec3i: (s, v) => unary3i((e) => s * e)(v),\n\t\tvec3u: (s, v) => unary3u((e) => s * e)(v),\n\t\tvec4f: (s, v) => unary4f((e) => s * e)(v),\n\t\tvec4h: (s, v) => unary4h((e) => s * e)(v),\n\t\tvec4i: (s, v) => unary4i((e) => s * e)(v),\n\t\tvec4u: (s, v) => unary4u((e) => s * e)(v),\n\t\tmat2x2f: (s, m) => unary2x2f((e) => s * e)(m),\n\t\tmat3x3f: (s, m) => unary3x3f((e) => s * e)(m),\n\t\tmat4x4f: (s, m) => unary4x4f((e) => s * e)(m)\n\t},\n\tmulVxV: {\n\t\tvec2f: binaryComponentWise2f((a, b) => a * b),\n\t\tvec2h: binaryComponentWise2h((a, b) => a * b),\n\t\tvec2i: binaryComponentWise2i((a, b) => a * b),\n\t\tvec2u: binaryComponentWise2u((a, b) => a * b),\n\t\tvec3f: binaryComponentWise3f((a, b) => a * b),\n\t\tvec3h: binaryComponentWise3h((a, b) => a * b),\n\t\tvec3i: binaryComponentWise3i((a, b) => a * b),\n\t\tvec3u: binaryComponentWise3u((a, b) => a * b),\n\t\tvec4f: binaryComponentWise4f((a, b) => a * b),\n\t\tvec4h: binaryComponentWise4h((a, b) => a * b),\n\t\tvec4i: binaryComponentWise4i((a, b) => a * b),\n\t\tvec4u: binaryComponentWise4u((a, b) => a * b),\n\t\tmat2x2f: (a, b) => {\n\t\t\tconst a_ = a.columns;\n\t\t\tconst b_ = b.columns;\n\t\t\treturn mat2x2f(a_[0].x * b_[0].x + a_[1].x * b_[0].y, a_[0].y * b_[0].x + a_[1].y * b_[0].y, a_[0].x * b_[1].x + a_[1].x * b_[1].y, a_[0].y * b_[1].x + a_[1].y * b_[1].y);\n\t\t},\n\t\tmat3x3f: (a, b) => {\n\t\t\tconst a_ = a.columns;\n\t\t\tconst b_ = b.columns;\n\t\t\treturn mat3x3f(a_[0].x * b_[0].x + a_[1].x * b_[0].y + a_[2].x * b_[0].z, a_[0].y * b_[0].x + a_[1].y * b_[0].y + a_[2].y * b_[0].z, a_[0].z * b_[0].x + a_[1].z * b_[0].y + a_[2].z * b_[0].z, a_[0].x * b_[1].x + a_[1].x * b_[1].y + a_[2].x * b_[1].z, a_[0].y * b_[1].x + a_[1].y * b_[1].y + a_[2].y * b_[1].z, a_[0].z * b_[1].x + a_[1].z * b_[1].y + a_[2].z * b_[1].z, a_[0].x * b_[2].x + a_[1].x * b_[2].y + a_[2].x * b_[2].z, a_[0].y * b_[2].x + a_[1].y * b_[2].y + a_[2].y * b_[2].z, a_[0].z * b_[2].x + a_[1].z * b_[2].y + a_[2].z * b_[2].z);\n\t\t},\n\t\tmat4x4f: (a, b) => {\n\t\t\tconst a_ = a.columns;\n\t\t\tconst b_ = b.columns;\n\t\t\treturn mat4x4f(a_[0].x * b_[0].x + a_[1].x * b_[0].y + a_[2].x * b_[0].z + a_[3].x * b_[0].w, a_[0].y * b_[0].x + a_[1].y * b_[0].y + a_[2].y * b_[0].z + a_[3].y * b_[0].w, a_[0].z * b_[0].x + a_[1].z * b_[0].y + a_[2].z * b_[0].z + a_[3].z * b_[0].w, a_[0].w * b_[0].x + a_[1].w * b_[0].y + a_[2].w * b_[0].z + a_[3].w * b_[0].w, a_[0].x * b_[1].x + a_[1].x * b_[1].y + a_[2].x * b_[1].z + a_[3].x * b_[1].w, a_[0].y * b_[1].x + a_[1].y * b_[1].y + a_[2].y * b_[1].z + a_[3].y * b_[1].w, a_[0].z * b_[1].x + a_[1].z * b_[1].y + a_[2].z * b_[1].z + a_[3].z * b_[1].w, a_[0].w * b_[1].x + a_[1].w * b_[1].y + a_[2].w * b_[1].z + a_[3].w * b_[1].w, a_[0].x * b_[2].x + a_[1].x * b_[2].y + a_[2].x * b_[2].z + a_[3].x * b_[2].w, a_[0].y * b_[2].x + a_[1].y * b_[2].y + a_[2].y * b_[2].z + a_[3].y * b_[2].w, a_[0].z * b_[2].x + a_[1].z * b_[2].y + a_[2].z * b_[2].z + a_[3].z * b_[2].w, a_[0].w * b_[2].x + a_[1].w * b_[2].y + a_[2].w * b_[2].z + a_[3].w * b_[2].w, a_[0].x * b_[3].x + a_[1].x * b_[3].y + a_[2].x * b_[3].z + a_[3].x * b_[3].w, a_[0].y * b_[3].x + a_[1].y * b_[3].y + a_[2].y * b_[3].z + a_[3].y * b_[3].w, a_[0].z * b_[3].x + a_[1].z * b_[3].y + a_[2].z * b_[3].z + a_[3].z * b_[3].w, a_[0].w * b_[3].x + a_[1].w * b_[3].y + a_[2].w * b_[3].z + a_[3].w * b_[3].w);\n\t\t}\n\t},\n\tmulMxV: {\n\t\tmat2x2f: (m, v) => {\n\t\t\tconst m_ = m.columns;\n\t\t\treturn vec2f(m_[0].x * v.x + m_[1].x * v.y, m_[0].y * v.x + m_[1].y * v.y);\n\t\t},\n\t\tmat3x3f: (m, v) => {\n\t\t\tconst m_ = m.columns;\n\t\t\treturn vec3f(m_[0].x * v.x + m_[1].x * v.y + m_[2].x * v.z, m_[0].y * v.x + m_[1].y * v.y + m_[2].y * v.z, m_[0].z * v.x + m_[1].z * v.y + m_[2].z * v.z);\n\t\t},\n\t\tmat4x4f: (m, v) => {\n\t\t\tconst m_ = m.columns;\n\t\t\treturn vec4f(m_[0].x * v.x + m_[1].x * v.y + m_[2].x * v.z + m_[3].x * v.w, m_[0].y * v.x + m_[1].y * v.y + m_[2].y * v.z + m_[3].y * v.w, m_[0].z * v.x + m_[1].z * v.y + m_[2].z * v.z + m_[3].z * v.w, m_[0].w * v.x + m_[1].w * v.y + m_[2].w * v.z + m_[3].w * v.w);\n\t\t}\n\t},\n\tmulVxM: {\n\t\tmat2x2f: (v, m) => {\n\t\t\tconst m_ = m.columns;\n\t\t\treturn vec2f(v.x * m_[0].x + v.y * m_[0].y, v.x * m_[1].x + v.y * m_[1].y);\n\t\t},\n\t\tmat3x3f: (v, m) => {\n\t\t\tconst m_ = m.columns;\n\t\t\treturn vec3f(v.x * m_[0].x + v.y * m_[0].y + v.z * m_[0].z, v.x * m_[1].x + v.y * m_[1].y + v.z * m_[1].z, v.x * m_[2].x + v.y * m_[2].y + v.z * m_[2].z);\n\t\t},\n\t\tmat4x4f: (v, m) => {\n\t\t\tconst m_ = m.columns;\n\t\t\treturn vec4f(v.x * m_[0].x + v.y * m_[0].y + v.z * m_[0].z + v.w * m_[0].w, v.x * m_[1].x + v.y * m_[1].y + v.z * m_[1].z + v.w * m_[1].w, v.x * m_[2].x + v.y * m_[2].y + v.z * m_[2].z + v.w * m_[2].w, v.x * m_[3].x + v.y * m_[3].y + v.z * m_[3].z + v.w * m_[3].w);\n\t\t}\n\t},\n\tdiv: {\n\t\tvec2f: binaryComponentWise2f((a, b) => a / b),\n\t\tvec2h: binaryComponentWise2h((a, b) => a / b),\n\t\tvec2i: binaryComponentWise2i(divInteger),\n\t\tvec2u: binaryComponentWise2u(divInteger),\n\t\tvec3f: binaryComponentWise3f((a, b) => a / b),\n\t\tvec3h: binaryComponentWise3h((a, b) => a / b),\n\t\tvec3i: binaryComponentWise3i(divInteger),\n\t\tvec3u: binaryComponentWise3u(divInteger),\n\t\tvec4f: binaryComponentWise4f((a, b) => a / b),\n\t\tvec4h: binaryComponentWise4h((a, b) => a / b),\n\t\tvec4i: binaryComponentWise4i(divInteger),\n\t\tvec4u: binaryComponentWise4u(divInteger)\n\t},\n\tdot: {\n\t\tvec2f: dotVec2,\n\t\tvec2h: dotVec2,\n\t\tvec2i: dotVec2,\n\t\tvec2u: dotVec2,\n\t\tvec3f: dotVec3,\n\t\tvec3h: dotVec3,\n\t\tvec3i: dotVec3,\n\t\tvec3u: dotVec3,\n\t\tvec4f: dotVec4,\n\t\tvec4h: dotVec4,\n\t\tvec4i: dotVec4,\n\t\tvec4u: dotVec4\n\t},\n\tnormalize: {\n\t\tvec2f: (v) => {\n\t\t\tconst len = lengthVec2(v);\n\t\t\treturn vec2f(v.x / len, v.y / len);\n\t\t},\n\t\tvec2h: (v) => {\n\t\t\tconst len = lengthVec2(v);\n\t\t\treturn vec2h(v.x / len, v.y / len);\n\t\t},\n\t\tvec2i: (v) => {\n\t\t\tconst len = lengthVec2(v);\n\t\t\treturn vec2i(v.x / len, v.y / len);\n\t\t},\n\t\tvec2u: (v) => {\n\t\t\tconst len = lengthVec2(v);\n\t\t\treturn vec2u(v.x / len, v.y / len);\n\t\t},\n\t\tvec3f: (v) => {\n\t\t\tconst len = lengthVec3(v);\n\t\t\treturn vec3f(v.x / len, v.y / len, v.z / len);\n\t\t},\n\t\tvec3h: (v) => {\n\t\t\tconst len = lengthVec3(v);\n\t\t\treturn vec3h(v.x / len, v.y / len, v.z / len);\n\t\t},\n\t\tvec3i: (v) => {\n\t\t\tconst len = lengthVec3(v);\n\t\t\treturn vec3i(v.x / len, v.y / len, v.z / len);\n\t\t},\n\t\tvec3u: (v) => {\n\t\t\tconst len = lengthVec3(v);\n\t\t\treturn vec3u(v.x / len, v.y / len, v.z / len);\n\t\t},\n\t\tvec4f: (v) => {\n\t\t\tconst len = lengthVec4(v);\n\t\t\treturn vec4f(v.x / len, v.y / len, v.z / len, v.w / len);\n\t\t},\n\t\tvec4h: (v) => {\n\t\t\tconst len = lengthVec4(v);\n\t\t\treturn vec4h(v.x / len, v.y / len, v.z / len, v.w / len);\n\t\t},\n\t\tvec4i: (v) => {\n\t\t\tconst len = lengthVec4(v);\n\t\t\treturn vec4i(v.x / len, v.y / len, v.z / len, v.w / len);\n\t\t},\n\t\tvec4u: (v) => {\n\t\t\tconst len = lengthVec4(v);\n\t\t\treturn vec4u(v.x / len, v.y / len, v.z / len, v.w / len);\n\t\t}\n\t},\n\tcross: {\n\t\tvec3f: (a, b) => {\n\t\t\treturn vec3f(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);\n\t\t},\n\t\tvec3h: (a, b) => {\n\t\t\treturn vec3h(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);\n\t\t}\n\t},\n\tmod: {\n\t\tvec2f: binaryComponentWise2f((a, b) => a % b),\n\t\tvec2h: binaryComponentWise2h((a, b) => a % b),\n\t\tvec2i: binaryComponentWise2i((a, b) => a % b),\n\t\tvec2u: binaryComponentWise2u((a, b) => a % b),\n\t\tvec3f: binaryComponentWise3f((a, b) => a % b),\n\t\tvec3h: binaryComponentWise3h((a, b) => a % b),\n\t\tvec3i: binaryComponentWise3i((a, b) => a % b),\n\t\tvec3u: binaryComponentWise3u((a, b) => a % b),\n\t\tvec4f: binaryComponentWise4f((a, b) => a % b),\n\t\tvec4h: binaryComponentWise4h((a, b) => a % b),\n\t\tvec4i: binaryComponentWise4i((a, b) => a % b),\n\t\tvec4u: binaryComponentWise4u((a, b) => a % b)\n\t},\n\tfloor: {\n\t\tvec2f: unary2f(Math.floor),\n\t\tvec2h: unary2h(Math.floor),\n\t\tvec3f: unary3f(Math.floor),\n\t\tvec3h: unary3h(Math.floor),\n\t\tvec4f: unary4f(Math.floor),\n\t\tvec4h: unary4h(Math.floor)\n\t},\n\tmax: {\n\t\tvec2f: binaryComponentWise2f(Math.max),\n\t\tvec2h: binaryComponentWise2h(Math.max),\n\t\tvec2i: binaryComponentWise2i(Math.max),\n\t\tvec2u: binaryComponentWise2u(Math.max),\n\t\tvec3f: binaryComponentWise3f(Math.max),\n\t\tvec3h: binaryComponentWise3h(Math.max),\n\t\tvec3i: binaryComponentWise3i(Math.max),\n\t\tvec3u: binaryComponentWise3u(Math.max),\n\t\tvec4f: binaryComponentWise4f(Math.max),\n\t\tvec4h: binaryComponentWise4h(Math.max),\n\t\tvec4i: binaryComponentWise4i(Math.max),\n\t\tvec4u: binaryComponentWise4u(Math.max)\n\t},\n\tmin: {\n\t\tvec2f: binaryComponentWise2f(Math.min),\n\t\tvec2h: binaryComponentWise2h(Math.min),\n\t\tvec2i: binaryComponentWise2i(Math.min),\n\t\tvec2u: binaryComponentWise2u(Math.min),\n\t\tvec3f: binaryComponentWise3f(Math.min),\n\t\tvec3h: binaryComponentWise3h(Math.min),\n\t\tvec3i: binaryComponentWise3i(Math.min),\n\t\tvec3u: binaryComponentWise3u(Math.min),\n\t\tvec4f: binaryComponentWise4f(Math.min),\n\t\tvec4h: binaryComponentWise4h(Math.min),\n\t\tvec4i: binaryComponentWise4i(Math.min),\n\t\tvec4u: binaryComponentWise4u(Math.min)\n\t},\n\tpow: {\n\t\tvec2f: (base, exponent) => vec2f(base.x ** exponent.x, base.y ** exponent.y),\n\t\tvec2h: (base, exponent) => vec2h(base.x ** exponent.x, base.y ** exponent.y),\n\t\tvec3f: (base, exponent) => vec3f(base.x ** exponent.x, base.y ** exponent.y, base.z ** exponent.z),\n\t\tvec3h: (base, exponent) => vec3h(base.x ** exponent.x, base.y ** exponent.y, base.z ** exponent.z),\n\t\tvec4f: (base, exponent) => vec4f(base.x ** exponent.x, base.y ** exponent.y, base.z ** exponent.z, base.w ** exponent.w),\n\t\tvec4h: (base, exponent) => vec4h(base.x ** exponent.x, base.y ** exponent.y, base.z ** exponent.z, base.w ** exponent.w)\n\t},\n\tsign: {\n\t\tvec2f: unary2f(Math.sign),\n\t\tvec2h: unary2h(Math.sign),\n\t\tvec2i: unary2i(Math.sign),\n\t\tvec3f: unary3f(Math.sign),\n\t\tvec3h: unary3h(Math.sign),\n\t\tvec3i: unary3i(Math.sign),\n\t\tvec4f: unary4f(Math.sign),\n\t\tvec4h: unary4h(Math.sign),\n\t\tvec4i: unary4i(Math.sign)\n\t},\n\tsqrt: {\n\t\tvec2f: unary2f(Math.sqrt),\n\t\tvec2h: unary2h(Math.sqrt),\n\t\tvec3f: unary3f(Math.sqrt),\n\t\tvec3h: unary3h(Math.sqrt),\n\t\tvec4f: unary4f(Math.sqrt),\n\t\tvec4h: unary4h(Math.sqrt)\n\t},\n\tmix: {\n\t\tvec2f: (e1, e2, e3) => {\n\t\t\tif (typeof e3 === \"number\") return vec2f(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3);\n\t\t\treturn vec2f(e1.x * (1 - e3.x) + e2.x * e3.x, e1.y * (1 - e3.y) + e2.y * e3.y);\n\t\t},\n\t\tvec2h: (e1, e2, e3) => {\n\t\t\tif (typeof e3 === \"number\") return vec2h(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3);\n\t\t\treturn vec2h(e1.x * (1 - e3.x) + e2.x * e3.x, e1.y * (1 - e3.y) + e2.y * e3.y);\n\t\t},\n\t\tvec3f: (e1, e2, e3) => {\n\t\t\tif (typeof e3 === \"number\") return vec3f(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3, e1.z * (1 - e3) + e2.z * e3);\n\t\t\treturn vec3f(e1.x * (1 - e3.x) + e2.x * e3.x, e1.y * (1 - e3.y) + e2.y * e3.y, e1.z * (1 - e3.z) + e2.z * e3.z);\n\t\t},\n\t\tvec3h: (e1, e2, e3) => {\n\t\t\tif (typeof e3 === \"number\") return vec3h(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3, e1.z * (1 - e3) + e2.z * e3);\n\t\t\treturn vec3h(e1.x * (1 - e3.x) + e2.x * e3.x, e1.y * (1 - e3.y) + e2.y * e3.y, e1.z * (1 - e3.z) + e2.z * e3.z);\n\t\t},\n\t\tvec4f: (e1, e2, e3) => {\n\t\t\tif (typeof e3 === \"number\") return vec4f(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3, e1.z * (1 - e3) + e2.z * e3, e1.w * (1 - e3) + e2.w * e3);\n\t\t\treturn vec4f(e1.x * (1 - e3.x) + e2.x * e3.x, e1.y * (1 - e3.y) + e2.y * e3.y, e1.z * (1 - e3.z) + e2.z * e3.z, e1.w * (1 - e3.w) + e2.w * e3.w);\n\t\t},\n\t\tvec4h: (e1, e2, e3) => {\n\t\t\tif (typeof e3 === \"number\") return vec4h(e1.x * (1 - e3) + e2.x * e3, e1.y * (1 - e3) + e2.y * e3, e1.z * (1 - e3) + e2.z * e3, e1.w * (1 - e3) + e2.w * e3);\n\t\t\treturn vec4h(e1.x * (1 - e3.x) + e2.x * e3.x, e1.y * (1 - e3.y) + e2.y * e3.y, e1.z * (1 - e3.z) + e2.z * e3.z, e1.w * (1 - e3.w) + e2.w * e3.w);\n\t\t}\n\t},\n\tsin: {\n\t\tvec2f: unary2f(Math.sin),\n\t\tvec2h: unary2h(Math.sin),\n\t\tvec3f: unary3f(Math.sin),\n\t\tvec3h: unary3h(Math.sin),\n\t\tvec4f: unary4f(Math.sin),\n\t\tvec4h: unary4h(Math.sin)\n\t},\n\tcos: {\n\t\tvec2f: unary2f(Math.cos),\n\t\tvec2h: unary2h(Math.cos),\n\t\tvec3f: unary3f(Math.cos),\n\t\tvec3h: unary3h(Math.cos),\n\t\tvec4f: unary4f(Math.cos),\n\t\tvec4h: unary4h(Math.cos)\n\t},\n\tcosh: {\n\t\tvec2f: unary2f(Math.cosh),\n\t\tvec2h: unary2h(Math.cosh),\n\t\tvec3f: unary3f(Math.cosh),\n\t\tvec3h: unary3h(Math.cosh),\n\t\tvec4f: unary4f(Math.cosh),\n\t\tvec4h: unary4h(Math.cosh)\n\t},\n\texp: {\n\t\tvec2f: unary2f(Math.exp),\n\t\tvec2h: unary2h(Math.exp),\n\t\tvec3f: unary3f(Math.exp),\n\t\tvec3h: unary3h(Math.exp),\n\t\tvec4f: unary4f(Math.exp),\n\t\tvec4h: unary4h(Math.exp)\n\t},\n\texp2: {\n\t\tvec2f: unary2f((val) => 2 ** val),\n\t\tvec2h: unary2h((val) => 2 ** val),\n\t\tvec3f: unary3f((val) => 2 ** val),\n\t\tvec3h: unary3h((val) => 2 ** val),\n\t\tvec4f: unary4f((val) => 2 ** val),\n\t\tvec4h: unary4h((val) => 2 ** val)\n\t},\n\tlog: {\n\t\tvec2f: unary2f(Math.log),\n\t\tvec2h: unary2h(Math.log),\n\t\tvec3f: unary3f(Math.log),\n\t\tvec3h: unary3h(Math.log),\n\t\tvec4f: unary4f(Math.log),\n\t\tvec4h: unary4h(Math.log)\n\t},\n\tlog2: {\n\t\tvec2f: unary2f(Math.log2),\n\t\tvec2h: unary2h(Math.log2),\n\t\tvec3f: unary3f(Math.log2),\n\t\tvec3h: unary3h(Math.log2),\n\t\tvec4f: unary4f(Math.log2),\n\t\tvec4h: unary4h(Math.log2)\n\t},\n\tfract: {\n\t\tvec2f: unary2f((value) => value - Math.floor(value)),\n\t\tvec2h: unary2h((value) => value - Math.floor(value)),\n\t\tvec3f: unary3f((value) => value - Math.floor(value)),\n\t\tvec3h: unary3h((value) => value - Math.floor(value)),\n\t\tvec4f: unary4f((value) => value - Math.floor(value)),\n\t\tvec4h: unary4h((value) => value - Math.floor(value))\n\t},\n\tisCloseToZero: {\n\t\tvec2f: (v, n) => Math.abs(v.x) <= n && Math.abs(v.y) <= n,\n\t\tvec2h: (v, n) => Math.abs(v.x) <= n && Math.abs(v.y) <= n,\n\t\tvec3f: (v, n) => Math.abs(v.x) <= n && Math.abs(v.y) <= n && Math.abs(v.z) <= n,\n\t\tvec3h: (v, n) => Math.abs(v.x) <= n && Math.abs(v.y) <= n && Math.abs(v.z) <= n,\n\t\tvec4f: (v, n) => Math.abs(v.x) <= n && Math.abs(v.y) <= n && Math.abs(v.z) <= n && Math.abs(v.w) <= n,\n\t\tvec4h: (v, n) => Math.abs(v.x) <= n && Math.abs(v.y) <= n && Math.abs(v.z) <= n && Math.abs(v.w) <= n\n\t},\n\tneg: {\n\t\tvec2f: unary2f((value) => -value),\n\t\tvec2h: unary2h((value) => -value),\n\t\tvec2i: unary2i((value) => -value),\n\t\tvec2u: unary2u((value) => -value),\n\t\t\"vec2<bool>\": (e) => vec2b(!e.x, !e.y),\n\t\tvec3f: unary3f((value) => -value),\n\t\tvec3h: unary3h((value) => -value),\n\t\tvec3i: unary3i((value) => -value),\n\t\tvec3u: unary3u((value) => -value),\n\t\t\"vec3<bool>\": (e) => vec3b(!e.x, !e.y, !e.z),\n\t\tvec4f: unary4f((value) => -value),\n\t\tvec4h: unary4h((value) => -value),\n\t\tvec4i: unary4i((value) => -value),\n\t\tvec4u: unary4u((value) => -value),\n\t\t\"vec4<bool>\": (e) => vec4b(!e.x, !e.y, !e.z, !e.w)\n\t},\n\tselect: {\n\t\tvec2f: (f, t, c) => vec2f(c.x ? t.x : f.x, c.y ? t.y : f.y),\n\t\tvec2h: (f, t, c) => vec2h(c.x ? t.x : f.x, c.y ? t.y : f.y),\n\t\tvec2i: (f, t, c) => vec2i(c.x ? t.x : f.x, c.y ? t.y : f.y),\n\t\tvec2u: (f, t, c) => vec2u(c.x ? t.x : f.x, c.y ? t.y : f.y),\n\t\t\"vec2<bool>\": (f, t, c) => vec2b(c.x ? t.x : f.x, c.y ? t.y : f.y),\n\t\tvec3f: (f, t, c) => vec3f(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n\t\tvec3h: (f, t, c) => vec3h(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n\t\tvec3i: (f, t, c) => vec3i(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n\t\tvec3u: (f, t, c) => vec3u(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n\t\t\"vec3<bool>\": (f, t, c) => vec3b(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z),\n\t\tvec4f: (f, t, c) => vec4f(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n\t\tvec4h: (f, t, c) => vec4h(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n\t\tvec4i: (f, t, c) => vec4i(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n\t\tvec4u: (f, t, c) => vec4u(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w),\n\t\t\"vec4<bool>\": (f, t, c) => vec4b(c.x ? t.x : f.x, c.y ? t.y : f.y, c.z ? t.z : f.z, c.w ? t.w : f.w)\n\t},\n\ttanh: {\n\t\tvec2f: unary2f(Math.tanh),\n\t\tvec2h: unary2h(Math.tanh),\n\t\tvec3f: unary3f(Math.tanh),\n\t\tvec3h: unary3h(Math.tanh),\n\t\tvec4f: unary4f(Math.tanh),\n\t\tvec4h: unary4h(Math.tanh)\n\t},\n\tbitcastU32toF32: {\n\t\tvec2u: (n) => vec2f(bitcastU32toF32Impl(n.x), bitcastU32toF32Impl(n.y)),\n\t\tvec3u: (n) => vec3f(bitcastU32toF32Impl(n.x), bitcastU32toF32Impl(n.y), bitcastU32toF32Impl(n.z)),\n\t\tvec4u: (n) => vec4f(bitcastU32toF32Impl(n.x), bitcastU32toF32Impl(n.y), bitcastU32toF32Impl(n.z), bitcastU32toF32Impl(n.w))\n\t},\n\tbitcastU32toI32: {\n\t\tvec2u: (n) => vec2i(bitcastU32toI32Impl(n.x), bitcastU32toI32Impl(n.y)),\n\t\tvec3u: (n) => vec3i(bitcastU32toI32Impl(n.x), bitcastU32toI32Impl(n.y), bitcastU32toI32Impl(n.z)),\n\t\tvec4u: (n) => vec4i(bitcastU32toI32Impl(n.x), bitcastU32toI32Impl(n.y), bitcastU32toI32Impl(n.z), bitcastU32toI32Impl(n.w))\n\t}\n};\n\n//#endregion\nexport { VectorOps };","import { isFloat32VecInstance, isMat, isMatInstance, isVec, isVecInstance } from \"../data/wgslTypes.js\";\nimport { SignatureNotSupportedError } from \"../errors.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { unify } from \"../tgsl/conversion.js\";\nimport { abstractFloat, f16, f32 } from \"../data/numeric.js\";\nimport { vecTypeToConstructor } from \"../data/vector.js\";\nimport { dualImpl } from \"../core/function/dualImpl.js\";\nimport { VectorOps } from \"../data/vectorOps.js\";\n\n//#region src/std/operators.ts\nconst getPrimitive = (t) => \"primitive\" in t ? t.primitive : t;\nconst makeBinarySignature = (opts) => (lhs, rhs) => {\n\tconst { restrict } = opts ?? {};\n\tconst fail = (msg) => {\n\t\tif (restrict) throw new SignatureNotSupportedError([lhs, rhs], restrict);\n\t\tthrow new Error(`Cannot apply operator to ${lhs.type} and ${rhs.type}: ${msg}`);\n\t};\n\tif (opts?.noMat && (isMat(lhs) || isMat(rhs))) return fail(\"matrices not supported\");\n\tconst lhsC = isVec(lhs) || isMat(lhs);\n\tconst rhsC = isVec(rhs) || isMat(rhs);\n\tif (!lhsC && !rhsC) {\n\t\tconst unified = unify([lhs, rhs], restrict);\n\t\tif (!unified) return fail(\"incompatible scalar types\");\n\t\treturn {\n\t\t\targTypes: unified,\n\t\t\treturnType: unified[0]\n\t\t};\n\t}\n\tif (lhsC && rhsC) {\n\t\tif (opts?.matVecProduct && isVec(lhs) !== isVec(rhs)) return {\n\t\t\targTypes: [lhs, rhs],\n\t\t\treturnType: isVec(lhs) ? lhs : rhs\n\t\t};\n\t\tif (lhs.type !== rhs.type) return fail(\"operands must have the same type\");\n\t\treturn {\n\t\t\targTypes: [lhs, rhs],\n\t\t\treturnType: lhs\n\t\t};\n\t}\n\tconst [scalar, composite] = lhsC ? [rhs, lhs] : [lhs, rhs];\n\tconst unified = unify([scalar], [getPrimitive(composite)]);\n\tif (!unified) return fail(`scalar not convertible to ${getPrimitive(composite).type}`);\n\treturn {\n\t\targTypes: lhsC ? [lhs, unified[0]] : [unified[0], rhs],\n\t\treturnType: composite\n\t};\n};\nconst binaryArithmeticSignature = makeBinarySignature();\nconst binaryMulSignature = makeBinarySignature({ matVecProduct: true });\nconst binaryDivSignature = makeBinarySignature({\n\tnoMat: true,\n\trestrict: [\n\t\tf32,\n\t\tf16,\n\t\tabstractFloat\n\t]\n});\nfunction cpuAdd(lhs, rhs) {\n\tif (typeof lhs === \"number\" && typeof rhs === \"number\") return lhs + rhs;\n\tif (typeof lhs === \"number\" && isVecInstance(rhs)) return VectorOps.addMixed[rhs.kind](rhs, lhs);\n\tif (isVecInstance(lhs) && typeof rhs === \"number\") return VectorOps.addMixed[lhs.kind](lhs, rhs);\n\tif (isVecInstance(lhs) && isVecInstance(rhs) || isMatInstance(lhs) && isMatInstance(rhs)) return VectorOps.add[lhs.kind](lhs, rhs);\n\tthrow new Error(\"Add/Sub called with invalid arguments.\");\n}\nconst add = dualImpl({\n\tname: \"add\",\n\tsignature: binaryArithmeticSignature,\n\tnormalImpl: cpuAdd,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} + ${rhs})`\n});\nfunction cpuSub(lhs, rhs) {\n\treturn cpuAdd(lhs, cpuMul(-1, rhs));\n}\nconst sub = dualImpl({\n\tname: \"sub\",\n\tsignature: binaryArithmeticSignature,\n\tnormalImpl: cpuSub,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} - ${rhs})`\n});\nfunction cpuMul(lhs, rhs) {\n\tif (typeof lhs === \"number\" && typeof rhs === \"number\") return lhs * rhs;\n\tif (typeof lhs === \"number\" && (isVecInstance(rhs) || isMatInstance(rhs))) return VectorOps.mulSxV[rhs.kind](lhs, rhs);\n\tif ((isVecInstance(lhs) || isMatInstance(lhs)) && typeof rhs === \"number\") return VectorOps.mulSxV[lhs.kind](rhs, lhs);\n\tif (isVecInstance(lhs) && isVecInstance(rhs)) return VectorOps.mulVxV[lhs.kind](lhs, rhs);\n\tif (isFloat32VecInstance(lhs) && isMatInstance(rhs)) return VectorOps.mulVxM[rhs.kind](lhs, rhs);\n\tif (isMatInstance(lhs) && isFloat32VecInstance(rhs)) return VectorOps.mulMxV[lhs.kind](lhs, rhs);\n\tif (isMatInstance(lhs) && isMatInstance(rhs)) return VectorOps.mulVxV[lhs.kind](lhs, rhs);\n\tthrow new Error(\"Mul called with invalid arguments.\");\n}\nconst mul = dualImpl({\n\tname: \"mul\",\n\tsignature: binaryMulSignature,\n\tnormalImpl: cpuMul,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} * ${rhs})`\n});\nfunction cpuDiv(lhs, rhs) {\n\tif (typeof lhs === \"number\" && typeof rhs === \"number\") return lhs / rhs;\n\tif (typeof lhs === \"number\" && isVecInstance(rhs)) {\n\t\tconst schema = vecTypeToConstructor[rhs.kind];\n\t\treturn VectorOps.div[rhs.kind](schema(lhs), rhs);\n\t}\n\tif (isVecInstance(lhs) && typeof rhs === \"number\") {\n\t\tconst schema = vecTypeToConstructor[lhs.kind];\n\t\treturn VectorOps.div[lhs.kind](lhs, schema(rhs));\n\t}\n\tif (isVecInstance(lhs) && isVecInstance(rhs)) return VectorOps.div[lhs.kind](lhs, rhs);\n\tthrow new Error(\"Div called with invalid arguments.\");\n}\nconst div = dualImpl({\n\tname: \"div\",\n\tsignature: binaryDivSignature,\n\tnormalImpl: cpuDiv,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} / ${rhs})`,\n\tignoreImplicitCastWarning: true\n});\n/**\n* @privateRemarks\n* Both JS and WGSL implementations use truncated definition of modulo\n*/\nconst mod = dualImpl({\n\tname: \"mod\",\n\tsignature: binaryDivSignature,\n\tnormalImpl: ((a, b) => {\n\t\tif (typeof a === \"number\" && typeof b === \"number\") return a % b;\n\t\tif (typeof a === \"number\" && isVecInstance(b)) {\n\t\t\tconst schema = vecTypeToConstructor[b.kind];\n\t\t\treturn VectorOps.mod[b.kind](schema(a), b);\n\t\t}\n\t\tif (isVecInstance(a) && typeof b === \"number\") {\n\t\t\tconst schema = vecTypeToConstructor[a.kind];\n\t\t\treturn VectorOps.mod[a.kind](a, schema(b));\n\t\t}\n\t\tif (isVecInstance(a) && isVecInstance(b)) return VectorOps.mod[a.kind](a, b);\n\t\tthrow new Error(\"Mod called with invalid arguments, expected types: number or vector.\");\n\t}),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} % ${rhs})`\n});\nfunction cpuNeg(value) {\n\tif (typeof value === \"number\") return -value;\n\treturn VectorOps.neg[value.kind](value);\n}\nconst neg = dualImpl({\n\tname: \"neg\",\n\tsignature: (arg) => ({\n\t\targTypes: [arg],\n\t\treturnType: arg\n\t}),\n\tnormalImpl: cpuNeg,\n\tcodegenImpl: (_ctx, [arg]) => stitch`-(${arg})`\n});\n\n//#endregion\nexport { add, div, mod, mul, neg, sub };","import { $gpuCallable } from \"../shared/symbols.js\";\nimport { isMat, isNaturallyEphemeral, isPtr, isVec, isWgslArray, isWgslStruct } from \"../data/wgslTypes.js\";\nimport { InfixDispatch, MatrixColumnsAccess, UnknownData, isUnstruct, undecorate } from \"../data/dataTypes.js\";\nimport { isEphemeralSnippet, snip } from \"../data/snippet.js\";\nimport { isKnownAtComptime } from \"../types.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { derefSnippet } from \"../data/ref.js\";\nimport { abstractInt, bool, f16, f32, i32, u32 } from \"../data/numeric.js\";\nimport { vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u } from \"../data/vector.js\";\nimport { AutoStruct } from \"../data/autoStruct.js\";\nimport { coerceToSnippet } from \"./generationHelpers.js\";\nimport { add, div, mod, mul, sub } from \"../std/operators.js\";\n\n//#region src/tgsl/accessProp.ts\nconst infixKinds = [\n\t\"vec2f\",\n\t\"vec3f\",\n\t\"vec4f\",\n\t\"vec2h\",\n\t\"vec3h\",\n\t\"vec4h\",\n\t\"vec2i\",\n\t\"vec3i\",\n\t\"vec4i\",\n\t\"vec2u\",\n\t\"vec3u\",\n\t\"vec4u\",\n\t\"mat2x2f\",\n\t\"mat3x3f\",\n\t\"mat4x4f\"\n];\nconst infixOperators = {\n\tadd,\n\tsub,\n\tmul,\n\tdiv,\n\tmod\n};\nconst swizzleLenToType = {\n\tf: {\n\t\t1: f32,\n\t\t2: vec2f,\n\t\t3: vec3f,\n\t\t4: vec4f\n\t},\n\th: {\n\t\t1: f16,\n\t\t2: vec2h,\n\t\t3: vec3h,\n\t\t4: vec4h\n\t},\n\ti: {\n\t\t1: i32,\n\t\t2: vec2i,\n\t\t3: vec3i,\n\t\t4: vec4i\n\t},\n\tu: {\n\t\t1: u32,\n\t\t2: vec2u,\n\t\t3: vec3u,\n\t\t4: vec4u\n\t},\n\tb: {\n\t\t1: bool,\n\t\t2: vec2b,\n\t\t3: vec3b,\n\t\t4: vec4b\n\t}\n};\nfunction accessProp(target, propName) {\n\tif (infixKinds.includes(target.dataType.type) && propName in infixOperators) {\n\t\tconst operator = infixOperators[propName];\n\t\treturn snip(new InfixDispatch(propName, target, operator[$gpuCallable].call.bind(operator)), UnknownData, target.origin);\n\t}\n\tif (isWgslArray(target.dataType) && propName === \"length\") {\n\t\tif (target.dataType.elementCount === 0) return snip(stitch`arrayLength(&${target})`, u32, \"runtime\");\n\t\treturn snip(target.dataType.elementCount, abstractInt, \"constant\");\n\t}\n\tif (isMat(target.dataType) && propName === \"columns\") return snip(new MatrixColumnsAccess(target), UnknownData, target.origin);\n\tif (isWgslStruct(target.dataType) || isUnstruct(target.dataType)) {\n\t\tlet propType = target.dataType.propTypes[propName];\n\t\tif (!propType) return;\n\t\tpropType = undecorate(propType);\n\t\treturn snip(stitch`${target}.${propName}`, propType, target.origin === \"argument\" ? \"argument\" : !isEphemeralSnippet(target) && !isNaturallyEphemeral(propType) ? target.origin : target.origin === \"constant\" || target.origin === \"constant-tgpu-const-ref\" ? \"constant\" : \"runtime\");\n\t}\n\tif (target.dataType instanceof AutoStruct) {\n\t\tconst result = target.dataType.accessProp(propName);\n\t\tif (!result) return;\n\t\treturn snip(stitch`${target}.${result.prop}`, result.type, \"argument\");\n\t}\n\tif (isPtr(target.dataType)) {\n\t\tconst derefed = derefSnippet(target);\n\t\tif (propName === \"$\") return derefed;\n\t\treturn accessProp(derefed, propName);\n\t}\n\tif (isVec(target.dataType)) {\n\t\tif (propName === \"kind\") return snip(target.dataType.type, UnknownData, \"constant\");\n\t}\n\tconst propLength = propName.length;\n\tif (isVec(target.dataType) && propLength >= 1 && propLength <= 4) {\n\t\tconst isXYZW = /^[xyzw]+$/.test(propName);\n\t\tconst isRGBA = /^[rgba]+$/.test(propName);\n\t\tif (!isXYZW && !isRGBA) return;\n\t\tconst swizzleType = swizzleLenToType[target.dataType.type.includes(\"bool\") ? \"b\" : target.dataType.type[4]][propLength];\n\t\tif (!swizzleType) return;\n\t\treturn snip(isKnownAtComptime(target) ? target.value[propName] : stitch`${target}.${propName}`, swizzleType, target.origin === \"argument\" && propLength === 1 ? \"argument\" : target.origin === \"constant\" || target.origin === \"constant-tgpu-const-ref\" ? \"constant\" : \"runtime\");\n\t}\n\tif (isKnownAtComptime(target) || target.dataType === UnknownData) return coerceToSnippet(target.value[propName]);\n}\n\n//#endregion\nexport { accessProp, infixOperators };","import { isNaturallyEphemeral, isPtr, isVec, isWgslArray, isWgslStruct } from \"../data/wgslTypes.js\";\nimport { MatrixColumnsAccess, UnknownData, isDisarray } from \"../data/dataTypes.js\";\nimport { isEphemeralSnippet, snip } from \"../data/snippet.js\";\nimport { isKnownAtComptime } from \"../types.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { derefSnippet } from \"../data/ref.js\";\nimport { vec2f, vec3f, vec4f } from \"../data/vector.js\";\nimport { coerceToSnippet } from \"./generationHelpers.js\";\nimport { accessProp } from \"./accessProp.js\";\n\n//#region src/tgsl/accessIndex.ts\nconst indexableTypeToResult = {\n\tmat2x2f: vec2f,\n\tmat3x3f: vec3f,\n\tmat4x4f: vec4f\n};\nfunction accessIndex(target, indexArg) {\n\tconst index = typeof indexArg === \"number\" ? coerceToSnippet(indexArg) : indexArg;\n\tif (isWgslArray(target.dataType) || isDisarray(target.dataType)) {\n\t\tconst elementType = target.dataType.elementType;\n\t\tconst isElementNatEph = isNaturallyEphemeral(elementType);\n\t\tconst isTargetEphemeral = isEphemeralSnippet(target);\n\t\tconst isIndexConstant = index.origin === \"constant\";\n\t\tlet origin;\n\t\tif (target.origin === \"constant-tgpu-const-ref\") if (isIndexConstant) origin = isElementNatEph ? \"constant\" : \"constant-tgpu-const-ref\";\n\t\telse origin = isElementNatEph ? \"runtime\" : \"runtime-tgpu-const-ref\";\n\t\telse if (target.origin === \"runtime-tgpu-const-ref\") origin = isElementNatEph ? \"runtime\" : \"runtime-tgpu-const-ref\";\n\t\telse if (!isTargetEphemeral && !isElementNatEph) origin = target.origin;\n\t\telse if (isIndexConstant && target.origin === \"constant\") origin = \"constant\";\n\t\telse origin = \"runtime\";\n\t\treturn snip(isKnownAtComptime(target) && isKnownAtComptime(index) ? target.value[index.value] : stitch`${target}[${index}]`, elementType, origin);\n\t}\n\tif (isVec(target.dataType)) return snip(isKnownAtComptime(target) && isKnownAtComptime(index) ? target.value[index.value] : stitch`${target}[${index}]`, target.dataType.primitive, target.origin === \"constant\" || target.origin === \"constant-tgpu-const-ref\" ? \"constant\" : \"runtime\");\n\tif (isPtr(target.dataType)) return accessIndex(derefSnippet(target), index);\n\tif (target.value instanceof MatrixColumnsAccess) {\n\t\tconst propType = indexableTypeToResult[target.value.matrix.dataType.type];\n\t\treturn snip(stitch`${target.value.matrix}[${index}]`, propType, target.origin);\n\t}\n\tif (target.dataType.type in indexableTypeToResult) throw new Error(\"The only way of accessing matrix elements in TypeGPU functions is through the 'columns' property.\");\n\tif (isKnownAtComptime(target) && isKnownAtComptime(index) || target.dataType === UnknownData) return coerceToSnippet(target.value[index.value]);\n\tif (isWgslStruct(target.dataType) && isKnownAtComptime(index) && typeof index.value === \"string\") return accessProp(target, index.value);\n}\n\n//#endregion\nexport { accessIndex };","import { $internal, $ownSnippet, $resolve } from \"../shared/symbols.js\";\nimport { getOwnSnippet } from \"../types.js\";\nimport { getGPUValue } from \"../getGPUValue.js\";\nimport { accessProp } from \"../tgsl/accessProp.js\";\nimport { accessIndex } from \"../tgsl/accessIndex.js\";\n\n//#region src/core/valueProxyUtils.ts\nconst valueProxyHandler = { get(target, prop) {\n\tif (prop in target) return Reflect.get(target, prop);\n\tif (prop === \"toString\" || prop === Symbol.toStringTag || prop === Symbol.toPrimitive) return () => target.toString();\n\tif (typeof prop === \"symbol\") return;\n\tconst targetSnippet = getOwnSnippet(target);\n\tconst index = Number(prop);\n\tif (!Number.isNaN(index)) {\n\t\tconst accessed = accessIndex(targetSnippet, index);\n\t\tif (!accessed) return;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\t[$resolve]: (ctx) => ctx.resolve(accessed.value, accessed.dataType),\n\t\t\t[$ownSnippet]: accessed,\n\t\t\ttoString: () => `${String(target)}[${prop}]`\n\t\t}, valueProxyHandler);\n\t}\n\tconst accessed = accessProp(targetSnippet, String(prop));\n\tif (!accessed) return;\n\treturn new Proxy({\n\t\t[$internal]: true,\n\t\t[$resolve]: (ctx) => ctx.resolve(accessed.value, accessed.dataType),\n\t\t[$ownSnippet]: accessed,\n\t\ttoString: () => `${String(target)}.${prop}`\n\t}, valueProxyHandler);\n} };\nfunction getGpuValueRecursively(value) {\n\tlet unwrapped = value;\n\twhile (true) {\n\t\tconst gpuValue = getGPUValue(unwrapped);\n\t\tif (!gpuValue) break;\n\t\tunwrapped = gpuValue;\n\t}\n\treturn unwrapped;\n}\n\n//#endregion\nexport { getGpuValueRecursively, valueProxyHandler };","import { $getNameForward, $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { isNaturallyEphemeral } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { IllegalBufferAccessError } from \"../../errors.js\";\nimport { getExecMode, inCodegenMode, isInsideTgpuFn } from \"../../execMode.js\";\nimport { schemaCallWrapper } from \"../../data/schemaCallWrapper.js\";\nimport { assertExhaustive } from \"../../shared/utilityTypes.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\nimport { isUsableAsStorage } from \"../../extension.js\";\n\n//#region src/core/buffer/bufferUsage.ts\nfunction isUsableAsUniform(buffer) {\n\treturn !!buffer.usableAsUniform;\n}\nconst usageToVarTemplateMap = {\n\tuniform: \"uniform\",\n\tmutable: \"storage, read_write\",\n\treadonly: \"storage, read\"\n};\nvar TgpuFixedBufferImpl = class {\n\tresourceType = \"buffer-usage\";\n\t[$internal];\n\t[$getNameForward];\n\tconstructor(usage, buffer) {\n\t\tthis.usage = usage;\n\t\tthis.buffer = buffer;\n\t\tthis[$internal] = { dataType: buffer.dataType };\n\t\tthis[$getNameForward] = buffer;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\t[$resolve](ctx) {\n\t\tconst dataType = this.buffer.dataType;\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst { group, binding } = ctx.allocateFixedEntry(this.usage === \"uniform\" ? { uniform: dataType } : {\n\t\t\tstorage: dataType,\n\t\t\taccess: this.usage\n\t\t}, this.buffer);\n\t\tconst usage = usageToVarTemplateMap[this.usage];\n\t\tctx.addDeclaration(`@group(${group}) @binding(${binding}) var<${usage}> ${id}: ${ctx.resolve(dataType).value};`);\n\t\treturn snip(id, dataType, isNaturallyEphemeral(dataType) ? \"runtime\" : this.usage);\n\t}\n\ttoString() {\n\t\treturn `${this.usage}:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst dataType = this.buffer.dataType;\n\t\tconst usage = this.usage;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, dataType, isNaturallyEphemeral(dataType) ? \"runtime\" : usage);\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.usage}:${getName(this) ?? \"<unnamed>\"}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tconst mode = getExecMode();\n\t\tconst insideTgpuFn = isInsideTgpuFn();\n\t\tif (mode.type === \"normal\") throw new IllegalBufferAccessError(insideTgpuFn ? `Cannot access ${String(this.buffer)}. TypeGPU functions that depends on GPU resources need to be part of a compute dispatch, draw call or simulation` : \".$ is inaccessible during normal JS execution. Try `.read()`\");\n\t\tif (mode.type === \"codegen\") return this[$gpuValueOf];\n\t\tif (mode.type === \"simulate\") {\n\t\t\tif (!mode.buffers.has(this.buffer)) mode.buffers.set(this.buffer, schemaCallWrapper(this.buffer.dataType, this.buffer.initial));\n\t\t\treturn mode.buffers.get(this.buffer);\n\t\t}\n\t\treturn assertExhaustive(mode, \"bufferUsage.ts#TgpuFixedBufferImpl/$\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\tset $(value) {\n\t\tconst mode = getExecMode();\n\t\tconst insideTgpuFn = isInsideTgpuFn();\n\t\tif (mode.type === \"normal\") throw new IllegalBufferAccessError(insideTgpuFn ? `Cannot access ${String(this.buffer)}. TypeGPU functions that depends on GPU resources need to be part of a compute dispatch, draw call or simulation` : \".$ is inaccessible during normal JS execution. Try `.write()`\");\n\t\tif (mode.type === \"codegen\") throw new Error(\"Unreachable bufferUsage.ts#TgpuFixedBufferImpl/$\");\n\t\tif (mode.type === \"simulate\") {\n\t\t\tmode.buffers.set(this.buffer, value);\n\t\t\treturn;\n\t\t}\n\t\tassertExhaustive(mode, \"bufferUsage.ts#TgpuFixedBufferImpl/$\");\n\t}\n\tset value(value) {\n\t\tthis.$ = value;\n\t}\n};\nvar TgpuLaidOutBufferImpl = class {\n\t[$internal];\n\tresourceType = \"buffer-usage\";\n\t#membership;\n\tconstructor(usage, dataType, membership) {\n\t\tthis.usage = usage;\n\t\tthis.dataType = dataType;\n\t\tthis[$internal] = { dataType };\n\t\tthis.#membership = membership;\n\t\tsetName(this, membership.key);\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst group = ctx.allocateLayoutEntry(this.#membership.layout);\n\t\tconst usage = usageToVarTemplateMap[this.usage];\n\t\tctx.addDeclaration(`@group(${group}) @binding(${this.#membership.idx}) var<${usage}> ${id}: ${ctx.resolve(this.dataType).value};`);\n\t\treturn snip(id, this.dataType, isNaturallyEphemeral(this.dataType) ? \"runtime\" : this.usage);\n\t}\n\ttoString() {\n\t\treturn `${this.usage}:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst schema = this.dataType;\n\t\tconst usage = this.usage;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, schema, isNaturallyEphemeral(schema) ? \"runtime\" : usage);\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.usage}:${getName(this) ?? \"<unnamed>\"}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"Direct access to buffer values is possible only as part of a compute dispatch or draw call. Try .read() or .write() instead\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n};\nconst mutableUsageMap = /* @__PURE__ */ new WeakMap();\nfunction mutable(buffer) {\n\tif (!isUsableAsStorage(buffer)) throw new Error(`Cannot call as('mutable') on ${buffer}, as it is not allowed to be used as storage. To allow it, call .$usage('storage') when creating the buffer.`);\n\tlet usage = mutableUsageMap.get(buffer);\n\tif (!usage) {\n\t\tusage = new TgpuFixedBufferImpl(\"mutable\", buffer);\n\t\tmutableUsageMap.set(buffer, usage);\n\t}\n\treturn usage;\n}\nconst readonlyUsageMap = /* @__PURE__ */ new WeakMap();\nfunction readonly(buffer) {\n\tif (!isUsableAsStorage(buffer)) throw new Error(`Cannot call as('readonly') on ${buffer}, as it is not allowed to be used as storage. To allow it, call .$usage('storage') when creating the buffer.`);\n\tlet usage = readonlyUsageMap.get(buffer);\n\tif (!usage) {\n\t\tusage = new TgpuFixedBufferImpl(\"readonly\", buffer);\n\t\treadonlyUsageMap.set(buffer, usage);\n\t}\n\treturn usage;\n}\nconst uniformUsageMap = /* @__PURE__ */ new WeakMap();\nfunction uniform(buffer) {\n\tif (!isUsableAsUniform(buffer)) throw new Error(`Cannot call as('uniform') on ${buffer}, as it is not allowed to be used as a uniform. To allow it, call .$usage('uniform') when creating the buffer.`);\n\tlet usage = uniformUsageMap.get(buffer);\n\tif (!usage) {\n\t\tusage = new TgpuFixedBufferImpl(\"uniform\", buffer);\n\t\tuniformUsageMap.set(buffer, usage);\n\t}\n\treturn usage;\n}\n\n//#endregion\nexport { TgpuLaidOutBufferImpl, isUsableAsUniform, mutable, readonly, uniform };","//#region src/data/alignIO.ts\n/**\n* @param io the IO to align\n* @param baseAlignment must be power of 2\n*/\nfunction alignIO(io, baseAlignment) {\n\tconst currentPos = \"size\" in io ? io.size : io.currentByteOffset;\n\tconst bitMask = baseAlignment - 1;\n\tconst offset = currentPos & bitMask;\n\tif (\"skipBytes\" in io) io.skipBytes(baseAlignment - offset & bitMask);\n\telse io.add(baseAlignment - offset & bitMask);\n}\n\n//#endregion\nexport { alignIO as default };","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/main-api.ts\nvar main_api_exports = {};\n__export(main_api_exports, {\n BufferReader: () => BufferReader,\n BufferWriter: () => BufferWriter,\n MaxValue: () => MaxValue,\n Measurer: () => Measurer,\n UnresolvedReferenceError: () => UnresolvedReferenceError,\n ValidationError: () => ValidationError,\n arrayOf: () => arrayOf,\n bool: () => bool,\n byte: () => byte,\n chars: () => chars,\n concat: () => concat,\n dynamicArrayOf: () => dynamicArrayOf,\n f16: () => f16,\n f32: () => f32,\n f32Array: () => f32Array,\n f64Array: () => f64Array,\n generic: () => generic,\n genericEnum: () => genericEnum,\n i16: () => i16,\n i16Array: () => i16Array,\n i32: () => i32,\n i32Array: () => i32Array,\n i8: () => i8,\n i8Array: () => i8Array,\n keyed: () => keyed,\n object: () => object,\n optional: () => optional,\n string: () => string,\n tupleOf: () => tupleOf,\n u16: () => u16,\n u16Array: () => u16Array,\n u32: () => u32,\n u32Array: () => u32Array,\n u8: () => u8,\n u8Array: () => u8Array,\n u8ClampedArray: () => u8ClampedArray\n});\n\n// src/error.ts\nvar UnresolvedReferenceError = class _UnresolvedReferenceError extends Error {\n constructor(msg) {\n super(msg);\n Object.setPrototypeOf(this, _UnresolvedReferenceError.prototype);\n }\n};\nvar ValidationError = class _ValidationError extends Error {\n constructor(msg) {\n super(msg);\n Object.setPrototypeOf(this, _ValidationError.prototype);\n }\n};\n\n// src/io/measurer.ts\nvar UnboundedMeasurer = class {\n constructor() {\n __publicField(this, \"size\", Number.NaN);\n __publicField(this, \"unbounded\", this);\n __publicField(this, \"isUnbounded\", true);\n }\n add() {\n return this;\n }\n fork() {\n return this;\n }\n};\nvar unboundedMeasurer = new UnboundedMeasurer();\nvar Measurer = class _Measurer {\n constructor() {\n __publicField(this, \"size\", 0);\n __publicField(this, \"unbounded\", unboundedMeasurer);\n __publicField(this, \"isUnbounded\", false);\n }\n add(bytes) {\n this.size += bytes;\n return this;\n }\n fork() {\n const forked = new _Measurer();\n forked.size = this.size;\n return forked;\n }\n};\n\n// src/structure/types.ts\nvar MaxValue = Symbol(\n \"The biggest (in amount of bytes needed) value a schema can represent\"\n);\nvar Schema = class {\n constructor() {\n __publicField(this, \"__unwrapped\");\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resolveReferences(ctx) {\n }\n seekProperty(_reference, _prop) {\n return null;\n }\n};\nvar Ref = class {\n constructor(key) {\n this.key = key;\n }\n};\nvar SubTypeKey = {\n STRING: \"string\",\n ENUM: \"enum\"\n};\n\n// src/structure/array.ts\nvar ArraySchema = class extends Schema {\n constructor(_unstableElementSchema, length) {\n super();\n this._unstableElementSchema = _unstableElementSchema;\n this.length = length;\n __publicField(this, \"elementSchema\");\n this.elementSchema = _unstableElementSchema;\n }\n resolveReferences(ctx) {\n this.elementSchema = ctx.resolve(this._unstableElementSchema);\n }\n write(output, values) {\n if (values.length !== this.length) {\n throw new ValidationError(`Expected array of length ${this.length}, got ${values.length}`);\n }\n for (const value of values) {\n this.elementSchema.write(output, value);\n }\n }\n read(input) {\n const array = [];\n for (let i = 0; i < this.length; ++i) {\n array.push(this.elementSchema.read(input));\n }\n return array;\n }\n /**\n * Returns the maximum number of bytes this schema can take up.\n *\n * Returns `NaN` if the schema is unbounded. If you would like to know\n * how many bytes a particular value encoding will take up, use `.measure(value)`.\n *\n * Alias for `.measure(MaxValue).size`\n */\n get maxSize() {\n return this.elementSchema.measure(MaxValue).size * this.length;\n }\n measure(values, measurer = new Measurer()) {\n for (let i = 0; i < this.length; ++i) {\n this.elementSchema.measure(values === MaxValue ? MaxValue : values[i], measurer);\n }\n return measurer;\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction arrayOf(elementSchema, length) {\n return new ArraySchema(elementSchema, length);\n}\n\n// src/structure/baseTypes.ts\nvar BoolSchema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 1);\n }\n read(input) {\n return input.readBool();\n }\n write(output, value) {\n output.writeBool(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(1);\n }\n};\nvar bool = new BoolSchema();\nvar _StringSchema = class _StringSchema extends Schema {\n static get _encoder() {\n if (!_StringSchema._cachedEncoder) {\n _StringSchema._cachedEncoder = new TextEncoder();\n }\n return _StringSchema._cachedEncoder;\n }\n read(input) {\n return input.readString();\n }\n write(output, value) {\n output.writeString(value);\n }\n measure(value, measurer = new Measurer()) {\n if (value === MaxValue) {\n return measurer.unbounded;\n }\n const encoded = _StringSchema._encoder.encode(value);\n return measurer.add(encoded.byteLength + 1);\n }\n};\n__publicField(_StringSchema, \"_cachedEncoder\");\nvar StringSchema = _StringSchema;\nvar string = new StringSchema();\nvar Int8Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 1);\n }\n read(input) {\n return input.readInt8();\n }\n write(output, value) {\n output.writeInt8(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(1);\n }\n};\nvar i8 = new Int8Schema();\nvar Uint8Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 1);\n }\n read(input) {\n return input.readUint8();\n }\n write(output, value) {\n output.writeUint8(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(1);\n }\n};\nvar u8 = new Uint8Schema();\nvar byte = u8;\nvar Int16Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 2);\n }\n read(input) {\n return input.readInt16();\n }\n write(output, value) {\n output.writeInt16(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(2);\n }\n};\nvar i16 = new Int16Schema();\nvar Uint16Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 2);\n }\n read(input) {\n return input.readUint16();\n }\n write(output, value) {\n output.writeUint16(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(2);\n }\n};\nvar u16 = new Uint16Schema();\nvar Int32Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 4);\n }\n read(input) {\n return input.readInt32();\n }\n write(output, value) {\n output.writeInt32(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(4);\n }\n};\nvar i32 = new Int32Schema();\nvar Uint32Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 4);\n }\n read(input) {\n return input.readUint32();\n }\n write(output, value) {\n output.writeUint32(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(4);\n }\n};\nvar u32 = new Uint32Schema();\nvar Float16Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 2);\n }\n read(input) {\n return input.readFloat16();\n }\n write(output, value) {\n output.writeFloat16(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(2);\n }\n};\nvar f16 = new Float16Schema();\nvar Float32Schema = class extends Schema {\n constructor() {\n super(...arguments);\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Alias for `.measure(MaxValue).size`\n */\n __publicField(this, \"maxSize\", 4);\n }\n read(input) {\n return input.readFloat32();\n }\n write(output, value) {\n output.writeFloat32(value);\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(4);\n }\n};\nvar f32 = new Float32Schema();\n\n// src/structure/chars.ts\nvar CharsSchema = class extends Schema {\n constructor(length) {\n super();\n this.length = length;\n }\n write(output, value) {\n if (value.length !== this.length) {\n throw new ValidationError(\n `Expected char-string of length ${this.length}, got ${value.length}`\n );\n }\n for (let i = 0; i < value.length; ++i) {\n output.writeUint8(value.charCodeAt(i));\n }\n }\n read(input) {\n let content = \"\";\n for (let i = 0; i < this.length; ++i) {\n content += String.fromCharCode(input.readByte());\n }\n return content;\n }\n measure(_, measurer = new Measurer()) {\n return measurer.add(this.length);\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction chars(length) {\n return new CharsSchema(length);\n}\n\n// src/structure/object.ts\n// @__NO_SIDE_EFFECTS__\nfunction exactEntries(record) {\n return Object.entries(record);\n}\n// @__NO_SIDE_EFFECTS__\nfunction resolveMap(ctx, refs) {\n const props = {};\n for (const [key, ref] of /* @__PURE__ */ exactEntries(refs)) {\n props[key] = ctx.resolve(ref);\n }\n return props;\n}\nvar ObjectSchema = class extends Schema {\n constructor(_properties) {\n super();\n this._properties = _properties;\n __publicField(this, \"properties\");\n this.properties = _properties;\n }\n resolveReferences(ctx) {\n this.properties = /* @__PURE__ */ resolveMap(ctx, this._properties);\n }\n write(output, value) {\n for (const [key, property] of /* @__PURE__ */ exactEntries(this.properties)) {\n property.write(output, value[key]);\n }\n }\n read(input) {\n const result = {};\n for (const [key, property] of /* @__PURE__ */ exactEntries(this.properties)) {\n result[key] = property.read(input);\n }\n return result;\n }\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Is `NaN` if the schema is unbounded. If you would like to know\n * how many bytes a particular value encoding will take up, use `.measure(value)`.\n *\n * Alias for `.measure(MaxValue).size`\n */\n get maxSize() {\n const measurer = new Measurer();\n for (const property of Object.values(this.properties)) {\n property.measure(MaxValue, measurer);\n }\n return measurer.size;\n }\n measure(value, measurer = new Measurer()) {\n for (const [key, property] of /* @__PURE__ */ exactEntries(this.properties)) {\n property.measure(value === MaxValue ? MaxValue : value[key], measurer);\n }\n return measurer;\n }\n seekProperty(reference, prop) {\n let bufferOffset = 0;\n for (const [key, property] of /* @__PURE__ */ exactEntries(this.properties)) {\n if (key === prop) {\n return {\n bufferOffset,\n schema: property\n };\n }\n bufferOffset += property.measure(reference).size;\n }\n return null;\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction object(properties) {\n return new ObjectSchema(properties);\n}\nvar GenericObjectSchema = class extends Schema {\n constructor(keyedBy, properties, _subTypeMap) {\n super();\n this.keyedBy = keyedBy;\n this._subTypeMap = _subTypeMap;\n __publicField(this, \"_baseObject\");\n __publicField(this, \"subTypeMap\");\n this._baseObject = new ObjectSchema(properties);\n this.subTypeMap = _subTypeMap;\n }\n resolveReferences(ctx) {\n this._baseObject.resolveReferences(ctx);\n this.subTypeMap = /* @__PURE__ */ resolveMap(ctx, this._subTypeMap);\n }\n write(output, value) {\n const subTypeKey = value.type;\n const subTypeDescription = this.subTypeMap[subTypeKey] || null;\n if (subTypeDescription === null) {\n throw new Error(\n `Unknown sub-type '${subTypeKey.toString()}' in among '${JSON.stringify(\n Object.keys(this.subTypeMap)\n )}'`\n );\n }\n if (this.keyedBy === SubTypeKey.ENUM) {\n output.writeUint8(value.type);\n } else {\n output.writeString(value.type);\n }\n this._baseObject.write(output, value);\n for (const [key, extraProp] of /* @__PURE__ */ exactEntries(subTypeDescription.properties)) {\n extraProp.write(output, value[key]);\n }\n }\n read(input) {\n const subTypeKey = this.keyedBy === SubTypeKey.ENUM ? input.readByte() : input.readString();\n const subTypeDescription = this.subTypeMap[subTypeKey] || null;\n if (subTypeDescription === null) {\n throw new Error(\n `Unknown sub-type '${subTypeKey}' in among '${JSON.stringify(\n Object.keys(this.subTypeMap)\n )}'`\n );\n }\n const result = this._baseObject.read(input);\n result.type = subTypeKey;\n if (subTypeDescription !== null) {\n for (const [key, extraProp] of /* @__PURE__ */ exactEntries(subTypeDescription.properties)) {\n result[key] = extraProp.read(input);\n }\n }\n return result;\n }\n measure(value, measurer = new Measurer()) {\n this._baseObject.measure(value, measurer);\n if (this.keyedBy === SubTypeKey.ENUM) {\n measurer.add(1);\n } else if (value !== MaxValue) {\n measurer.add(value.type.length + 1);\n } else {\n return measurer.unbounded;\n }\n if (value === MaxValue) {\n const biggestSubType = Object.values(this.subTypeMap).map((subType) => {\n const forkedMeasurer = measurer.fork();\n for (const prop of Object.values(subType.properties)) {\n prop.measure(MaxValue, forkedMeasurer);\n }\n return [subType, forkedMeasurer.size];\n }).reduce((a, b) => a[1] > b[1] ? a : b)[0];\n for (const prop of Object.values(biggestSubType.properties)) {\n prop.measure(MaxValue, measurer);\n }\n } else {\n const subTypeKey = value.type;\n const subTypeDescription = this.subTypeMap[subTypeKey] || null;\n if (subTypeDescription === null) {\n throw new Error(\n `Unknown sub-type '${subTypeKey.toString()}', expected one of '${JSON.stringify(\n Object.keys(this.subTypeMap)\n )}'`\n );\n }\n for (const [key, prop] of /* @__PURE__ */ exactEntries(subTypeDescription.properties)) {\n prop.measure(value[key], measurer);\n }\n }\n return measurer;\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction generic(properties, subTypeMap) {\n return new GenericObjectSchema(SubTypeKey.STRING, properties, subTypeMap);\n}\n// @__NO_SIDE_EFFECTS__\nfunction genericEnum(properties, subTypeMap) {\n return new GenericObjectSchema(SubTypeKey.ENUM, properties, subTypeMap);\n}\n\n// src/structure/concat.ts\n// @__NO_SIDE_EFFECTS__\nfunction concat(objs) {\n return new ObjectSchema(\n Object.fromEntries(\n objs.flatMap(({ properties }) => Object.entries(properties))\n )\n );\n}\n\n// src/structure/dynamicArray.ts\nvar DynamicArraySchema = class extends Schema {\n constructor(_unstableElementType) {\n super();\n this._unstableElementType = _unstableElementType;\n __publicField(this, \"elementType\");\n this.elementType = _unstableElementType;\n }\n resolveReferences(ctx) {\n this.elementType = ctx.resolve(this._unstableElementType);\n }\n write(output, values) {\n output.writeUint32(values.length);\n for (const value of values) {\n this.elementType.write(output, value);\n }\n }\n read(input) {\n const array = [];\n const len = input.readUint32();\n for (let i = 0; i < len; ++i) {\n array.push(this.elementType.read(input));\n }\n return array;\n }\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Is `NaN` if the schema is unbounded. If you would like to know\n * how many bytes a particular value encoding will take up, use `.measure(value)`.\n *\n * Alias for `.measure(MaxValue).size`\n */\n get maxSize() {\n return this.measure(MaxValue).size;\n }\n measure(values, measurer = new Measurer()) {\n if (values === MaxValue) {\n return measurer.unbounded;\n }\n measurer.add(4);\n for (const value of values) {\n this.elementType.measure(value, measurer);\n }\n return measurer;\n }\n seekProperty(reference, prop) {\n if (typeof prop === \"symbol\") {\n return null;\n }\n const indexProp = Number.parseInt(String(prop), 10);\n if (Number.isNaN(indexProp)) {\n return null;\n }\n if (reference === MaxValue) {\n return {\n bufferOffset: this.elementType.measure(MaxValue).size * indexProp,\n schema: this.elementType\n };\n }\n if (indexProp >= reference.length) {\n return null;\n }\n const measurer = new Measurer();\n for (let i = 0; i < indexProp; ++i) {\n this.elementType.measure(reference[i], measurer);\n }\n return {\n bufferOffset: measurer.size,\n schema: this.elementType\n };\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction dynamicArrayOf(elementSchema) {\n return new DynamicArraySchema(elementSchema);\n}\n\n// src/structure/keyed.ts\nvar RefSchema = class {\n constructor(key) {\n __publicField(this, \"__unwrapped\");\n __publicField(this, \"ref\");\n this.ref = new Ref(key);\n }\n resolveReferences() {\n throw new UnresolvedReferenceError(\n \"Tried to resolve a reference directly. Do it through a RefResolver instead.\"\n );\n }\n read() {\n throw new UnresolvedReferenceError(\"Tried to read a reference directly. Resolve it instead.\");\n }\n write() {\n throw new UnresolvedReferenceError(\"Tried to write a reference directly. Resolve it instead.\");\n }\n measure() {\n throw new UnresolvedReferenceError(\n \"Tried to measure size of a reference directly. Resolve it instead.\"\n );\n }\n seekProperty() {\n throw new UnresolvedReferenceError(\n \"Tried to seek property of a reference directly. Resolve it instead.\"\n );\n }\n};\nvar RefResolve = class {\n constructor() {\n __publicField(this, \"registry\", {});\n }\n hasKey(key) {\n return this.registry[key] !== void 0;\n }\n register(key, schema) {\n this.registry[key] = schema;\n }\n resolve(unstableSchema) {\n if (unstableSchema instanceof RefSchema) {\n const ref = unstableSchema.ref;\n const key = ref.key;\n if (this.registry[key] !== void 0) {\n return this.registry[key];\n }\n throw new UnresolvedReferenceError(`Couldn't resolve reference to ${key}. Unknown key.`);\n }\n unstableSchema.resolveReferences(this);\n return unstableSchema;\n }\n};\nvar KeyedSchema = class {\n constructor(key, innerResolver) {\n this.key = key;\n __publicField(this, \"__unwrapped\");\n __publicField(this, \"__keyDefinition\");\n __publicField(this, \"innerType\");\n this.innerType = innerResolver(new RefSchema(key));\n this.resolveReferences(new RefResolve());\n }\n resolveReferences(ctx) {\n if (!ctx.hasKey(this.key)) {\n ctx.register(this.key, this.innerType);\n this.innerType.resolveReferences(ctx);\n }\n }\n read(input) {\n return this.innerType.read(input);\n }\n write(output, value) {\n this.innerType.write(output, value);\n }\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Is `NaN` if the schema is unbounded. If you would like to know\n * how many bytes a particular value encoding will take up, use `.measure(value)`.\n *\n * Alias for `.measure(MaxValue).size`\n */\n get maxSize() {\n return this.measure(MaxValue).size;\n }\n measure(value, measurer = new Measurer()) {\n return this.innerType.measure(value, measurer);\n }\n seekProperty(reference, prop) {\n return this.innerType.seekProperty(reference, prop);\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction keyed(key, inner) {\n return new KeyedSchema(key, inner);\n}\n\n// src/structure/optional.ts\nvar OptionalSchema = class extends Schema {\n constructor(_innerUnstableSchema) {\n super();\n this._innerUnstableSchema = _innerUnstableSchema;\n __publicField(this, \"innerSchema\");\n this.innerSchema = _innerUnstableSchema;\n }\n resolveReferences(ctx) {\n this.innerSchema = ctx.resolve(this._innerUnstableSchema);\n }\n write(output, value) {\n if (value !== void 0 && value !== null) {\n output.writeBool(true);\n this.innerSchema.write(output, value);\n } else {\n output.writeBool(false);\n }\n }\n read(input) {\n const valueExists = input.readBool();\n if (valueExists) {\n return this.innerSchema.read(input);\n }\n return void 0;\n }\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Is `NaN` if the schema is unbounded. If you would like to know\n * how many bytes a particular value encoding will take up, use `.measure(value)`.\n *\n * Alias for `.measure(MaxValue).size`\n */\n get maxSize() {\n return this.measure(MaxValue).size;\n }\n measure(value, measurer = new Measurer()) {\n if (value !== void 0) {\n this.innerSchema.measure(value, measurer);\n }\n return measurer.add(1);\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction optional(innerType) {\n return new OptionalSchema(innerType);\n}\n\n// src/structure/tuple.ts\n// @__NO_SIDE_EFFECTS__\nfunction resolveArray(ctx, refs) {\n return refs.map((ref) => ctx.resolve(ref));\n}\nvar TupleSchema = class extends Schema {\n constructor(_unstableSchemas) {\n super();\n this._unstableSchemas = _unstableSchemas;\n __publicField(this, \"schemas\");\n this.schemas = _unstableSchemas;\n }\n resolveReferences(ctx) {\n this.schemas = /* @__PURE__ */ resolveArray(ctx, this._unstableSchemas);\n }\n write(output, values) {\n if (values.length !== this.schemas.length) {\n throw new ValidationError(\n `Expected tuple of length ${this.schemas.length}, got ${values.length}`\n );\n }\n for (let i = 0; i < this.schemas.length; ++i) {\n this.schemas[i].write(output, values[i]);\n }\n }\n read(input) {\n const array = [];\n for (let i = 0; i < this.schemas.length; ++i) {\n array.push(this.schemas[i].read(input));\n }\n return array;\n }\n /**\n * The maximum number of bytes this schema can take up.\n *\n * Is `NaN` if the schema is unbounded. If you would like to know\n * how many bytes a particular value encoding will take up, use `.measure(value)`.\n *\n * Alias for `.measure(MaxValue).size`\n */\n get maxSize() {\n return this.measure(MaxValue).size;\n }\n measure(values, measurer = new Measurer()) {\n for (let i = 0; i < this.schemas.length; ++i) {\n this.schemas[i].measure(values === MaxValue ? MaxValue : values[i], measurer);\n }\n return measurer;\n }\n};\n// @__NO_SIDE_EFFECTS__\nfunction tupleOf(schemas) {\n return new TupleSchema(schemas);\n}\n\n// src/structure/typedArray.ts\nvar TypedArraySchema = class extends Schema {\n constructor(length, _arrayConstructor) {\n super();\n this.length = length;\n this._arrayConstructor = _arrayConstructor;\n __publicField(this, \"byteLength\");\n this.byteLength = length * _arrayConstructor.BYTES_PER_ELEMENT;\n }\n write(output, value) {\n output.writeSlice(value);\n }\n read(input) {\n const buffer = new ArrayBuffer(this.byteLength);\n const view = new this._arrayConstructor(buffer, 0, this.length);\n input.readSlice(view, 0, this.byteLength);\n return view;\n }\n measure(_value, measurer = new Measurer()) {\n return measurer.add(this.byteLength);\n }\n};\nvar u8Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Uint8Array);\nvar u8ClampedArray = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Uint8ClampedArray);\nvar u16Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Uint16Array);\nvar u32Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Uint32Array);\nvar i8Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Int8Array);\nvar i16Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Int16Array);\nvar i32Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Int32Array);\nvar f32Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Float32Array);\nvar f64Array = /* @__NO_SIDE_EFFECTS__ */ (length) => new TypedArraySchema(length, Float64Array);\n\n// src/util.ts\n// @__NO_SIDE_EFFECTS__\nfunction isSystemBigEndian() {\n const array = new Uint8Array(4);\n const view = new Uint32Array(array.buffer);\n view[0] = 1;\n return array[0] === 0;\n}\n// @__NO_SIDE_EFFECTS__\nfunction getSystemEndianness() {\n return /* @__PURE__ */ isSystemBigEndian() ? \"big\" : \"little\";\n}\n\n// src/io/unwrapBuffer.ts\n// @__NO_SIDE_EFFECTS__\nfunction unwrapBuffer(buffer) {\n let byteOffset = 0;\n let innerBuffer = buffer;\n if (!!innerBuffer && \"buffer\" in innerBuffer && \"byteOffset\" in innerBuffer) {\n byteOffset += innerBuffer.byteOffset;\n innerBuffer = innerBuffer.buffer;\n }\n return { buffer: innerBuffer, byteOffset, byteLength: buffer.byteLength };\n}\n\n// src/io/bufferIOBase.ts\nvar BufferIOBase = class {\n constructor(buffer, options) {\n __publicField(this, \"dataView\");\n __publicField(this, \"littleEndian\");\n __publicField(this, \"needsByteSwap\");\n __publicField(this, \"byteOffset\", 0);\n __publicField(this, \"endianness\");\n const { byteOffset = 0, endianness = \"system\" } = options != null ? options : {};\n this.byteOffset = byteOffset;\n const systemEndianness = getSystemEndianness();\n this.endianness = endianness === \"system\" ? systemEndianness : endianness;\n this.littleEndian = this.endianness === \"little\";\n this.needsByteSwap = this.endianness !== systemEndianness;\n const unwrapped = unwrapBuffer(buffer);\n this.byteOffset += unwrapped.byteOffset;\n this.dataView = new DataView(unwrapped.buffer);\n }\n get currentByteOffset() {\n return this.byteOffset;\n }\n seekTo(offset) {\n this.byteOffset = offset;\n }\n skipBytes(bytes) {\n this.byteOffset += bytes;\n }\n};\n\n// src/io/bufferReader.ts\nvar BufferReader = class extends BufferIOBase {\n constructor() {\n super(...arguments);\n __publicField(this, \"_cachedTextDecoder\");\n }\n get _textDecoder() {\n if (!this._cachedTextDecoder) {\n this._cachedTextDecoder = new TextDecoder(void 0, { fatal: true });\n }\n return this._cachedTextDecoder;\n }\n readBool() {\n return this.dataView.getUint8(this.byteOffset++) !== 0;\n }\n readByte() {\n return this.dataView.getUint8(this.byteOffset++);\n }\n readInt8() {\n return this.dataView.getInt8(this.byteOffset++);\n }\n readUint8() {\n return this.dataView.getUint8(this.byteOffset++);\n }\n readInt16() {\n const value = this.dataView.getInt16(this.byteOffset, this.littleEndian);\n this.byteOffset += 2;\n return value;\n }\n readUint16() {\n const value = this.dataView.getUint16(this.byteOffset, this.littleEndian);\n this.byteOffset += 2;\n return value;\n }\n readInt32() {\n const value = this.dataView.getInt32(this.byteOffset, this.littleEndian);\n this.byteOffset += 4;\n return value;\n }\n readUint32() {\n const value = this.dataView.getUint32(this.byteOffset, this.littleEndian);\n this.byteOffset += 4;\n return value;\n }\n readFloat16() {\n const value = this.dataView.getFloat16(this.byteOffset, this.littleEndian);\n this.byteOffset += 2;\n return value;\n }\n readFloat32() {\n const value = this.dataView.getFloat32(this.byteOffset, this.littleEndian);\n this.byteOffset += 4;\n return value;\n }\n readString() {\n let strLength = 0;\n while (this.byteOffset + strLength < this.dataView.byteLength) {\n if (this.dataView.getUint8(this.byteOffset + strLength++) === 0) {\n break;\n }\n }\n const result = this._textDecoder.decode(\n new Uint8Array(this.dataView.buffer, this.byteOffset, strLength - 1)\n );\n this.byteOffset += strLength;\n return result;\n }\n readSlice(bufferView, offset, byteLength) {\n const unwrapped = unwrapBuffer(bufferView);\n const destU8 = new Uint8Array(unwrapped.buffer, unwrapped.byteOffset + offset);\n const bytesPerElement = bufferView.BYTES_PER_ELEMENT;\n if (this.needsByteSwap && bytesPerElement > 1) {\n for (let i = 0; i < byteLength; i += bytesPerElement) {\n for (let j = bytesPerElement - 1; j >= 0; j--) {\n destU8[i + j] = this.dataView.getUint8(this.byteOffset++);\n }\n }\n } else {\n destU8.set(new Uint8Array(this.dataView.buffer, this.byteOffset, byteLength));\n this.byteOffset += byteLength;\n }\n }\n};\n\n// src/io/bufferWriter.ts\nvar BufferWriter = class extends BufferIOBase {\n constructor() {\n super(...arguments);\n __publicField(this, \"_cachedTextEncoder\");\n }\n get _textEncoder() {\n if (!this._cachedTextEncoder) {\n this._cachedTextEncoder = new TextEncoder();\n }\n return this._cachedTextEncoder;\n }\n writeBool(value) {\n this.dataView.setUint8(this.byteOffset++, value ? 1 : 0);\n }\n writeByte(value) {\n this.dataView.setUint8(this.byteOffset++, value);\n }\n writeInt8(value) {\n this.dataView.setInt8(this.byteOffset++, value);\n }\n writeUint8(value) {\n this.dataView.setUint8(this.byteOffset++, value);\n }\n writeInt16(value) {\n this.dataView.setInt16(this.byteOffset, value, this.littleEndian);\n this.byteOffset += 2;\n }\n writeUint16(value) {\n this.dataView.setUint16(this.byteOffset, value, this.littleEndian);\n this.byteOffset += 2;\n }\n writeInt32(value) {\n this.dataView.setInt32(this.byteOffset, value, this.littleEndian);\n this.byteOffset += 4;\n }\n writeUint32(value) {\n this.dataView.setUint32(this.byteOffset, value, this.littleEndian);\n this.byteOffset += 4;\n }\n writeFloat16(value) {\n this.dataView.setFloat16(this.byteOffset, value, this.littleEndian);\n this.byteOffset += 2;\n }\n writeFloat32(value) {\n this.dataView.setFloat32(this.byteOffset, value, this.littleEndian);\n this.byteOffset += 4;\n }\n writeString(value) {\n const result = this._textEncoder.encodeInto(\n value,\n new Uint8Array(this.dataView.buffer, this.byteOffset)\n );\n this.byteOffset += result.written;\n this.dataView.setUint8(this.byteOffset++, 0);\n }\n writeSlice(bufferView) {\n const unwrapped = unwrapBuffer(bufferView);\n const srcU8 = new Uint8Array(unwrapped.buffer, unwrapped.byteOffset, unwrapped.byteLength);\n const bytesPerElement = bufferView.BYTES_PER_ELEMENT;\n if (this.needsByteSwap && bytesPerElement > 1) {\n for (let i = 0; i < srcU8.length; i += bytesPerElement) {\n for (let j = bytesPerElement - 1; j >= 0; j--) {\n this.dataView.setUint8(this.byteOffset++, srcU8[i + j]);\n }\n }\n } else {\n new Uint8Array(this.dataView.buffer, this.byteOffset).set(srcU8);\n this.byteOffset += srcU8.length;\n }\n }\n};\n\n// src/index.ts\nvar src_default = main_api_exports;\nexport {\n ArraySchema,\n BoolSchema,\n BufferReader,\n BufferWriter,\n Uint8Schema as ByteSchema,\n CharsSchema,\n DynamicArraySchema,\n Float16Schema,\n Float32Schema,\n GenericObjectSchema,\n Int16Schema,\n Int32Schema,\n Int8Schema,\n KeyedSchema,\n MaxValue,\n Measurer,\n ObjectSchema,\n OptionalSchema,\n Schema,\n StringSchema,\n SubTypeKey,\n TupleSchema,\n TypedArraySchema,\n Uint16Schema,\n Uint32Schema,\n Uint8Schema,\n UnresolvedReferenceError,\n ValidationError,\n arrayOf,\n main_api_exports as bin,\n bool,\n byte,\n chars,\n concat,\n src_default as default,\n dynamicArrayOf,\n f16,\n f32,\n f32Array,\n f64Array,\n generic,\n genericEnum,\n getSystemEndianness,\n i16,\n i16Array,\n i32,\n i32Array,\n i8,\n i8Array,\n keyed,\n object,\n optional,\n string,\n tupleOf,\n u16,\n u16Array,\n u32,\n u32Array,\n u8,\n u8Array,\n u8ClampedArray\n};\n//# sourceMappingURL=index.js.map","import { isUnstruct } from \"./dataTypes.js\";\nimport { alignmentOf, customAlignmentOf } from \"./alignmentOf.js\";\nimport { roundUp } from \"../mathUtils.js\";\nimport { sizeOf } from \"./sizeOf.js\";\nimport alignIO from \"./alignIO.js\";\nimport { Measurer } from \"typed-binary\";\n\n//#region src/data/offsets.ts\nconst cachedOffsets = /* @__PURE__ */ new WeakMap();\nfunction offsetsForProps(struct) {\n\tconst cached = cachedOffsets.get(struct);\n\tif (cached) return cached;\n\tconst measurer = new Measurer();\n\tconst offsets = {};\n\tlet lastEntry;\n\tfor (const key in struct.propTypes) {\n\t\tconst prop = struct.propTypes[key];\n\t\tif (prop === void 0) throw new Error(`Property ${key} is undefined in struct`);\n\t\tconst beforeAlignment = measurer.size;\n\t\talignIO(measurer, isUnstruct(struct) ? customAlignmentOf(prop) : alignmentOf(prop));\n\t\tif (lastEntry) lastEntry.padding = measurer.size - beforeAlignment;\n\t\tconst propSize = sizeOf(prop);\n\t\toffsets[key] = {\n\t\t\toffset: measurer.size,\n\t\t\tsize: propSize\n\t\t};\n\t\tlastEntry = offsets[key];\n\t\tmeasurer.add(propSize);\n\t}\n\tif (lastEntry) lastEntry.padding = roundUp(sizeOf(struct), alignmentOf(struct)) - measurer.size;\n\tcachedOffsets.set(struct, offsets);\n\treturn offsets;\n}\n\n//#endregion\nexport { offsetsForProps };","import { isAtomic, isDecorated, isMat, isMat2x2f, isMat3x3f, isVec, isVecBool, isWgslArray, isWgslStruct } from \"./wgslTypes.js\";\nimport { isDisarray, isUnstruct } from \"./dataTypes.js\";\nimport { formatToWGSLType, isPackedData } from \"./vertexFormatData.js\";\nimport { alignmentOf } from \"./alignmentOf.js\";\nimport { roundUp } from \"../mathUtils.js\";\nimport { sizeOf } from \"./sizeOf.js\";\nimport { offsetsForProps } from \"./offsets.js\";\n\n//#region src/data/compiledIO.ts\nconst EVAL_ALLOWED_IN_ENV = (() => {\n\ttry {\n\t\tnew Function(\"return true\");\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n})();\nconst compiledWriters = /* @__PURE__ */ new WeakMap();\nconst typeToPrimitive = {\n\tu32: \"u32\",\n\tvec2u: \"u32\",\n\tvec3u: \"u32\",\n\tvec4u: \"u32\",\n\tu16: \"u16\",\n\ti32: \"i32\",\n\tvec2i: \"i32\",\n\tvec3i: \"i32\",\n\tvec4i: \"i32\",\n\tf32: \"f32\",\n\tvec2f: \"f32\",\n\tvec3f: \"f32\",\n\tvec4f: \"f32\",\n\tf16: \"f16\",\n\tvec2h: \"f16\",\n\tvec3h: \"f16\",\n\tvec4h: \"f16\",\n\tmat2x2f: \"f32\",\n\tmat3x3f: \"f32\",\n\tmat4x4f: \"f32\"\n};\nconst vertexFormatToPrimitive = {\n\tuint8: \"u8\",\n\tuint8x2: \"u8\",\n\tuint8x4: \"u8\",\n\tsint8: \"i8\",\n\tsint8x2: \"i8\",\n\tsint8x4: \"i8\",\n\tunorm8: \"u8\",\n\tunorm8x2: \"u8\",\n\tunorm8x4: \"u8\",\n\tsnorm8: \"i8\",\n\tsnorm8x2: \"i8\",\n\tsnorm8x4: \"i8\",\n\tuint16: \"u16\",\n\tuint16x2: \"u16\",\n\tuint16x4: \"u16\",\n\tsint16: \"i16\",\n\tsint16x2: \"i16\",\n\tsint16x4: \"i16\",\n\tunorm16: \"u16\",\n\tunorm16x2: \"u16\",\n\tunorm16x4: \"u16\",\n\tsnorm16: \"i16\",\n\tsnorm16x2: \"i16\",\n\tsnorm16x4: \"i16\",\n\tfloat16: \"f16\",\n\tfloat16x2: \"f16\",\n\tfloat16x4: \"f16\",\n\tfloat32: \"f32\",\n\tfloat32x2: \"f32\",\n\tfloat32x3: \"f32\",\n\tfloat32x4: \"f32\",\n\tuint32: \"u32\",\n\tuint32x2: \"u32\",\n\tuint32x3: \"u32\",\n\tuint32x4: \"u32\",\n\tsint32: \"i32\",\n\tsint32x2: \"i32\",\n\tsint32x3: \"i32\",\n\tsint32x4: \"i32\"\n};\nconst primitiveToWriteFunction = {\n\tu32: \"setUint32\",\n\ti32: \"setInt32\",\n\tf32: \"setFloat32\",\n\tu16: \"setUint16\",\n\ti16: \"setInt16\",\n\tf16: \"setFloat16\",\n\tu8: \"setUint8\",\n\ti8: \"setInt8\"\n};\n/**\n* @privateRemarks\n* based on the `Channel Formats` table https://www.w3.org/TR/WGSL/#texel-formats\n*/\nconst vertexFormatValueTransform = {\n\tunorm8: (value) => `Math.round(${value} * 255)`,\n\tunorm8x2: (value) => `Math.round(${value} * 255)`,\n\tunorm8x4: (value) => `Math.round(${value} * 255)`,\n\tsnorm8: (value) => `Math.round(${value} * 127)`,\n\tsnorm8x2: (value) => `Math.round(${value} * 127)`,\n\tsnorm8x4: (value) => `Math.round(${value} * 127)`,\n\tunorm16: (value) => `Math.round(${value} * 65535)`,\n\tunorm16x2: (value) => `Math.round(${value} * 65535)`,\n\tunorm16x4: (value) => `Math.round(${value} * 65535)`,\n\tsnorm16: (value) => `Math.round(${value} * 32767)`,\n\tsnorm16x2: (value) => `Math.round(${value} * 32767)`,\n\tsnorm16x4: (value) => `Math.round(${value} * 32767)`\n};\nconst specialPackedFormats = {\n\t\"unorm10-10-10-2\": {\n\t\twriteFunction: \"setUint32\",\n\t\tgenerator: (offsetExpr, valueExpr) => `output.setUint32(${offsetExpr}, ((${valueExpr}.x*1023&0x3FF)<<22)|((${valueExpr}.y*1023&0x3FF)<<12)|((${valueExpr}.z*1023&0x3FF)<<2)|(${valueExpr}.w*3&3), littleEndian);\\n`\n\t},\n\t\"unorm8x4-bgra\": {\n\t\twriteFunction: \"setUint8\",\n\t\tgenerator: (offsetExpr, valueExpr) => {\n\t\t\tconst bgraComponents = [\n\t\t\t\t\"z\",\n\t\t\t\t\"y\",\n\t\t\t\t\"x\",\n\t\t\t\t\"w\"\n\t\t\t];\n\t\t\tlet code = \"\";\n\t\t\tfor (let idx = 0; idx < 4; idx++) code += `output.setUint8((${offsetExpr} + ${idx}), Math.round(${valueExpr}.${bgraComponents[idx]} * 255), littleEndian);\\n`;\n\t\t\treturn code;\n\t\t}\n\t}\n};\nfunction buildWriter(node, offsetExpr, valueExpr, depth = 0) {\n\tconst loopVar = [\n\t\t\"i\",\n\t\t\"j\",\n\t\t\"k\"\n\t][depth] || `i${depth}`;\n\tif (isAtomic(node) || isDecorated(node)) return buildWriter(node.inner, offsetExpr, valueExpr, depth);\n\tif (isWgslStruct(node) || isUnstruct(node)) {\n\t\tconst propOffsets = offsetsForProps(node);\n\t\tlet code = \"\";\n\t\tfor (const [key, propOffset] of Object.entries(propOffsets)) {\n\t\t\tconst subSchema = node.propTypes[key];\n\t\t\tif (!subSchema) continue;\n\t\t\tcode += buildWriter(subSchema, `(${offsetExpr} + ${propOffset.offset})`, `${valueExpr}.${key}`, depth);\n\t\t}\n\t\treturn code;\n\t}\n\tif (isWgslArray(node) || isDisarray(node)) {\n\t\tconst elementSize = roundUp(sizeOf(node.elementType), alignmentOf(node));\n\t\tlet code = \"\";\n\t\tcode += `for (let ${loopVar} = 0; ${loopVar} < ${node.elementCount}; ${loopVar}++) {\\n`;\n\t\tcode += buildWriter(node.elementType, `(${offsetExpr} + ${loopVar} * ${elementSize})`, `${valueExpr}[${loopVar}]`, depth + 1);\n\t\tcode += \"}\\n\";\n\t\treturn code;\n\t}\n\tif (isVec(node)) {\n\t\tif (isVecBool(node)) throw new Error(\"Compiled writers do not support boolean vectors\");\n\t\tconst primitive = typeToPrimitive[node.type];\n\t\tlet code = \"\";\n\t\tconst writeFunc = primitiveToWriteFunction[primitive];\n\t\tconst components = [\n\t\t\t\"x\",\n\t\t\t\"y\",\n\t\t\t\"z\",\n\t\t\t\"w\"\n\t\t];\n\t\tfor (let i = 0; i < node.componentCount; i++) code += `output.${writeFunc}((${offsetExpr} + ${i * 4}), ${valueExpr}.${components[i]}, littleEndian);\\n`;\n\t\treturn code;\n\t}\n\tif (isMat(node)) {\n\t\tconst writeFunc = primitiveToWriteFunction[typeToPrimitive[node.type]];\n\t\tconst matSize = isMat2x2f(node) ? 2 : isMat3x3f(node) ? 3 : 4;\n\t\tconst elementCount = matSize * matSize;\n\t\tconst rowStride = roundUp(matSize * 4, 8);\n\t\tlet code = \"\";\n\t\tfor (let idx = 0; idx < elementCount; idx++) {\n\t\t\tconst colIndex = Math.floor(idx / matSize);\n\t\t\tconst rowIndex = idx % matSize;\n\t\t\tconst byteOffset = colIndex * rowStride + rowIndex * 4;\n\t\t\tcode += `output.${writeFunc}((${offsetExpr} + ${byteOffset}), ${valueExpr}.columns[${colIndex}].${[\n\t\t\t\t\"x\",\n\t\t\t\t\"y\",\n\t\t\t\t\"z\",\n\t\t\t\t\"w\"\n\t\t\t][rowIndex]}, littleEndian);\\n`;\n\t\t}\n\t\treturn code;\n\t}\n\tif (isPackedData(node)) {\n\t\tconst formatName = node.type;\n\t\tif (formatName in specialPackedFormats) return specialPackedFormats[formatName].generator(offsetExpr, valueExpr);\n\t\tconst primitive = vertexFormatToPrimitive[formatName];\n\t\tconst writeFunc = primitiveToWriteFunction[primitive];\n\t\tconst wgslType = formatToWGSLType[formatName];\n\t\tconst componentCount = isVec(wgslType) ? wgslType.componentCount : 1;\n\t\tconst componentSize = primitive === \"u8\" || primitive === \"i8\" ? 1 : primitive === \"u16\" || primitive === \"i16\" || primitive === \"f16\" ? 2 : 4;\n\t\tconst components = [\n\t\t\t\"x\",\n\t\t\t\"y\",\n\t\t\t\"z\",\n\t\t\t\"w\"\n\t\t];\n\t\tconst transform = vertexFormatValueTransform[formatName];\n\t\tlet code = \"\";\n\t\tfor (let idx = 0; idx < componentCount; idx++) {\n\t\t\tconst accessor = componentCount === 1 ? valueExpr : `${valueExpr}.${components[idx]}`;\n\t\t\tconst value = transform ? transform(accessor) : accessor;\n\t\t\tcode += `output.${writeFunc}((${offsetExpr} + ${idx * componentSize}), ${value}, littleEndian);\\n`;\n\t\t}\n\t\treturn code;\n\t}\n\tif (!Object.hasOwn(typeToPrimitive, node.type)) throw new Error(`Primitive ${node.type} is unsupported by compiled writer`);\n\treturn `output.${primitiveToWriteFunction[typeToPrimitive[node.type]]}(${offsetExpr}, ${valueExpr}, littleEndian);\\n`;\n}\nfunction getCompiledWriterForSchema(schema) {\n\tif (!EVAL_ALLOWED_IN_ENV) {\n\t\tconsole.warn(\"This environment does not allow eval - using default writer as fallback\");\n\t\treturn;\n\t}\n\tif (compiledWriters.has(schema)) return compiledWriters.get(schema);\n\ttry {\n\t\tconst body = buildWriter(schema, \"offset\", \"value\", 0);\n\t\tconst fn = new Function(\"output\", \"offset\", \"value\", \"littleEndian=true\", body);\n\t\tcompiledWriters.set(schema, fn);\n\t\treturn fn;\n\t} catch (error) {\n\t\tconsole.warn(`Failed to compile writer for schema: ${schema}\\nReason: ${error instanceof Error ? error.message : String(error)}\\nFalling back to default writer`);\n\t}\n}\n\n//#endregion\nexport { getCompiledWriterForSchema };","import { vec2f, vec2h, vec2i, vec2u, vec3f, vec3h, vec3i, vec3u, vec4f, vec4h, vec4i, vec4u } from \"./vector.js\";\nimport { alignmentOf, customAlignmentOf } from \"./alignmentOf.js\";\nimport { sizeOf } from \"./sizeOf.js\";\nimport { mat2x2f, mat3x3f, mat4x4f } from \"./matrix.js\";\nimport alignIO from \"./alignIO.js\";\n\n//#region src/data/dataIO.ts\nconst dataWriters = {\n\tbool() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\tf32(output, _schema, value) {\n\t\toutput.writeFloat32(value);\n\t},\n\tf16(output, _schema, value) {\n\t\toutput.writeFloat16(value);\n\t},\n\ti32(output, _schema, value) {\n\t\toutput.writeInt32(value);\n\t},\n\tu32(output, _schema, value) {\n\t\toutput.writeUint32(value);\n\t},\n\tu16(output, _schema, value) {\n\t\toutput.writeUint16(value);\n\t},\n\tvec2f(output, _, value) {\n\t\toutput.writeFloat32(value.x);\n\t\toutput.writeFloat32(value.y);\n\t},\n\tvec2h(output, _, value) {\n\t\toutput.writeFloat16(value.x);\n\t\toutput.writeFloat16(value.y);\n\t},\n\tvec2i(output, _, value) {\n\t\toutput.writeInt32(value.x);\n\t\toutput.writeInt32(value.y);\n\t},\n\tvec2u(output, _, value) {\n\t\toutput.writeUint32(value.x);\n\t\toutput.writeUint32(value.y);\n\t},\n\t\"vec2<bool>\"() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\tvec3f(output, _, value) {\n\t\toutput.writeFloat32(value.x);\n\t\toutput.writeFloat32(value.y);\n\t\toutput.writeFloat32(value.z);\n\t},\n\tvec3h(output, _, value) {\n\t\toutput.writeFloat16(value.x);\n\t\toutput.writeFloat16(value.y);\n\t\toutput.writeFloat16(value.z);\n\t},\n\tvec3i(output, _, value) {\n\t\toutput.writeInt32(value.x);\n\t\toutput.writeInt32(value.y);\n\t\toutput.writeInt32(value.z);\n\t},\n\tvec3u(output, _, value) {\n\t\toutput.writeUint32(value.x);\n\t\toutput.writeUint32(value.y);\n\t\toutput.writeUint32(value.z);\n\t},\n\t\"vec3<bool>\"() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\tvec4f(output, _, value) {\n\t\toutput.writeFloat32(value.x);\n\t\toutput.writeFloat32(value.y);\n\t\toutput.writeFloat32(value.z);\n\t\toutput.writeFloat32(value.w);\n\t},\n\tvec4h(output, _, value) {\n\t\toutput.writeFloat16(value.x);\n\t\toutput.writeFloat16(value.y);\n\t\toutput.writeFloat16(value.z);\n\t\toutput.writeFloat16(value.w);\n\t},\n\tvec4i(output, _, value) {\n\t\toutput.writeInt32(value.x);\n\t\toutput.writeInt32(value.y);\n\t\toutput.writeInt32(value.z);\n\t\toutput.writeInt32(value.w);\n\t},\n\tvec4u(output, _, value) {\n\t\toutput.writeUint32(value.x);\n\t\toutput.writeUint32(value.y);\n\t\toutput.writeUint32(value.z);\n\t\toutput.writeUint32(value.w);\n\t},\n\t\"vec4<bool>\"() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\tmat2x2f(output, _, value) {\n\t\tfor (let i = 0; i < value.length; ++i) output.writeFloat32(value[i]);\n\t},\n\tmat3x3f(output, _, value) {\n\t\tfor (let i = 0; i < value.length; ++i) output.writeFloat32(value[i]);\n\t},\n\tmat4x4f(output, _, value) {\n\t\tfor (let i = 0; i < value.length; ++i) output.writeFloat32(value[i]);\n\t},\n\tstruct(output, schema, value) {\n\t\tconst alignment = alignmentOf(schema);\n\t\talignIO(output, alignment);\n\t\tfor (const [key, property] of Object.entries(schema.propTypes)) {\n\t\t\talignIO(output, alignmentOf(property));\n\t\t\twriteData(output, property, value[key]);\n\t\t}\n\t\talignIO(output, alignment);\n\t},\n\tarray(output, schema, value) {\n\t\tif (schema.elementCount === 0) throw new Error(\"Cannot write using a runtime-sized schema.\");\n\t\tconst alignment = alignmentOf(schema);\n\t\talignIO(output, alignment);\n\t\tconst beginning = output.currentByteOffset;\n\t\tfor (let i = 0; i < Math.min(schema.elementCount, value.length); i++) {\n\t\t\talignIO(output, alignment);\n\t\t\twriteData(output, schema.elementType, value[i]);\n\t\t}\n\t\toutput.seekTo(beginning + sizeOf(schema));\n\t},\n\tptr() {\n\t\tthrow new Error(\"Pointers are not host-shareable\");\n\t},\n\tatomic(output, schema, value) {\n\t\tdataWriters[schema.inner.type]?.(output, schema, value);\n\t},\n\tdecorated(output, schema, value) {\n\t\talignIO(output, customAlignmentOf(schema));\n\t\tconst beginning = output.currentByteOffset;\n\t\tdataWriters[schema.inner?.type]?.(output, schema.inner, value);\n\t\toutput.seekTo(beginning + sizeOf(schema));\n\t},\n\tuint8(output, _, value) {\n\t\toutput.writeUint8(value);\n\t},\n\tuint8x2(output, _, value) {\n\t\toutput.writeUint8(value.x);\n\t\toutput.writeUint8(value.y);\n\t},\n\tuint8x4(output, _, value) {\n\t\toutput.writeUint8(value.x);\n\t\toutput.writeUint8(value.y);\n\t\toutput.writeUint8(value.z);\n\t\toutput.writeUint8(value.w);\n\t},\n\tsint8(output, _, value) {\n\t\toutput.writeInt8(value);\n\t},\n\tsint8x2(output, _, value) {\n\t\toutput.writeInt8(value.x);\n\t\toutput.writeInt8(value.y);\n\t},\n\tsint8x4(output, _, value) {\n\t\toutput.writeInt8(value.x);\n\t\toutput.writeInt8(value.y);\n\t\toutput.writeInt8(value.z);\n\t\toutput.writeInt8(value.w);\n\t},\n\tunorm8(output, _, value) {\n\t\toutput.writeUint8(Math.round(value * 255));\n\t},\n\tunorm8x2(output, _, value) {\n\t\toutput.writeUint8(Math.round(value.x * 255));\n\t\toutput.writeUint8(Math.round(value.y * 255));\n\t},\n\tunorm8x4(output, _, value) {\n\t\toutput.writeUint8(Math.round(value.x * 255));\n\t\toutput.writeUint8(Math.round(value.y * 255));\n\t\toutput.writeUint8(Math.round(value.z * 255));\n\t\toutput.writeUint8(Math.round(value.w * 255));\n\t},\n\tsnorm8(output, _, value) {\n\t\toutput.writeInt8(Math.round(value * 127));\n\t},\n\tsnorm8x2(output, _, value) {\n\t\toutput.writeInt8(Math.round(value.x * 127));\n\t\toutput.writeInt8(Math.round(value.y * 127));\n\t},\n\tsnorm8x4(output, _, value) {\n\t\toutput.writeInt8(Math.round(value.x * 127));\n\t\toutput.writeInt8(Math.round(value.y * 127));\n\t\toutput.writeInt8(Math.round(value.z * 127));\n\t\toutput.writeInt8(Math.round(value.w * 127));\n\t},\n\tuint16(output, _, value) {\n\t\toutput.writeUint16(value);\n\t},\n\tuint16x2(output, _, value) {\n\t\toutput.writeUint16(value.x);\n\t\toutput.writeUint16(value.y);\n\t},\n\tuint16x4(output, _, value) {\n\t\toutput.writeUint16(value.x);\n\t\toutput.writeUint16(value.y);\n\t\toutput.writeUint16(value.z);\n\t\toutput.writeUint16(value.w);\n\t},\n\tsint16(output, _, value) {\n\t\toutput.writeInt16(value);\n\t},\n\tsint16x2(output, _, value) {\n\t\toutput.writeInt16(value.x);\n\t\toutput.writeInt16(value.y);\n\t},\n\tsint16x4(output, _, value) {\n\t\toutput.writeInt16(value.x);\n\t\toutput.writeInt16(value.y);\n\t\toutput.writeInt16(value.z);\n\t\toutput.writeInt16(value.w);\n\t},\n\tunorm16(output, _, value) {\n\t\toutput.writeUint16(value * 65535);\n\t},\n\tunorm16x2(output, _, value) {\n\t\toutput.writeUint16(value.x * 65535);\n\t\toutput.writeUint16(value.y * 65535);\n\t},\n\tunorm16x4(output, _, value) {\n\t\toutput.writeUint16(value.x * 65535);\n\t\toutput.writeUint16(value.y * 65535);\n\t\toutput.writeUint16(value.z * 65535);\n\t\toutput.writeUint16(value.w * 65535);\n\t},\n\tsnorm16(output, _, value) {\n\t\toutput.writeInt16(Math.round(value * 32767));\n\t},\n\tsnorm16x2(output, _, value) {\n\t\toutput.writeInt16(Math.round(value.x * 32767));\n\t\toutput.writeInt16(Math.round(value.y * 32767));\n\t},\n\tsnorm16x4(output, _, value) {\n\t\toutput.writeInt16(Math.round(value.x * 32767));\n\t\toutput.writeInt16(Math.round(value.y * 32767));\n\t\toutput.writeInt16(Math.round(value.z * 32767));\n\t\toutput.writeInt16(Math.round(value.w * 32767));\n\t},\n\tfloat16(output, _, value) {\n\t\toutput.writeFloat16(value);\n\t},\n\tfloat16x2(output, _, value) {\n\t\toutput.writeFloat16(value.x);\n\t\toutput.writeFloat16(value.y);\n\t},\n\tfloat16x4(output, _, value) {\n\t\toutput.writeFloat16(value.x);\n\t\toutput.writeFloat16(value.y);\n\t\toutput.writeFloat16(value.z);\n\t\toutput.writeFloat16(value.w);\n\t},\n\tfloat32(output, _, value) {\n\t\toutput.writeFloat32(value);\n\t},\n\tfloat32x2(output, _, value) {\n\t\toutput.writeFloat32(value.x);\n\t\toutput.writeFloat32(value.y);\n\t},\n\tfloat32x3(output, _, value) {\n\t\toutput.writeFloat32(value.x);\n\t\toutput.writeFloat32(value.y);\n\t\toutput.writeFloat32(value.z);\n\t},\n\tfloat32x4(output, _, value) {\n\t\toutput.writeFloat32(value.x);\n\t\toutput.writeFloat32(value.y);\n\t\toutput.writeFloat32(value.z);\n\t\toutput.writeFloat32(value.w);\n\t},\n\tuint32(output, _, value) {\n\t\toutput.writeUint32(value);\n\t},\n\tuint32x2(output, _, value) {\n\t\toutput.writeUint32(value.x);\n\t\toutput.writeUint32(value.y);\n\t},\n\tuint32x3(output, _, value) {\n\t\toutput.writeUint32(value.x);\n\t\toutput.writeUint32(value.y);\n\t\toutput.writeUint32(value.z);\n\t},\n\tuint32x4(output, _, value) {\n\t\toutput.writeUint32(value.x);\n\t\toutput.writeUint32(value.y);\n\t\toutput.writeUint32(value.z);\n\t\toutput.writeUint32(value.w);\n\t},\n\tsint32(output, _, value) {\n\t\toutput.writeInt32(value);\n\t},\n\tsint32x2(output, _, value) {\n\t\toutput.writeInt32(value.x);\n\t\toutput.writeInt32(value.y);\n\t},\n\tsint32x3(output, _, value) {\n\t\toutput.writeInt32(value.x);\n\t\toutput.writeInt32(value.y);\n\t\toutput.writeInt32(value.z);\n\t},\n\tsint32x4(output, _, value) {\n\t\toutput.writeInt32(value.x);\n\t\toutput.writeInt32(value.y);\n\t\toutput.writeInt32(value.z);\n\t\toutput.writeInt32(value.w);\n\t},\n\t\"unorm10-10-10-2\"(output, _, value) {\n\t\tlet packed = 0;\n\t\tpacked |= (value.x * 1023 & 1023) << 22;\n\t\tpacked |= (value.y * 1023 & 1023) << 12;\n\t\tpacked |= (value.z * 1023 & 1023) << 2;\n\t\tpacked |= value.w * 3 & 3;\n\t\toutput.writeUint32(packed);\n\t},\n\t\"unorm8x4-bgra\"(output, _, value) {\n\t\toutput.writeUint8(value.z * 255);\n\t\toutput.writeUint8(value.y * 255);\n\t\toutput.writeUint8(value.x * 255);\n\t\toutput.writeUint8(value.w * 255);\n\t},\n\tdisarray(output, schema, value) {\n\t\tconst alignment = alignmentOf(schema);\n\t\talignIO(output, alignment);\n\t\tconst beginning = output.currentByteOffset;\n\t\tfor (let i = 0; i < Math.min(schema.elementCount, value.length); i++) {\n\t\t\talignIO(output, alignment);\n\t\t\tdataWriters[schema.elementType?.type]?.(output, schema.elementType, value[i]);\n\t\t}\n\t\toutput.seekTo(beginning + sizeOf(schema));\n\t},\n\tunstruct(output, schema, value) {\n\t\tconst propTypes = schema.propTypes;\n\t\tfor (const [key, property] of Object.entries(propTypes)) dataWriters[property.type]?.(output, property, value[key]);\n\t},\n\t\"loose-decorated\"(output, schema, value) {\n\t\talignIO(output, customAlignmentOf(schema));\n\t\tconst beginning = output.currentByteOffset;\n\t\tconst writer = dataWriters[schema.inner?.type];\n\t\twriter?.(output, schema.inner, value);\n\t\toutput.seekTo(beginning + sizeOf(schema));\n\t\treturn value;\n\t}\n};\nfunction writeData(output, schema, value) {\n\tconst writer = dataWriters[schema.type];\n\tif (!writer) throw new Error(`Cannot write data of type '${schema.type}'.`);\n\twriter(output, schema, value);\n}\nconst dataReaders = {\n\tbool() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\tf32(input) {\n\t\treturn input.readFloat32();\n\t},\n\tf16(input) {\n\t\treturn input.readFloat16();\n\t},\n\ti32(input) {\n\t\treturn input.readInt32();\n\t},\n\tu32(input) {\n\t\treturn input.readUint32();\n\t},\n\tu16(input) {\n\t\treturn input.readUint16();\n\t},\n\tvec2f(input) {\n\t\treturn vec2f(input.readFloat32(), input.readFloat32());\n\t},\n\tvec3f(input) {\n\t\treturn vec3f(input.readFloat32(), input.readFloat32(), input.readFloat32());\n\t},\n\tvec4f(input) {\n\t\treturn vec4f(input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32());\n\t},\n\tvec2h(input) {\n\t\treturn vec2h(input.readFloat16(), input.readFloat16());\n\t},\n\tvec3h(input) {\n\t\treturn vec3h(input.readFloat16(), input.readFloat16(), input.readFloat16());\n\t},\n\tvec4h(input) {\n\t\treturn vec4h(input.readFloat16(), input.readFloat16(), input.readFloat16(), input.readFloat16());\n\t},\n\tvec2i(input) {\n\t\treturn vec2i(input.readInt32(), input.readInt32());\n\t},\n\tvec3i(input) {\n\t\treturn vec3i(input.readInt32(), input.readInt32(), input.readInt32());\n\t},\n\tvec4i(input) {\n\t\treturn vec4i(input.readInt32(), input.readInt32(), input.readInt32(), input.readInt32());\n\t},\n\tvec2u(input) {\n\t\treturn vec2u(input.readUint32(), input.readUint32());\n\t},\n\tvec3u(input) {\n\t\treturn vec3u(input.readUint32(), input.readUint32(), input.readUint32());\n\t},\n\tvec4u(input) {\n\t\treturn vec4u(input.readUint32(), input.readUint32(), input.readUint32(), input.readUint32());\n\t},\n\t\"vec2<bool>\"() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\t\"vec3<bool>\"() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\t\"vec4<bool>\"() {\n\t\tthrow new Error(\"Booleans are not host-shareable\");\n\t},\n\tmat2x2f(input) {\n\t\treturn mat2x2f(input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32());\n\t},\n\tmat3x3f(input) {\n\t\tconst skipOneAfter = () => {\n\t\t\tconst value = input.readFloat32();\n\t\t\tinput.readFloat32();\n\t\t\treturn value;\n\t\t};\n\t\treturn mat3x3f(input.readFloat32(), input.readFloat32(), skipOneAfter(), input.readFloat32(), input.readFloat32(), skipOneAfter(), input.readFloat32(), input.readFloat32(), skipOneAfter());\n\t},\n\tmat4x4f(input) {\n\t\treturn mat4x4f(input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32(), input.readFloat32());\n\t},\n\tstruct(input, schema) {\n\t\tconst alignment = alignmentOf(schema);\n\t\talignIO(input, alignment);\n\t\tconst result = {};\n\t\tconst propTypes = schema.propTypes;\n\t\tfor (const [key, property] of Object.entries(propTypes)) {\n\t\t\talignIO(input, alignmentOf(property));\n\t\t\tresult[key] = readData(input, property);\n\t\t}\n\t\talignIO(input, alignment);\n\t\treturn result;\n\t},\n\tarray(input, schema) {\n\t\tif (schema.elementCount === 0) throw new Error(\"Cannot read using a runtime-sized schema.\");\n\t\tconst alignment = alignmentOf(schema);\n\t\tconst elements = [];\n\t\tfor (let i = 0; i < schema.elementCount; i++) {\n\t\t\talignIO(input, alignment);\n\t\t\tconst elementType = schema.elementType;\n\t\t\tconst value = readData(input, elementType);\n\t\t\telements.push(value);\n\t\t}\n\t\talignIO(input, alignment);\n\t\treturn elements;\n\t},\n\tptr() {\n\t\tthrow new Error(\"Pointers are not host-shareable\");\n\t},\n\tatomic(input, schema) {\n\t\treturn readData(input, schema.inner);\n\t},\n\tdecorated(input, schema) {\n\t\talignIO(input, customAlignmentOf(schema));\n\t\tconst beginning = input.currentByteOffset;\n\t\tconst value = readData(input, schema.inner);\n\t\tinput.seekTo(beginning + sizeOf(schema));\n\t\treturn value;\n\t},\n\tuint8: (i) => i.readUint8(),\n\tuint8x2: (i) => vec2u(i.readUint8(), i.readUint8()),\n\tuint8x4: (i) => vec4u(i.readUint8(), i.readUint8(), i.readUint8(), i.readUint8()),\n\tsint8: (i) => i.readInt8(),\n\tsint8x2: (i) => {\n\t\treturn vec2i(i.readInt8(), i.readInt8());\n\t},\n\tsint8x4: (i) => vec4i(i.readInt8(), i.readInt8(), i.readInt8(), i.readInt8()),\n\tunorm8: (i) => i.readUint8() / 255,\n\tunorm8x2: (i) => vec2f(i.readUint8() / 255, i.readUint8() / 255),\n\tunorm8x4: (i) => vec4f(i.readUint8() / 255, i.readUint8() / 255, i.readUint8() / 255, i.readUint8() / 255),\n\tsnorm8: (i) => i.readInt8() / 127,\n\tsnorm8x2: (i) => vec2f(i.readInt8() / 127, i.readInt8() / 127),\n\tsnorm8x4: (i) => vec4f(i.readInt8() / 127, i.readInt8() / 127, i.readInt8() / 127, i.readInt8() / 127),\n\tuint16: (i) => i.readUint16(),\n\tuint16x2: (i) => vec2u(i.readUint16(), i.readUint16()),\n\tuint16x4: (i) => vec4u(i.readUint16(), i.readUint16(), i.readUint16(), i.readUint16()),\n\tsint16: (i) => i.readInt16(),\n\tsint16x2: (i) => vec2i(i.readInt16(), i.readInt16()),\n\tsint16x4: (i) => vec4i(i.readInt16(), i.readInt16(), i.readInt16(), i.readInt16()),\n\tunorm16: (i) => i.readUint16() / 65535,\n\tunorm16x2: (i) => vec2f(i.readUint16() / 65535, i.readUint16() / 65535),\n\tunorm16x4: (i) => vec4f(i.readUint16() / 65535, i.readUint16() / 65535, i.readUint16() / 65535, i.readUint16() / 65535),\n\tsnorm16: (i) => i.readInt16() / 32767,\n\tsnorm16x2: (i) => vec2f(i.readInt16() / 32767, i.readInt16() / 32767),\n\tsnorm16x4: (i) => vec4f(i.readInt16() / 32767, i.readInt16() / 32767, i.readInt16() / 32767, i.readInt16() / 32767),\n\tfloat16(i) {\n\t\treturn i.readFloat16();\n\t},\n\tfloat16x2: (i) => vec2f(i.readFloat16(), i.readFloat16()),\n\tfloat16x4: (i) => vec4f(i.readFloat16(), i.readFloat16(), i.readFloat16(), i.readFloat16()),\n\tfloat32: (i) => i.readFloat32(),\n\tfloat32x2: (i) => vec2f(i.readFloat32(), i.readFloat32()),\n\tfloat32x3: (i) => vec3f(i.readFloat32(), i.readFloat32(), i.readFloat32()),\n\tfloat32x4: (i) => vec4f(i.readFloat32(), i.readFloat32(), i.readFloat32(), i.readFloat32()),\n\tuint32: (i) => i.readUint32(),\n\tuint32x2: (i) => vec2u(i.readUint32(), i.readUint32()),\n\tuint32x3: (i) => vec3u(i.readUint32(), i.readUint32(), i.readUint32()),\n\tuint32x4: (i) => vec4u(i.readUint32(), i.readUint32(), i.readUint32(), i.readUint32()),\n\tsint32: (i) => i.readInt32(),\n\tsint32x2: (i) => vec2i(i.readInt32(), i.readInt32()),\n\tsint32x3: (i) => vec3i(i.readInt32(), i.readInt32(), i.readInt32()),\n\tsint32x4: (i) => vec4i(i.readInt32(), i.readInt32(), i.readInt32(), i.readInt32()),\n\t\"unorm10-10-10-2\"(i) {\n\t\tconst packed = i.readUint32();\n\t\treturn vec4f((packed >> 22) / 1023, (packed >> 12 & 1023) / 1023, (packed >> 2 & 1023) / 1023, (packed & 3) / 3);\n\t},\n\t\"unorm8x4-bgra\"(i) {\n\t\tconst b = i.readByte() / 255;\n\t\tconst g = i.readByte() / 255;\n\t\treturn vec4f(i.readByte() / 255, g, b, i.readByte() / 255);\n\t},\n\tunstruct(input, schema) {\n\t\tconst result = {};\n\t\tconst propTypes = schema.propTypes;\n\t\tfor (const [key, property] of Object.entries(propTypes)) result[key] = readData(input, property);\n\t\treturn result;\n\t},\n\tdisarray(input, schema) {\n\t\tconst alignment = alignmentOf(schema);\n\t\tconst elements = [];\n\t\tfor (let i = 0; i < schema.elementCount; i++) {\n\t\t\talignIO(input, alignment);\n\t\t\telements.push(readData(input, schema.elementType));\n\t\t}\n\t\talignIO(input, alignment);\n\t\treturn elements;\n\t},\n\t\"loose-decorated\"(input, schema) {\n\t\talignIO(input, customAlignmentOf(schema));\n\t\tconst beginning = input.currentByteOffset;\n\t\tconst value = readData(input, schema.inner);\n\t\tinput.seekTo(beginning + sizeOf(schema));\n\t\treturn value;\n\t}\n};\nfunction readData(input, schema) {\n\tconst reader = dataReaders[schema.type];\n\tif (!reader) throw new Error(`Cannot read data of type '${schema.type}'.`);\n\treturn reader(input, schema);\n}\n\n//#endregion\nexport { readData, writeData };","import { isWgslArray, isWgslStruct } from \"./wgslTypes.js\";\nimport { isDisarray, isUnstruct } from \"./dataTypes.js\";\nimport { alignmentOf } from \"./alignmentOf.js\";\nimport { roundUp } from \"../mathUtils.js\";\nimport { sizeOf } from \"./sizeOf.js\";\nimport { offsetsForProps } from \"./offsets.js\";\nimport { writeData } from \"./dataIO.js\";\nimport { BufferWriter } from \"typed-binary\";\n\n//#region src/data/partialIO.ts\nfunction getWriteInstructions(schema, data) {\n\tconst totalSize = sizeOf(schema);\n\tif (totalSize === 0 || data === void 0 || data === null) return [];\n\tconst bigBuffer = new ArrayBuffer(totalSize);\n\tconst writer = new BufferWriter(bigBuffer);\n\tconst segments = [];\n\tfunction gatherAndWrite(node, partialValue, offset, padding) {\n\t\tif (partialValue === void 0 || partialValue === null) return;\n\t\tif (isWgslStruct(node) || isUnstruct(node)) {\n\t\t\tconst propOffsets = offsetsForProps(node);\n\t\t\tfor (const [key, propOffset] of Object.entries(propOffsets)) {\n\t\t\t\tconst subSchema = node.propTypes[key];\n\t\t\t\tif (!subSchema) continue;\n\t\t\t\tconst childValue = partialValue[key];\n\t\t\t\tif (childValue !== void 0) gatherAndWrite(subSchema, childValue, offset + propOffset.offset, propOffset.padding ?? padding);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (isWgslArray(node) || isDisarray(node)) {\n\t\t\tconst arrSchema = node;\n\t\t\tconst elementSize = roundUp(sizeOf(arrSchema.elementType), alignmentOf(arrSchema.elementType));\n\t\t\tif (!Array.isArray(partialValue)) throw new Error(\"Partial value for array must be an array\");\n\t\t\tconst arrayPartialValue = partialValue ?? [];\n\t\t\tarrayPartialValue.sort((a, b) => a.idx - b.idx);\n\t\t\tfor (const { idx, value } of arrayPartialValue) gatherAndWrite(arrSchema.elementType, value, offset + idx * elementSize, elementSize - sizeOf(arrSchema.elementType));\n\t\t} else {\n\t\t\tconst leafSize = sizeOf(node);\n\t\t\twriter.seekTo(offset);\n\t\t\twriteData(writer, node, partialValue);\n\t\t\tsegments.push({\n\t\t\t\tstart: offset,\n\t\t\t\tend: offset + leafSize,\n\t\t\t\tpadding\n\t\t\t});\n\t\t}\n\t}\n\tgatherAndWrite(schema, data, 0);\n\tif (segments.length === 0) return [];\n\tconst instructions = [];\n\tlet current = segments[0];\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tconst next = segments[i];\n\t\tif (!next || !current) throw new Error(\"Internal error: missing segment\");\n\t\tif (next.start === current.end + (current.padding ?? 0)) {\n\t\t\tcurrent.end = next.end;\n\t\t\tcurrent.padding = next.padding;\n\t\t} else {\n\t\t\tinstructions.push({ data: new Uint8Array(bigBuffer, current.start, current.end - current.start) });\n\t\t\tcurrent = next;\n\t\t}\n\t}\n\tif (!current) throw new Error(\"Internal error: missing segment\");\n\tinstructions.push({ data: new Uint8Array(bigBuffer, current.start, current.end - current.start) });\n\treturn instructions;\n}\n\n//#endregion\nexport { getWriteInstructions };","import { $internal } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { isWgslData } from \"../../data/wgslTypes.js\";\nimport { isGPUBuffer } from \"../../types.js\";\nimport { sizeOf } from \"../../data/sizeOf.js\";\nimport { getCompiledWriterForSchema } from \"../../data/compiledIO.js\";\nimport { readData, writeData } from \"../../data/dataIO.js\";\nimport { getWriteInstructions } from \"../../data/partialIO.js\";\nimport { mutable, readonly, uniform } from \"./bufferUsage.js\";\nimport { BufferReader, BufferWriter, getSystemEndianness } from \"typed-binary\";\n\n//#region src/core/buffer/buffer.ts\nconst usageToUsageConstructor = {\n\tuniform,\n\tmutable,\n\treadonly\n};\nfunction INTERNAL_createBuffer(group, typeSchema, initialOrBuffer) {\n\tif (!isWgslData(typeSchema)) return new TgpuBufferImpl(group, typeSchema, initialOrBuffer, [\"storage\", \"uniform\"]);\n\treturn new TgpuBufferImpl(group, typeSchema, initialOrBuffer);\n}\nfunction isBuffer(value) {\n\treturn value.resourceType === \"buffer\";\n}\nfunction isUsableAsVertex(buffer) {\n\treturn !!buffer.usableAsVertex;\n}\nconst endianness = getSystemEndianness();\nvar TgpuBufferImpl = class {\n\t[$internal] = true;\n\tresourceType = \"buffer\";\n\tflags = GPUBufferUsage.COPY_DST | GPUBufferUsage.COPY_SRC;\n\t#device;\n\t_buffer = null;\n\t_ownBuffer;\n\t_destroyed = false;\n\t_hostBuffer;\n\tinitial;\n\tusableAsUniform = false;\n\tusableAsStorage = false;\n\tusableAsVertex = false;\n\tusableAsIndex = false;\n\tusableAsIndirect = false;\n\tconstructor(root, dataType, initialOrBuffer, _disallowedUsages) {\n\t\tthis.dataType = dataType;\n\t\tthis.initialOrBuffer = initialOrBuffer;\n\t\tthis._disallowedUsages = _disallowedUsages;\n\t\tthis.#device = root.device;\n\t\tif (isGPUBuffer(initialOrBuffer)) {\n\t\t\tthis._ownBuffer = false;\n\t\t\tthis._buffer = initialOrBuffer;\n\t\t} else {\n\t\t\tthis._ownBuffer = true;\n\t\t\tthis.initial = initialOrBuffer;\n\t\t}\n\t}\n\tget buffer() {\n\t\tif (this._destroyed) throw new Error(\"This buffer has been destroyed\");\n\t\tif (!this._buffer) {\n\t\t\tthis._buffer = this.#device.createBuffer({\n\t\t\t\tsize: sizeOf(this.dataType),\n\t\t\t\tusage: this.flags,\n\t\t\t\tmappedAtCreation: !!this.initial,\n\t\t\t\tlabel: getName(this) ?? \"<unnamed>\"\n\t\t\t});\n\t\t\tif (this.initial) {\n\t\t\t\tthis._writeToTarget(this._buffer.getMappedRange(), this.initial);\n\t\t\t\tthis._buffer.unmap();\n\t\t\t}\n\t\t}\n\t\treturn this._buffer;\n\t}\n\tget destroyed() {\n\t\treturn this._destroyed;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\tif (this._buffer) this._buffer.label = label;\n\t\treturn this;\n\t}\n\t$usage(...usages) {\n\t\tfor (const usage of usages) {\n\t\t\tif (this._disallowedUsages?.includes(usage)) throw new Error(`Buffer of type ${this.dataType.type} cannot be used as ${usage}`);\n\t\t\tthis.flags |= usage === \"uniform\" ? GPUBufferUsage.UNIFORM : 0;\n\t\t\tthis.flags |= usage === \"storage\" ? GPUBufferUsage.STORAGE : 0;\n\t\t\tthis.flags |= usage === \"vertex\" ? GPUBufferUsage.VERTEX : 0;\n\t\t\tthis.flags |= usage === \"index\" ? GPUBufferUsage.INDEX : 0;\n\t\t\tthis.flags |= usage === \"indirect\" ? GPUBufferUsage.INDIRECT : 0;\n\t\t\tthis.usableAsUniform = this.usableAsUniform || usage === \"uniform\";\n\t\t\tthis.usableAsStorage = this.usableAsStorage || usage === \"storage\";\n\t\t\tthis.usableAsVertex = this.usableAsVertex || usage === \"vertex\";\n\t\t\tthis.usableAsIndex = this.usableAsIndex || usage === \"index\";\n\t\t\tthis.usableAsIndirect = this.usableAsIndirect || usage === \"indirect\";\n\t\t}\n\t\treturn this;\n\t}\n\t$addFlags(flags) {\n\t\tif (!this._ownBuffer) throw new Error(\"Cannot add flags to a buffer that is not managed by TypeGPU.\");\n\t\tif (flags & GPUBufferUsage.MAP_READ) {\n\t\t\tthis.flags = GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ;\n\t\t\treturn this;\n\t\t}\n\t\tif (flags & GPUBufferUsage.MAP_WRITE) {\n\t\t\tthis.flags = GPUBufferUsage.COPY_SRC | GPUBufferUsage.MAP_WRITE;\n\t\t\treturn this;\n\t\t}\n\t\tthis.flags |= flags;\n\t\treturn this;\n\t}\n\tcompileWriter() {\n\t\tgetCompiledWriterForSchema(this.dataType);\n\t}\n\t_writeToTarget(target, data) {\n\t\tconst compiledWriter = getCompiledWriterForSchema(this.dataType);\n\t\tif (compiledWriter) try {\n\t\t\tcompiledWriter(new DataView(target), 0, data, endianness === \"little\");\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error when using compiled writer for buffer ${getName(this) ?? \"<unnamed>\"} - this is likely a bug, please submit an issue at https://github.com/software-mansion/TypeGPU/issues\\nUsing fallback writer instead.`, error);\n\t\t}\n\t\twriteData(new BufferWriter(target), this.dataType, data);\n\t}\n\twrite(data) {\n\t\tconst gpuBuffer = this.buffer;\n\t\tif (gpuBuffer.mapState === \"mapped\") {\n\t\t\tconst mapped = gpuBuffer.getMappedRange();\n\t\t\tthis._writeToTarget(mapped, data);\n\t\t\treturn;\n\t\t}\n\t\tconst size = sizeOf(this.dataType);\n\t\tif (!this._hostBuffer) this._hostBuffer = new ArrayBuffer(size);\n\t\tthis._writeToTarget(this._hostBuffer, data);\n\t\tthis.#device.queue.writeBuffer(gpuBuffer, 0, this._hostBuffer, 0, size);\n\t}\n\twritePartial(data) {\n\t\tconst gpuBuffer = this.buffer;\n\t\tconst instructions = getWriteInstructions(this.dataType, data);\n\t\tif (gpuBuffer.mapState === \"mapped\") {\n\t\t\tconst mappedRange = gpuBuffer.getMappedRange();\n\t\t\tconst mappedView = new Uint8Array(mappedRange);\n\t\t\tfor (const instruction of instructions) mappedView.set(instruction.data, instruction.data.byteOffset);\n\t\t} else for (const instruction of instructions) this.#device.queue.writeBuffer(gpuBuffer, instruction.data.byteOffset, instruction.data, 0, instruction.data.byteLength);\n\t}\n\tclear() {\n\t\tconst gpuBuffer = this.buffer;\n\t\tif (gpuBuffer.mapState === \"mapped\") {\n\t\t\tnew Uint8Array(gpuBuffer.getMappedRange()).fill(0);\n\t\t\treturn;\n\t\t}\n\t\tconst encoder = this.#device.createCommandEncoder();\n\t\tencoder.clearBuffer(gpuBuffer);\n\t\tthis.#device.queue.submit([encoder.finish()]);\n\t}\n\tcopyFrom(srcBuffer) {\n\t\tif (this.buffer.mapState === \"mapped\") throw new Error(\"Cannot copy to a mapped buffer.\");\n\t\tconst size = sizeOf(this.dataType);\n\t\tconst encoder = this.#device.createCommandEncoder();\n\t\tencoder.copyBufferToBuffer(srcBuffer.buffer, 0, this.buffer, 0, size);\n\t\tthis.#device.queue.submit([encoder.finish()]);\n\t}\n\tasync read() {\n\t\tconst gpuBuffer = this.buffer;\n\t\tif (gpuBuffer.mapState === \"mapped\") return readData(new BufferReader(gpuBuffer.getMappedRange()), this.dataType);\n\t\tif (gpuBuffer.usage & GPUBufferUsage.MAP_READ) {\n\t\t\tawait gpuBuffer.mapAsync(GPUMapMode.READ);\n\t\t\tconst res = readData(new BufferReader(gpuBuffer.getMappedRange()), this.dataType);\n\t\t\tgpuBuffer.unmap();\n\t\t\treturn res;\n\t\t}\n\t\tconst stagingBuffer = this.#device.createBuffer({\n\t\t\tsize: sizeOf(this.dataType),\n\t\t\tusage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ\n\t\t});\n\t\tconst commandEncoder = this.#device.createCommandEncoder();\n\t\tcommandEncoder.copyBufferToBuffer(gpuBuffer, 0, stagingBuffer, 0, sizeOf(this.dataType));\n\t\tthis.#device.queue.submit([commandEncoder.finish()]);\n\t\tawait stagingBuffer.mapAsync(GPUMapMode.READ, 0, sizeOf(this.dataType));\n\t\tconst res = readData(new BufferReader(stagingBuffer.getMappedRange()), this.dataType);\n\t\tstagingBuffer.unmap();\n\t\tstagingBuffer.destroy();\n\t\treturn res;\n\t}\n\tas(usage) {\n\t\treturn usageToUsageConstructor[usage]?.(this);\n\t}\n\tdestroy() {\n\t\tif (this._destroyed) return;\n\t\tthis._destroyed = true;\n\t\tif (this._ownBuffer) this._buffer?.destroy();\n\t}\n\ttoString() {\n\t\treturn `buffer:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\n\n//#endregion\nexport { INTERNAL_createBuffer, isBuffer, isUsableAsVertex };","import { $internal, $repr } from \"../shared/symbols.js\";\n\n//#region src/data/sampler.ts\nfunction sampler() {\n\treturn {\n\t\t[$internal]: {},\n\t\ttype: \"sampler\",\n\t\t[$repr]: void 0\n\t};\n}\nfunction comparisonSampler() {\n\treturn {\n\t\t[$internal]: {},\n\t\ttype: \"sampler_comparison\",\n\t\t[$repr]: void 0\n\t};\n}\nfunction isWgslSampler(value) {\n\treturn !!value[$internal] && value.type === \"sampler\";\n}\nfunction isWgslComparisonSampler(value) {\n\treturn !!value[$internal] && value.type === \"sampler_comparison\";\n}\n\n//#endregion\nexport { comparisonSampler, isWgslComparisonSampler, isWgslSampler, sampler };","import { $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { inCodegenMode } from \"../../execMode.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\nimport { comparisonSampler, sampler } from \"../../data/sampler.js\";\n\n//#region src/core/sampler/sampler.ts\nfunction INTERNAL_createSampler(props, branch) {\n\treturn new TgpuFixedSamplerImpl(sampler(), props, branch);\n}\nfunction INTERNAL_createComparisonSampler(props, branch) {\n\treturn new TgpuFixedSamplerImpl(comparisonSampler(), props, branch);\n}\nfunction isSampler(resource) {\n\tconst maybe = resource;\n\treturn maybe?.resourceType === \"sampler\" && !!maybe[$internal];\n}\nfunction isComparisonSampler(resource) {\n\tconst maybe = resource;\n\treturn maybe?.resourceType === \"sampler-comparison\" && !!maybe[$internal];\n}\nvar TgpuLaidOutSamplerImpl = class {\n\t[$internal] = { unwrap: void 0 };\n\tresourceType;\n\t#membership;\n\tconstructor(schema, membership) {\n\t\tthis.schema = schema;\n\t\tthis.#membership = membership;\n\t\tthis.resourceType = schema.type === \"sampler_comparison\" ? \"sampler-comparison\" : \"sampler\";\n\t\tsetName(this, membership.key);\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst group = ctx.allocateLayoutEntry(this.#membership.layout);\n\t\tctx.addDeclaration(`@group(${group}) @binding(${this.#membership.idx}) var ${id}: ${ctx.resolve(this.schema).value};`);\n\t\treturn snip(id, this.schema, \"handle\");\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst schema = this.schema;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, schema, \"handle\");\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.toString()}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"Direct access to sampler values is possible only as part of a compute dispatch or draw call.\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\ttoString() {\n\t\treturn `${this.resourceType}:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\nvar TgpuFixedSamplerImpl = class {\n\t[$internal];\n\tresourceType;\n\t#filtering;\n\t#sampler = null;\n\t#props;\n\t#branch;\n\tconstructor(schema, props, branch) {\n\t\tthis.schema = schema;\n\t\tthis.#props = props;\n\t\tthis.#branch = branch;\n\t\tthis.resourceType = schema.type === \"sampler_comparison\" ? \"sampler-comparison\" : \"sampler\";\n\t\tthis[$internal] = { unwrap: () => {\n\t\t\tif (!this.#sampler) this.#sampler = this.#branch.device.createSampler({\n\t\t\t\t...this.#props,\n\t\t\t\tlabel: getName(this) ?? \"<unnamed>\"\n\t\t\t});\n\t\t\treturn this.#sampler;\n\t\t} };\n\t\tthis.#filtering = props.minFilter === \"linear\" || props.magFilter === \"linear\" || props.mipmapFilter === \"linear\";\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst { group, binding } = ctx.allocateFixedEntry(this.schema.type === \"sampler_comparison\" ? { sampler: \"comparison\" } : { sampler: this.#filtering ? \"filtering\" : \"non-filtering\" }, this);\n\t\tctx.addDeclaration(`@group(${group}) @binding(${binding}) var ${id}: ${ctx.resolve(this.schema).value};`);\n\t\treturn snip(id, this.schema, \"handle\");\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst schema = this.schema;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, schema, \"handle\");\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.toString()}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"Direct access to sampler values is possible only as part of a compute dispatch or draw call.\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\ttoString() {\n\t\treturn `${this.resourceType}:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\n\n//#endregion\nexport { INTERNAL_createComparisonSampler, INTERNAL_createSampler, TgpuLaidOutSamplerImpl, isComparisonSampler, isSampler };","import { $internal, $repr } from \"../shared/symbols.js\";\nimport { f32 } from \"./numeric.js\";\n\n//#region src/data/texture.ts\nfunction textureDescriptorToSchema(desc) {\n\tif (\"multisampled\" in desc) {\n\t\tif (desc.multisampled) {\n\t\t\tif (desc.dimension === \"2d\") return textureMultisampled2d(desc.sampleType);\n\t\t\tthrow new Error(`Multisampled textures only support '2d' dimension, got '${desc.dimension}'`);\n\t\t}\n\t\tswitch (desc.dimension) {\n\t\t\tcase \"1d\": return texture1d(desc.sampleType);\n\t\t\tcase \"2d\": return texture2d(desc.sampleType);\n\t\t\tcase \"2d-array\": return texture2dArray(desc.sampleType);\n\t\t\tcase \"3d\": return texture3d(desc.sampleType);\n\t\t\tcase \"cube\": return textureCube(desc.sampleType);\n\t\t\tcase \"cube-array\": return textureCubeArray(desc.sampleType);\n\t\t\tdefault: throw new Error(`Unsupported texture dimension: '${desc.dimension}'`);\n\t\t}\n\t}\n\tif (!(\"access\" in desc)) throw new Error(\"Descriptor is neither a sampled nor a storage texture\");\n\tswitch (desc.dimension) {\n\t\tcase \"1d\": return textureStorage1d(desc.format, desc.access);\n\t\tcase \"2d\": return textureStorage2d(desc.format, desc.access);\n\t\tcase \"2d-array\": return textureStorage2dArray(desc.format, desc.access);\n\t\tcase \"3d\": return textureStorage3d(desc.format, desc.access);\n\t\tdefault: throw new Error(`Unsupported storage texture dimension: '${desc.dimension}'`);\n\t}\n}\nfunction createTexture(type, props) {\n\tconst sampleTypes = type.startsWith(\"texture_depth\") ? [\n\t\t\"depth\",\n\t\t\"float\",\n\t\t\"unfilterable-float\"\n\t] : props.sampleType.type === \"i32\" ? [\"sint\"] : props.sampleType.type === \"u32\" ? [\"uint\"] : [\"float\", \"unfilterable-float\"];\n\treturn {\n\t\t[$internal]: {},\n\t\t[$repr]: void 0,\n\t\ttype,\n\t\tbindingSampleType: sampleTypes,\n\t\t...props\n\t};\n}\nfunction createStorageTexture(type, props) {\n\treturn {\n\t\t[$internal]: {},\n\t\t[$repr]: void 0,\n\t\ttype,\n\t\t...props\n\t};\n}\nconst textureCache = /* @__PURE__ */ new Map();\nconst accessModeMap = {\n\t\"write-only\": \"write\",\n\t\"read-only\": \"read\",\n\t\"read-write\": \"read_write\"\n};\nfunction getOrCreate(key, factory) {\n\tlet cached = textureCache.get(key);\n\tif (!cached) {\n\t\tcached = factory();\n\t\ttextureCache.set(key, cached);\n\t}\n\treturn cached;\n}\nfunction texture1d(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_1d<${actualSampleType.type}>`, () => createTexture(\"texture_1d\", {\n\t\tdimension: \"1d\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: false\n\t}));\n}\nfunction texture2d(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_2d<${actualSampleType.type}>`, () => createTexture(\"texture_2d\", {\n\t\tdimension: \"2d\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureMultisampled2d(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_multisampled_2d<${actualSampleType.type}>`, () => createTexture(\"texture_multisampled_2d\", {\n\t\tdimension: \"2d\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: true\n\t}));\n}\nfunction texture2dArray(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_2d_array<${actualSampleType.type}>`, () => createTexture(\"texture_2d_array\", {\n\t\tdimension: \"2d-array\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureCube(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_cube<${actualSampleType.type}>`, () => createTexture(\"texture_cube\", {\n\t\tdimension: \"cube\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureCubeArray(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_cube_array<${actualSampleType.type}>`, () => createTexture(\"texture_cube_array\", {\n\t\tdimension: \"cube-array\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: false\n\t}));\n}\nfunction texture3d(sampleType) {\n\tconst actualSampleType = sampleType || f32;\n\treturn getOrCreate(`texture_3d<${actualSampleType.type}>`, () => createTexture(\"texture_3d\", {\n\t\tdimension: \"3d\",\n\t\tsampleType: actualSampleType,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureStorage1d(format, access) {\n\tconst actualAccess = access || \"write-only\";\n\treturn getOrCreate(`texture_storage_1d<${format}, ${accessModeMap[actualAccess]}>`, () => createStorageTexture(\"texture_storage_1d\", {\n\t\tdimension: \"1d\",\n\t\tformat,\n\t\taccess: actualAccess\n\t}));\n}\nfunction textureStorage2d(format, access) {\n\tconst actualAccess = access || \"write-only\";\n\treturn getOrCreate(`texture_storage_2d<${format}, ${accessModeMap[actualAccess]}>`, () => createStorageTexture(\"texture_storage_2d\", {\n\t\tdimension: \"2d\",\n\t\tformat,\n\t\taccess: actualAccess\n\t}));\n}\nfunction textureStorage2dArray(format, access) {\n\tconst actualAccess = access || \"write-only\";\n\treturn getOrCreate(`texture_storage_2d_array<${format}, ${accessModeMap[actualAccess]}>`, () => createStorageTexture(\"texture_storage_2d_array\", {\n\t\tdimension: \"2d-array\",\n\t\tformat,\n\t\taccess: actualAccess\n\t}));\n}\nfunction textureStorage3d(format, access) {\n\tconst actualAccess = access || \"write-only\";\n\treturn getOrCreate(`texture_storage_3d<${format}, ${accessModeMap[actualAccess]}>`, () => createStorageTexture(\"texture_storage_3d\", {\n\t\tdimension: \"3d\",\n\t\tformat,\n\t\taccess: actualAccess\n\t}));\n}\nfunction textureDepth2d() {\n\treturn getOrCreate(\"texture_depth_2d\", () => createTexture(\"texture_depth_2d\", {\n\t\tdimension: \"2d\",\n\t\tsampleType: f32,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureDepthMultisampled2d() {\n\treturn getOrCreate(\"texture_depth_multisampled_2d\", () => createTexture(\"texture_depth_multisampled_2d\", {\n\t\tdimension: \"2d\",\n\t\tsampleType: f32,\n\t\tmultisampled: true\n\t}));\n}\nfunction textureDepth2dArray() {\n\treturn getOrCreate(\"texture_depth_2d_array\", () => createTexture(\"texture_depth_2d_array\", {\n\t\tdimension: \"2d-array\",\n\t\tsampleType: f32,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureDepthCube() {\n\treturn getOrCreate(\"texture_depth_cube\", () => createTexture(\"texture_depth_cube\", {\n\t\tdimension: \"cube\",\n\t\tsampleType: f32,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureDepthCubeArray() {\n\treturn getOrCreate(\"texture_depth_cube_array\", () => createTexture(\"texture_depth_cube_array\", {\n\t\tdimension: \"cube-array\",\n\t\tsampleType: f32,\n\t\tmultisampled: false\n\t}));\n}\nfunction textureExternal() {\n\treturn getOrCreate(\"texture_external\", () => ({\n\t\t[$internal]: {},\n\t\t[$repr]: void 0,\n\t\ttype: \"texture_external\",\n\t\tdimension: \"2d\"\n\t}));\n}\nfunction isWgslTexture(value) {\n\treturn !!value[$internal] && typeof value.multisampled === \"boolean\";\n}\nfunction isWgslStorageTexture(value) {\n\treturn !!value[$internal] && typeof value.format === \"string\" && typeof value.access === \"string\";\n}\nfunction isWgslExternalTexture(value) {\n\treturn !!value[$internal] && value.type === \"texture_external\";\n}\n\n//#endregion\nexport { accessModeMap, isWgslExternalTexture, isWgslStorageTexture, isWgslTexture, texture1d, texture2d, texture2dArray, texture3d, textureCube, textureCubeArray, textureDepth2d, textureDepth2dArray, textureDepthCube, textureDepthCubeArray, textureDepthMultisampled2d, textureDescriptorToSchema, textureExternal, textureMultisampled2d, textureStorage1d, textureStorage2d, textureStorage2dArray, textureStorage3d };","import { f32, i32, u32 } from \"../../data/numeric.js\";\nimport { vec4f, vec4i, vec4u } from \"../../data/vector.js\";\n\n//#region src/core/texture/textureFormats.ts\nconst DEPTH_ASPECT_NON_COPYABLE = {\n\tchannelType: f32,\n\tvectorType: vec4f,\n\tsampleTypes: [\"depth\", \"unfilterable-float\"],\n\ttexelSize: \"non-copyable\"\n};\nconst DEPTH_ASPECT_16 = {\n\tchannelType: f32,\n\tvectorType: vec4f,\n\tsampleTypes: [\"depth\", \"unfilterable-float\"],\n\ttexelSize: 2\n};\nconst DEPTH_ASPECT_32 = {\n\tchannelType: f32,\n\tvectorType: vec4f,\n\tsampleTypes: [\"depth\", \"unfilterable-float\"],\n\ttexelSize: 4\n};\nconst STENCIL_ASPECT = {\n\tchannelType: u32,\n\tvectorType: vec4u,\n\tsampleTypes: [\"uint\"],\n\ttexelSize: 1\n};\nconst formatInfoCache = /* @__PURE__ */ new Map();\nfunction getTextureFormatInfo(format) {\n\tlet info = formatInfoCache.get(format);\n\tif (info === void 0) {\n\t\tinfo = createFormatInfo(format);\n\t\tformatInfoCache.set(format, info);\n\t}\n\treturn info;\n}\nfunction createFormatInfo(format) {\n\tconst channelType = parseChannelType(format);\n\tconst depthAspect = getDepthAspect(format);\n\tconst hasStencil = format.includes(\"stencil\");\n\treturn {\n\t\tchannelType,\n\t\tvectorType: channelType === u32 ? vec4u : channelType === i32 ? vec4i : vec4f,\n\t\ttexelSize: parseTexelSize(format),\n\t\tsampleTypes: parseSampleTypes(format),\n\t\tcanRenderAttachment: canRenderAttachment(format),\n\t\t...depthAspect && { depthAspect },\n\t\t...hasStencil && { stencilAspect: STENCIL_ASPECT }\n\t};\n}\nfunction getDepthAspect(format) {\n\tif (format === \"depth16unorm\") return DEPTH_ASPECT_16;\n\tif (format === \"depth32float\" || format === \"depth32float-stencil8\") return DEPTH_ASPECT_32;\n\tif (format === \"depth24plus\" || format === \"depth24plus-stencil8\") return DEPTH_ASPECT_NON_COPYABLE;\n}\nfunction canRenderAttachment(format) {\n\tif (format.startsWith(\"bc\") || format.startsWith(\"etc2\") || format.startsWith(\"eac\") || format.startsWith(\"astc\")) return false;\n\tif (format === \"rgb9e5ufloat\") return false;\n\treturn true;\n}\nfunction parseChannelType(format) {\n\tif (format === \"stencil8\") return u32;\n\tif (format.includes(\"uint\")) return u32;\n\tif (format.includes(\"sint\")) return i32;\n\treturn f32;\n}\nfunction parseTexelSize(format) {\n\tconst [, channels, bits] = format.match(/^(rgba|bgra|rg|r)(8|16|32)/) ?? [];\n\tif (channels && bits) return channels.length * Number(bits) / 8;\n\tif (format === \"stencil8\") return 1;\n\tif (format === \"depth16unorm\") return 2;\n\tif (format === \"depth32float\") return 4;\n\tif (format === \"depth32float-stencil8\") return 5;\n\tif (format === \"depth24plus\" || format === \"depth24plus-stencil8\") return \"non-copyable\";\n\tif (/^(bc[14]-|etc2-rgb8|eac-r11)/.test(format)) return 8;\n\tif (/^(bc|astc-|etc2-rgba|eac-rg)/.test(format)) return 16;\n\treturn 4;\n}\nfunction parseSampleTypes(format) {\n\tif (format === \"stencil8\") return [\"uint\"];\n\tif (format.includes(\"uint\")) return [\"uint\"];\n\tif (format.includes(\"sint\")) return [\"sint\"];\n\tif (format.includes(\"depth\")) return [\"depth\", \"unfilterable-float\"];\n\tif (/^(r|rg|rgba)16(u|s)norm$/.test(format)) return [\"unfilterable-float\"];\n\treturn [\"float\", \"unfilterable-float\"];\n}\nconst FLOAT32_FORMATS = new Set([\n\t\"r32float\",\n\t\"rg32float\",\n\t\"rgba32float\"\n]);\nfunction getEffectiveSampleTypes(device, format) {\n\tif (FLOAT32_FORMATS.has(format) && !device.features.has(\"float32-filterable\")) return [\"unfilterable-float\"];\n\treturn getTextureFormatInfo(format).sampleTypes;\n}\n\n//#endregion\nexport { getEffectiveSampleTypes, getTextureFormatInfo };","import { getEffectiveSampleTypes, getTextureFormatInfo } from \"./textureFormats.js\";\n\n//#region src/core/texture/textureUtils.ts\nfunction getImageSourceDimensions(source) {\n\tconst { videoWidth, videoHeight } = source;\n\tif (videoWidth && videoHeight) return {\n\t\twidth: videoWidth,\n\t\theight: videoHeight\n\t};\n\tconst { naturalWidth, naturalHeight } = source;\n\tif (naturalWidth && naturalHeight) return {\n\t\twidth: naturalWidth,\n\t\theight: naturalHeight\n\t};\n\tconst { codedWidth, codedHeight } = source;\n\tif (codedWidth && codedHeight) return {\n\t\twidth: codedWidth,\n\t\theight: codedHeight\n\t};\n\tconst { width, height } = source;\n\tif (width && height) return {\n\t\twidth,\n\t\theight\n\t};\n\tthrow new Error(\"Cannot determine dimensions of the provided image source.\");\n}\nconst FULLSCREEN_VERTEX_SHADER = `\nstruct VertexOutput {\n @builtin(position) pos: vec4f,\n @location(0) uv: vec2f,\n}\n\n@vertex\nfn vs_main(@builtin(vertex_index) i: u32) -> VertexOutput {\n const pos = array(vec2f(-1, -1), vec2f(3, -1), vec2f(-1, 3));\n const uv = array(vec2f(0, 1), vec2f(2, 1), vec2f(0, -1));\n return VertexOutput(vec4f(pos[i], 0, 1), uv[i]);\n}`;\nconst SAMPLE_FRAGMENT_SHADER = `\n@group(0) @binding(0) var src: texture_2d<f32>;\n@group(0) @binding(1) var samp: sampler;\n\n@fragment\nfn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {\n return textureSample(src, samp, uv);\n}`;\nconst GATHER_FRAGMENT_SHADER = `\n@group(0) @binding(0) var src: texture_2d<f32>;\n@group(0) @binding(1) var samp: sampler;\n\n@fragment\nfn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {\n let r = textureGather(0, src, samp, uv);\n let g = textureGather(1, src, samp, uv);\n let b = textureGather(2, src, samp, uv);\n let a = textureGather(3, src, samp, uv);\n return vec4f(dot(r, vec4f(0.25)), dot(g, vec4f(0.25)), dot(b, vec4f(0.25)), dot(a, vec4f(0.25)));\n}`;\nconst blitCache = /* @__PURE__ */ new WeakMap();\nfunction getOrCreateDeviceCache(device) {\n\tlet cache = blitCache.get(device);\n\tif (!cache) {\n\t\tcache = {\n\t\t\tvertexModule: device.createShaderModule({ code: FULLSCREEN_VERTEX_SHADER }),\n\t\t\tfilterableResources: /* @__PURE__ */ new Map(),\n\t\t\tlayoutResources: /* @__PURE__ */ new Map()\n\t\t};\n\t\tblitCache.set(device, cache);\n\t}\n\treturn cache;\n}\nfunction getBlitResources(device, filterable, sampleType) {\n\tconst cache = getOrCreateDeviceCache(device);\n\tlet filterableRes = cache.filterableResources.get(filterable);\n\tif (!filterableRes) {\n\t\tfilterableRes = {\n\t\t\tfragmentModule: device.createShaderModule({ code: filterable ? SAMPLE_FRAGMENT_SHADER : GATHER_FRAGMENT_SHADER }),\n\t\t\tsampler: device.createSampler(filterable ? {\n\t\t\t\tmagFilter: \"linear\",\n\t\t\t\tminFilter: \"linear\"\n\t\t\t} : {})\n\t\t};\n\t\tcache.filterableResources.set(filterable, filterableRes);\n\t}\n\tconst layoutKey = `${filterable}:${sampleType}`;\n\tlet layoutRes = cache.layoutResources.get(layoutKey);\n\tif (!layoutRes) {\n\t\tconst bindGroupLayout = device.createBindGroupLayout({ entries: [{\n\t\t\tbinding: 0,\n\t\t\tvisibility: GPUShaderStage.FRAGMENT,\n\t\t\ttexture: { sampleType }\n\t\t}, {\n\t\t\tbinding: 1,\n\t\t\tvisibility: GPUShaderStage.FRAGMENT,\n\t\t\tsampler: { type: filterable ? \"filtering\" : \"non-filtering\" }\n\t\t}] });\n\t\tlayoutRes = {\n\t\t\tbindGroupLayout,\n\t\t\tpipelineLayout: device.createPipelineLayout({ bindGroupLayouts: [bindGroupLayout] })\n\t\t};\n\t\tcache.layoutResources.set(layoutKey, layoutRes);\n\t}\n\treturn {\n\t\tvertexModule: cache.vertexModule,\n\t\t...filterableRes,\n\t\t...layoutRes\n\t};\n}\nfunction blit(options) {\n\tconst { device, source, destination, format, filterable, sampleType } = options;\n\tconst resources = getBlitResources(device, filterable, sampleType);\n\tconst pipeline = device.createRenderPipeline({\n\t\tlayout: resources.pipelineLayout,\n\t\tvertex: { module: resources.vertexModule },\n\t\tfragment: {\n\t\t\tmodule: resources.fragmentModule,\n\t\t\ttargets: [{ format }]\n\t\t},\n\t\tprimitive: { topology: \"triangle-list\" }\n\t});\n\tconst bindGroup = device.createBindGroup({\n\t\tlayout: resources.bindGroupLayout,\n\t\tentries: [{\n\t\t\tbinding: 0,\n\t\t\tresource: source\n\t\t}, {\n\t\t\tbinding: 1,\n\t\t\tresource: resources.sampler\n\t\t}]\n\t});\n\tconst ownEncoder = !options.encoder;\n\tconst encoder = options.encoder ?? device.createCommandEncoder();\n\tconst pass = encoder.beginRenderPass({ colorAttachments: [{\n\t\tview: destination,\n\t\tloadOp: \"clear\",\n\t\tstoreOp: \"store\"\n\t}] });\n\tpass.setPipeline(pipeline);\n\tpass.setBindGroup(0, bindGroup);\n\tpass.draw(3);\n\tpass.end();\n\tif (ownEncoder) device.queue.submit([encoder.finish()]);\n}\nfunction clearTextureUtilsCache(device) {\n\tblitCache.delete(device);\n}\nfunction validateBlitFormat(device, format, operation) {\n\tconst info = getTextureFormatInfo(format);\n\tconst effectiveSampleTypes = getEffectiveSampleTypes(device, format);\n\tconst isFloat = effectiveSampleTypes.includes(\"float\");\n\tconst isUnfilterableFloat = effectiveSampleTypes.includes(\"unfilterable-float\");\n\tif (!isFloat && !isUnfilterableFloat) throw new Error(`Cannot ${operation} for format '${format}': only float formats are supported.`);\n\tif (!info.canRenderAttachment) throw new Error(`Cannot ${operation} for format '${format}': format does not support render attachments.`);\n\treturn {\n\t\tfilterable: isFloat,\n\t\tsampleType: isFloat ? \"float\" : \"unfilterable-float\"\n\t};\n}\nfunction generateTextureMipmaps(device, texture, baseMipLevel = 0, mipLevels) {\n\tif (texture.dimension !== \"2d\") throw new Error(\"Mipmap generation only supports 2D textures.\");\n\tconst { filterable, sampleType } = validateBlitFormat(device, texture.format, \"generate mipmaps\");\n\tconst levels = mipLevels ?? texture.mipLevelCount - baseMipLevel;\n\tfor (let layer = 0; layer < texture.depthOrArrayLayers; layer++) for (let mip = baseMipLevel; mip < baseMipLevel + levels - 1; mip++) {\n\t\tconst viewOptions = (level) => ({\n\t\t\tdimension: \"2d\",\n\t\t\tbaseMipLevel: level,\n\t\t\tmipLevelCount: 1,\n\t\t\tbaseArrayLayer: layer,\n\t\t\tarrayLayerCount: 1\n\t\t});\n\t\tblit({\n\t\t\tdevice,\n\t\t\tsource: texture.createView(viewOptions(mip)),\n\t\t\tdestination: texture.createView(viewOptions(mip + 1)),\n\t\t\tformat: texture.format,\n\t\t\tfilterable,\n\t\t\tsampleType\n\t\t});\n\t}\n}\nfunction resampleImage(device, targetTexture, image, layer = 0) {\n\tif (targetTexture.dimension !== \"2d\") throw new Error(\"Resampling only supports 2D textures.\");\n\tconst { filterable } = validateBlitFormat(device, targetTexture.format, \"resample\");\n\tconst { width, height } = getImageSourceDimensions(image);\n\tconst inputTexture = device.createTexture({\n\t\tsize: [width, height],\n\t\tformat: \"rgba8unorm\",\n\t\tusage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT\n\t});\n\tdevice.queue.copyExternalImageToTexture({ source: image }, { texture: inputTexture }, [width, height]);\n\tconst renderTexture = device.createTexture({\n\t\tsize: [targetTexture.width, targetTexture.height],\n\t\tformat: targetTexture.format,\n\t\tusage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC\n\t});\n\tconst encoder = device.createCommandEncoder();\n\tblit({\n\t\tdevice,\n\t\tsource: inputTexture.createView(),\n\t\tdestination: renderTexture.createView(),\n\t\tformat: targetTexture.format,\n\t\tfilterable,\n\t\tsampleType: \"float\",\n\t\tencoder\n\t});\n\tencoder.copyTextureToTexture({ texture: renderTexture }, {\n\t\ttexture: targetTexture,\n\t\torigin: {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\tz: layer\n\t\t}\n\t}, {\n\t\twidth: targetTexture.width,\n\t\theight: targetTexture.height,\n\t\tdepthOrArrayLayers: 1\n\t});\n\tdevice.queue.submit([encoder.finish()]);\n\tinputTexture.destroy();\n\trenderTexture.destroy();\n}\n\n//#endregion\nexport { clearTextureUtilsCache, generateTextureMipmaps, getImageSourceDimensions, resampleImage };","import { $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { inCodegenMode } from \"../../execMode.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\nimport { isWgslStorageTexture, textureDescriptorToSchema } from \"../../data/texture.js\";\nimport { getTextureFormatInfo } from \"./textureFormats.js\";\nimport { generateTextureMipmaps, getImageSourceDimensions, resampleImage } from \"./textureUtils.js\";\n\n//#region src/core/texture/texture.ts\nfunction getDescriptorForProps(props) {\n\treturn {\n\t\tdimension: props.dimension ?? \"2d\",\n\t\tsampleType: getTextureFormatInfo(props.format).channelType,\n\t\tmultisampled: !((props.sampleCount ?? 1) === 1)\n\t};\n}\nfunction INTERNAL_createTexture(props, branch) {\n\treturn new TgpuTextureImpl(props, branch);\n}\nfunction isTexture(value) {\n\treturn value?.resourceType === \"texture\" && !!value[$internal];\n}\nfunction isTextureView(value) {\n\treturn value?.resourceType === \"texture-view\" && !!value[$internal];\n}\nvar TgpuTextureImpl = class {\n\t[$internal];\n\tresourceType = \"texture\";\n\tusableAsSampled = false;\n\tusableAsStorage = false;\n\tusableAsRender = false;\n\t#formatInfo;\n\t#destroyed = false;\n\t#flags = GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC;\n\t#texture = null;\n\t#branch;\n\tconstructor(props, branch) {\n\t\tthis.props = props;\n\t\tconst format = props.format;\n\t\tthis.#branch = branch;\n\t\tthis.#formatInfo = getTextureFormatInfo(format);\n\t\tthis[$internal] = { unwrap: () => {\n\t\t\tif (this.#destroyed) throw new Error(\"This texture has been destroyed\");\n\t\t\tif (!this.#texture) this.#texture = branch.device.createTexture({\n\t\t\t\tlabel: getName(this) ?? \"<unnamed>\",\n\t\t\t\tformat: props.format,\n\t\t\t\tsize: props.size,\n\t\t\t\tusage: this.#flags,\n\t\t\t\tdimension: props.dimension ?? \"2d\",\n\t\t\t\tviewFormats: props.viewFormats ?? [],\n\t\t\t\tmipLevelCount: props.mipLevelCount ?? 1,\n\t\t\t\tsampleCount: props.sampleCount ?? 1\n\t\t\t});\n\t\t\treturn this.#texture;\n\t\t} };\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\t$usage(...usages) {\n\t\tconst hasStorage = usages.includes(\"storage\");\n\t\tconst hasSampled = usages.includes(\"sampled\");\n\t\tconst hasRender = usages.includes(\"render\");\n\t\tthis.#flags |= hasSampled ? GPUTextureUsage.TEXTURE_BINDING : 0;\n\t\tthis.#flags |= hasStorage ? GPUTextureUsage.STORAGE_BINDING : 0;\n\t\tthis.#flags |= hasRender ? GPUTextureUsage.RENDER_ATTACHMENT : 0;\n\t\tthis.usableAsStorage ||= hasStorage;\n\t\tthis.usableAsSampled ||= hasSampled;\n\t\tthis.usableAsRender ||= hasRender;\n\t\treturn this;\n\t}\n\tcreateView(schema, viewDescriptor) {\n\t\tif (schema === \"render\") return new TgpuTextureRenderViewImpl(this, viewDescriptor);\n\t\treturn new TgpuFixedTextureViewImpl(schema ?? textureDescriptorToSchema(getDescriptorForProps(this.props)), this, viewDescriptor);\n\t}\n\t#clearMipLevel(mip = 0) {\n\t\tconst scale = 2 ** mip;\n\t\tconst [width, height, depth] = [\n\t\t\tMath.max(1, Math.floor((this.props.size[0] ?? 1) / scale)),\n\t\t\tMath.max(1, Math.floor((this.props.size[1] ?? 1) / scale)),\n\t\t\tMath.max(1, Math.floor((this.props.size[2] ?? 1) / scale))\n\t\t];\n\t\tconst texelSize = this.#formatInfo.texelSize;\n\t\tif (texelSize === \"non-copyable\") throw new Error(`Cannot clear texture with format '${this.props.format}': this format does not support copy operations.`);\n\t\tthis.#branch.device.queue.writeTexture({\n\t\t\ttexture: this[$internal].unwrap(),\n\t\t\tmipLevel: mip\n\t\t}, new Uint8Array(width * height * depth * texelSize), {\n\t\t\tbytesPerRow: texelSize * width,\n\t\t\trowsPerImage: height\n\t\t}, [\n\t\t\twidth,\n\t\t\theight,\n\t\t\tdepth\n\t\t]);\n\t}\n\tclear(mipLevel = \"all\") {\n\t\tif (mipLevel === \"all\") {\n\t\t\tconst mipLevels = this.props.mipLevelCount ?? 1;\n\t\t\tfor (let i = 0; i < mipLevels; i++) this.#clearMipLevel(i);\n\t\t} else this.#clearMipLevel(mipLevel);\n\t}\n\tgenerateMipmaps(baseMipLevel = 0, mipLevels) {\n\t\tif (!this.usableAsRender) throw new Error(\"generateMipmaps called without specifying 'render' usage. Add it via the $usage('render') method.\");\n\t\tconst actualMipLevels = mipLevels ?? (this.props.mipLevelCount ?? 1) - baseMipLevel;\n\t\tif (actualMipLevels <= 1) {\n\t\t\tconsole.warn(`generateMipmaps is a no-op: would generate ${actualMipLevels} mip levels (base: ${baseMipLevel}, total: ${this.props.mipLevelCount ?? 1})`);\n\t\t\treturn;\n\t\t}\n\t\tif (baseMipLevel >= (this.props.mipLevelCount ?? 1)) throw new Error(`Base mip level ${baseMipLevel} is out of range. Texture has ${this.props.mipLevelCount ?? 1} mip levels.`);\n\t\tgenerateTextureMipmaps(this.#branch.device, this[$internal].unwrap(), baseMipLevel, actualMipLevels);\n\t}\n\twrite(source, mipLevel = 0) {\n\t\tif (source instanceof ArrayBuffer || ArrayBuffer.isView(source)) {\n\t\t\tthis.#writeBufferData(source, mipLevel);\n\t\t\treturn;\n\t\t}\n\t\tconst dimension = this.props.dimension ?? \"2d\";\n\t\tif (!Array.isArray(source)) {\n\t\t\tthis.#writeSingleLayer(source, dimension === \"3d\" ? 0 : void 0);\n\t\t\treturn;\n\t\t}\n\t\tconst layerCount = this.props.size[2] ?? 1;\n\t\tif (source.length > layerCount) console.warn(`Too many image sources provided. Expected ${layerCount} layers, got ${source.length}. Extra sources will be ignored.`);\n\t\tfor (let layer = 0; layer < Math.min(source.length, layerCount); layer++) {\n\t\t\tconst bitmap = source[layer];\n\t\t\tif (bitmap) this.#writeSingleLayer(bitmap, layer);\n\t\t}\n\t}\n\t#writeBufferData(source, mipLevel) {\n\t\tconst mipWidth = Math.max(1, this.props.size[0] >> mipLevel);\n\t\tconst mipHeight = Math.max(1, (this.props.size[1] ?? 1) >> mipLevel);\n\t\tconst mipDepth = Math.max(1, (this.props.size[2] ?? 1) >> mipLevel);\n\t\tconst texelSize = this.#formatInfo.texelSize;\n\t\tif (texelSize === \"non-copyable\") throw new Error(`Cannot write to texture with format '${this.props.format}': this format does not support copy operations.`);\n\t\tconst expectedSize = mipWidth * mipHeight * mipDepth * texelSize;\n\t\tconst actualSize = source.byteLength ?? source.byteLength;\n\t\tif (actualSize !== expectedSize) throw new Error(`Buffer size mismatch. Expected ${expectedSize} bytes for mip level ${mipLevel}, got ${actualSize} bytes.`);\n\t\tthis.#branch.device.queue.writeTexture({\n\t\t\ttexture: this[$internal].unwrap(),\n\t\t\tmipLevel\n\t\t}, \"buffer\" in source ? source.buffer : source, {\n\t\t\tbytesPerRow: texelSize * mipWidth,\n\t\t\trowsPerImage: mipHeight\n\t\t}, [\n\t\t\tmipWidth,\n\t\t\tmipHeight,\n\t\t\tmipDepth\n\t\t]);\n\t}\n\t#writeSingleLayer(source, layer) {\n\t\tconst targetWidth = this.props.size[0];\n\t\tconst targetHeight = this.props.size[1] ?? 1;\n\t\tconst { width: sourceWidth, height: sourceHeight } = getImageSourceDimensions(source);\n\t\tif (sourceWidth !== targetWidth || sourceHeight !== targetHeight) {\n\t\t\tresampleImage(this.#branch.device, this[$internal].unwrap(), source, layer);\n\t\t\treturn;\n\t\t}\n\t\tthis.#branch.device.queue.copyExternalImageToTexture({ source }, {\n\t\t\ttexture: this[$internal].unwrap(),\n\t\t\t...layer !== void 0 && { origin: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\tz: layer\n\t\t\t} }\n\t\t}, layer !== void 0 ? [\n\t\t\ttargetWidth,\n\t\t\ttargetHeight,\n\t\t\t1\n\t\t] : this.props.size);\n\t}\n\tcopyFrom(source) {\n\t\tif (source.props.format !== this.props.format) throw new Error(`Texture format mismatch. Source texture has format ${source.props.format}, target texture has format ${this.props.format}`);\n\t\tif (source.props.size[0] !== this.props.size[0] || (source.props.size[1] ?? 1) !== (this.props.size[1] ?? 1) || (source.props.size[2] ?? 1) !== (this.props.size[2] ?? 1)) throw new Error(`Texture size mismatch. Source texture has size ${source.props.size.join(\"x\")}, target texture has size ${this.props.size.join(\"x\")}`);\n\t\tconst commandEncoder = this.#branch.device.createCommandEncoder();\n\t\tcommandEncoder.copyTextureToTexture({ texture: source[$internal].unwrap() }, { texture: this[$internal].unwrap() }, source.props.size);\n\t\tthis.#branch.device.queue.submit([commandEncoder.finish()]);\n\t}\n\ttoString() {\n\t\treturn `${this.resourceType}:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget destroyed() {\n\t\treturn this.#destroyed;\n\t}\n\tdestroy() {\n\t\tif (this.#destroyed) return;\n\t\tthis.#destroyed = true;\n\t\tthis.#texture?.destroy();\n\t}\n};\nvar TgpuFixedTextureViewImpl = class {\n\t[$internal];\n\tresourceType = \"texture-view\";\n\t#baseTexture;\n\t#view;\n\t#descriptor;\n\tconstructor(schema, baseTexture, descriptor) {\n\t\tthis.schema = schema;\n\t\tthis.#baseTexture = baseTexture;\n\t\tthis.#descriptor = descriptor;\n\t\tthis[$internal] = { unwrap: () => {\n\t\t\tif (!this.#view) {\n\t\t\t\tconst schema = this.schema;\n\t\t\t\tconst format = isWgslStorageTexture(schema) ? schema.format : this.#baseTexture.props.format;\n\t\t\t\tthis.#view = this.#baseTexture[$internal].unwrap().createView({\n\t\t\t\t\t...this.#descriptor,\n\t\t\t\t\tlabel: getName(this) ?? \"<unnamed>\",\n\t\t\t\t\tformat: this.#descriptor?.format ?? format,\n\t\t\t\t\tdimension: schema.dimension\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn this.#view;\n\t\t} };\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\tif (this.#view) this.#view.label = label;\n\t\treturn this;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst schema = this.schema;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, schema, \"handle\");\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.toString()}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"Direct access to texture view values is possible only as part of a compute dispatch or draw call. Try .read() or .write() instead\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\tget size() {\n\t\treturn this.#baseTexture.props.size;\n\t}\n\ttoString() {\n\t\treturn `textureView:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst { group, binding } = ctx.allocateFixedEntry(isWgslStorageTexture(this.schema) ? { storageTexture: this.schema } : {\n\t\t\ttexture: this.schema,\n\t\t\tsampleType: this.#descriptor?.sampleType ?? this.schema.bindingSampleType[0]\n\t\t}, this);\n\t\tctx.addDeclaration(`@group(${group}) @binding(${binding}) var ${id}: ${ctx.resolve(this.schema).value};`);\n\t\treturn snip(id, this.schema, \"handle\");\n\t}\n};\nvar TgpuLaidOutTextureViewImpl = class {\n\t[$internal] = { unwrap: void 0 };\n\tresourceType = \"texture-view\";\n\t#membership;\n\tconstructor(schema, membership) {\n\t\tthis.schema = schema;\n\t\tthis.#membership = membership;\n\t\tsetName(this, membership.key);\n\t}\n\ttoString() {\n\t\treturn `textureView:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst group = ctx.allocateLayoutEntry(this.#membership.layout);\n\t\tctx.addDeclaration(`@group(${group}) @binding(${this.#membership.idx}) var ${id}: ${ctx.resolve(this.schema).value};`);\n\t\treturn snip(id, this.schema, \"handle\");\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst schema = this.schema;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, schema, \"handle\");\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.toString()}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(`Accessed view '${getName(this) ?? \"<unnamed>\"}' outside of codegen mode. Direct access to texture views values is possible only as part of a compute dispatch or draw call. Try .read() or .write() instead`);\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n};\nvar TgpuTextureRenderViewImpl = class {\n\t[$internal];\n\tresourceType = \"texture-view\";\n\tconstructor(baseTexture, descriptor = {}) {\n\t\tthis.descriptor = descriptor;\n\t\tthis[$internal] = { unwrap: () => {\n\t\t\treturn baseTexture[$internal].unwrap().createView({\n\t\t\t\tlabel: getName(this) ?? \"<unnamed>\",\n\t\t\t\t...this.descriptor\n\t\t\t});\n\t\t} };\n\t}\n};\n\n//#endregion\nexport { INTERNAL_createTexture, TgpuLaidOutTextureViewImpl, isTexture, isTextureView };","import { getName } from \"../../shared/meta.js\";\n\n//#region src/core/texture/usageExtension.ts\nfunction isUsableAsSampled(value) {\n\treturn !!value?.usableAsSampled;\n}\nfunction isUsableAsRender(value) {\n\treturn !!value?.usableAsRender;\n}\n/**\n* @category Errors\n*/\nvar NotSampledError = class NotSampledError extends Error {\n\tconstructor(value) {\n\t\tsuper(`Resource '${getName(value) ?? \"<unnamed>\"}' cannot be bound as 'sampled'. Use .$usage('sampled') to allow it.`);\n\t\tObject.setPrototypeOf(this, NotSampledError.prototype);\n\t}\n};\n\n//#endregion\nexport { NotSampledError, isUsableAsRender, isUsableAsSampled };","import { $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { isNaturallyEphemeral } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { IllegalVarAccessError } from \"../../errors.js\";\nimport { getExecMode, isInsideTgpuFn } from \"../../execMode.js\";\nimport { assertExhaustive } from \"../../shared/utilityTypes.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\n\n//#region src/core/variable/tgpuVariable.ts\n/**\n* Defines a variable scoped to each entry function (private).\n*\n* @param dataType The schema of the held data's type\n* @param initialValue If not provided, the variable will be initialized to the dataType's \"zero-value\".\n*/\nfunction privateVar(dataType, initialValue) {\n\treturn new TgpuVarImpl(\"private\", dataType, initialValue);\n}\n/**\n* Defines a variable scoped to the whole workgroup, shared between entry functions\n* of the same invocation.\n*\n* @param dataType The schema of the held data's type\n*/\nfunction workgroupVar(dataType) {\n\treturn new TgpuVarImpl(\"workgroup\", dataType);\n}\nfunction isVariable(value) {\n\treturn value instanceof TgpuVarImpl;\n}\nvar TgpuVarImpl = class {\n\t[$internal] = {};\n\tresourceType;\n\t#scope;\n\t#dataType;\n\t#initialValue;\n\tconstructor(scope, dataType, initialValue) {\n\t\tthis.resourceType = \"var\";\n\t\tthis.#scope = scope;\n\t\tthis.#dataType = dataType;\n\t\tthis.#initialValue = initialValue;\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst pre = `var<${this.#scope}> ${id}: ${ctx.resolve(this.#dataType).value}`;\n\t\tif (this.#initialValue) ctx.addDeclaration(`${pre} = ${ctx.resolve(this.#initialValue, this.#dataType).value};`);\n\t\telse ctx.addDeclaration(`${pre};`);\n\t\treturn snip(id, this.#dataType, isNaturallyEphemeral(this.#dataType) ? \"runtime\" : this.#scope);\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\ttoString() {\n\t\treturn `var:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst dataType = this.#dataType;\n\t\tconst origin = isNaturallyEphemeral(dataType) ? \"runtime\" : this.#scope;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, dataType, origin);\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `var:${getName(this) ?? \"<unnamed>\"}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tconst mode = getExecMode();\n\t\tconst insideTgpuFn = isInsideTgpuFn();\n\t\tif (mode.type === \"normal\") throw new IllegalVarAccessError(insideTgpuFn ? `Cannot access variable '${getName(this) ?? \"<unnamed>\"}'. TypeGPU functions that depends on GPU resources need to be part of a compute dispatch, draw call or simulation` : \"TypeGPU variables are inaccessible during normal JS execution. If you wanted to simulate GPU behavior, try `tgpu.simulate()`\");\n\t\tif (mode.type === \"codegen\") return this[$gpuValueOf];\n\t\tif (mode.type === \"simulate\") {\n\t\t\tif (!mode.vars[this.#scope].has(this)) mode.vars[this.#scope].set(this, this.#initialValue);\n\t\t\treturn mode.vars[this.#scope].get(this);\n\t\t}\n\t\treturn assertExhaustive(mode, \"tgpuVariable.ts#TgpuVarImpl/$\");\n\t}\n\tset $(value) {\n\t\tconst mode = getExecMode();\n\t\tconst insideTgpuFn = isInsideTgpuFn();\n\t\tif (mode.type === \"normal\") throw new IllegalVarAccessError(insideTgpuFn ? `Cannot access ${String(this)}. TypeGPU functions that depends on GPU resources need to be part of a compute dispatch, draw call or simulation` : \"TypeGPU variables are inaccessible during normal JS execution. If you wanted to simulate GPU behavior, try `tgpu.simulate()`\");\n\t\tif (mode.type === \"codegen\") throw new Error(\"Unreachable tgpuVariable.ts#TgpuVarImpl/$\");\n\t\tif (mode.type === \"simulate\") {\n\t\t\tmode.vars[this.#scope].set(this, value);\n\t\t\treturn;\n\t\t}\n\t\tassertExhaustive(mode, \"tgpuVariable.ts#TgpuVarImpl/$\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\tset value(v) {\n\t\tthis.$ = v;\n\t}\n};\n\n//#endregion\nexport { isVariable, privateVar, workgroupVar };","import { $getNameForward, $gpuValueOf, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\n\n//#region src/core/buffer/bufferShorthand.ts\nfunction isBufferShorthand(value) {\n\treturn value instanceof TgpuBufferShorthandImpl;\n}\nvar TgpuBufferShorthandImpl = class {\n\t[$internal] = true;\n\t[$getNameForward];\n\t#usage;\n\tconstructor(resourceType, buffer) {\n\t\tthis.resourceType = resourceType;\n\t\tthis.buffer = buffer;\n\t\tthis[$getNameForward] = buffer;\n\t\tthis.#usage = this.buffer.as(this.resourceType);\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\twrite(data) {\n\t\tthis.buffer.write(data);\n\t}\n\twritePartial(data) {\n\t\tthis.buffer.writePartial(data);\n\t}\n\tread() {\n\t\treturn this.buffer.read();\n\t}\n\tget [$gpuValueOf]() {\n\t\treturn this.#usage.$;\n\t}\n\tget $() {\n\t\treturn this.#usage.$;\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\ttoString() {\n\t\treturn `${this.resourceType}BufferShorthand:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.resolve(this.#usage);\n\t}\n};\n\n//#endregion\nexport { TgpuBufferShorthandImpl, isBufferShorthand };","import { $gpuValueOf, $internal } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { getResolutionCtx } from \"../../execMode.js\";\nimport { getGpuValueRecursively } from \"../valueProxyUtils.js\";\n\n//#region src/core/slot/slot.ts\nfunction slot(defaultValue) {\n\treturn new TgpuSlotImpl(defaultValue);\n}\nvar TgpuSlotImpl = class {\n\t[$internal] = true;\n\tresourceType = \"slot\";\n\tconstructor(defaultValue = void 0) {\n\t\tthis.defaultValue = defaultValue;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\tareEqual(a, b) {\n\t\treturn Object.is(a, b);\n\t}\n\ttoString() {\n\t\treturn `slot:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst ctx = getResolutionCtx();\n\t\tif (!ctx) throw new Error(`Cannot access tgpu.slot's value outside of resolution.`);\n\t\treturn getGpuValueRecursively(ctx.unwrap(this));\n\t}\n\tget value() {\n\t\treturn this[$gpuValueOf];\n\t}\n\tget $() {\n\t\treturn this.value;\n\t}\n};\n\n//#endregion\nexport { slot };","import { slot } from \"./slot.js\";\n\n//#region src/core/slot/internalSlots.ts\nconst shaderStageSlot = slot(void 0);\n\n//#endregion\nexport { shaderStageSlot };","import { $getNameForward, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { getName, isNamable, setName } from \"../../shared/meta.js\";\nimport { Void } from \"../../data/wgslTypes.js\";\nimport { createIoSchema } from \"./ioSchema.js\";\nimport { createFnCore } from \"./fnCore.js\";\nimport { stripTemplate } from \"./templateUtils.js\";\nimport { shaderStageSlot } from \"../slot/internalSlots.js\";\n\n//#region src/core/function/tgpuComputeFn.ts\n/**\n* Creates a shell of a typed entry function for the compute shader stage. Any function\n* that implements this shell can perform general-purpose computation.\n*\n* @param options.in\n* Record with builtins used by the compute shader.\n* @param options.workgroupSize\n* Size of blocks that the thread grid will be divided into (up to 3 dimensions).\n*/\nfunction computeFn(options) {\n\tconst shell = {\n\t\targTypes: options.in && Object.keys(options.in).length !== 0 ? [createIoSchema(options.in)] : [],\n\t\treturnType: Void,\n\t\tworkgroupSize: [\n\t\t\toptions.workgroupSize[0] ?? 1,\n\t\t\toptions.workgroupSize[1] ?? 1,\n\t\t\toptions.workgroupSize[2] ?? 1\n\t\t],\n\t\tentryPoint: \"compute\"\n\t};\n\tconst call = (arg, ...values) => createComputeFn(shell, options.workgroupSize, stripTemplate(arg, ...values));\n\treturn Object.assign(call, shell);\n}\nfunction isTgpuComputeFn(value) {\n\treturn value?.shell?.entryPoint === \"compute\";\n}\nfunction createComputeFn(shell, workgroupSize, implementation) {\n\tconst core = createFnCore(implementation, `@compute @workgroup_size(${workgroupSize.join(\", \")}) `);\n\tconst inputType = shell.argTypes[0];\n\treturn {\n\t\tshell,\n\t\t$uses(newExternals) {\n\t\t\tcore.applyExternals(newExternals);\n\t\t\treturn this;\n\t\t},\n\t\t[$internal]: true,\n\t\t[$getNameForward]: core,\n\t\t$name(newLabel) {\n\t\t\tsetName(this, newLabel);\n\t\t\tif (isNamable(inputType)) inputType.$name(`${newLabel}_Input`);\n\t\t\treturn this;\n\t\t},\n\t\t[$resolve](ctx) {\n\t\t\treturn ctx.withSlots([[shaderStageSlot, \"compute\"]], () => core.resolve(ctx, shell.argTypes, shell.returnType));\n\t\t},\n\t\ttoString() {\n\t\t\treturn `computeFn:${getName(core) ?? \"<unnamed>\"}`;\n\t\t}\n\t};\n}\n\n//#endregion\nexport { computeFn, isTgpuComputeFn };","import { $getNameForward, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { getName, isNamable, setName } from \"../../shared/meta.js\";\nimport { createIoSchema } from \"./ioSchema.js\";\nimport { addReturnTypeToExternals } from \"../resolve/externals.js\";\nimport { createFnCore } from \"./fnCore.js\";\nimport { stripTemplate } from \"./templateUtils.js\";\nimport { shaderStageSlot } from \"../slot/internalSlots.js\";\n\n//#region src/core/function/tgpuFragmentFn.ts\n/**\n* Creates a shell of a typed entry function for the fragment shader stage. Any function\n* that implements this shell can run for each fragment (pixel), allowing the inner code\n* to process information received from the vertex shader stage and builtins to determine\n* the final color of the pixel (many pixels in case of multiple targets).\n*\n* @param options.in\n* Values computed in the vertex stage and builtins to be made available to functions that implement this shell.\n* @param options.out\n* A `vec4f`, signaling this function outputs a color for one target, or a record containing colors for multiple targets.\n*/\nfunction fragmentFn(options) {\n\tconst shell = {\n\t\tin: options.in,\n\t\tout: options.out,\n\t\treturnType: createIoSchema(options.out),\n\t\tentryPoint: \"fragment\"\n\t};\n\tconst call = (arg, ...values) => createFragmentFn(shell, stripTemplate(arg, ...values));\n\treturn Object.assign(call, shell);\n}\nfunction isTgpuFragmentFn(value) {\n\treturn value?.shell?.entryPoint === \"fragment\";\n}\nfunction createFragmentFn(shell, implementation) {\n\tconst core = createFnCore(implementation, \"@fragment \");\n\tconst outputType = shell.returnType;\n\tif (typeof implementation === \"string\") addReturnTypeToExternals(implementation, outputType, (externals) => core.applyExternals(externals));\n\treturn {\n\t\tshell,\n\t\toutputType,\n\t\t$uses(newExternals) {\n\t\t\tcore.applyExternals(newExternals);\n\t\t\treturn this;\n\t\t},\n\t\t[$internal]: true,\n\t\t[$getNameForward]: core,\n\t\t$name(newLabel) {\n\t\t\tsetName(this, newLabel);\n\t\t\tif (isNamable(outputType)) outputType.$name(`${newLabel}_Output`);\n\t\t\treturn this;\n\t\t},\n\t\t[$resolve](ctx) {\n\t\t\tconst inputWithLocation = shell.in ? createIoSchema(shell.in, ctx.varyingLocations) : void 0;\n\t\t\tif (inputWithLocation) {\n\t\t\t\tinputWithLocation.$name(`${getName(this) ?? \"\"}_Input`);\n\t\t\t\tcore.applyExternals({ In: inputWithLocation });\n\t\t\t}\n\t\t\tcore.applyExternals({ Out: outputType });\n\t\t\treturn ctx.withSlots([[shaderStageSlot, \"fragment\"]], () => core.resolve(ctx, inputWithLocation ? [inputWithLocation] : [], shell.returnType));\n\t\t},\n\t\ttoString() {\n\t\t\treturn `fragmentFn:${getName(core) ?? \"<unnamed>\"}`;\n\t\t}\n\t};\n}\n\n//#endregion\nexport { fragmentFn, isTgpuFragmentFn };","import { $getNameForward, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { getName, isNamable, setName } from \"../../shared/meta.js\";\nimport { createIoSchema } from \"./ioSchema.js\";\nimport { createFnCore } from \"./fnCore.js\";\nimport { stripTemplate } from \"./templateUtils.js\";\nimport { shaderStageSlot } from \"../slot/internalSlots.js\";\n\n//#region src/core/function/tgpuVertexFn.ts\n/**\n* Creates a shell of a typed entry function for the vertex shader stage. Any function\n* that implements this shell can run for each vertex, allowing the inner code to process\n* attributes and determine the final position of the vertex.\n*\n* @param options.in\n* Vertex attributes and builtins to be made available to functions that implement this shell.\n* @param options.out\n* A record containing the final position of the vertex, and any information\n* passed onto the fragment shader stage.\n*/\nfunction vertexFn(options) {\n\tif (Object.keys(options.out).length === 0) throw new Error(`A vertexFn output cannot be empty since it must include the 'position' builtin.`);\n\tconst shell = {\n\t\tin: options.in,\n\t\tout: options.out,\n\t\targTypes: options.in && Object.keys(options.in).length !== 0 ? [createIoSchema(options.in)] : [],\n\t\tentryPoint: \"vertex\"\n\t};\n\tconst call = (arg, ...values) => createVertexFn(shell, stripTemplate(arg, ...values));\n\treturn Object.assign(call, shell);\n}\nfunction isTgpuVertexFn(value) {\n\treturn value?.shell?.entryPoint === \"vertex\";\n}\nfunction createVertexFn(shell, implementation) {\n\tconst core = createFnCore(implementation, \"@vertex \");\n\tconst inputType = shell.argTypes[0];\n\treturn {\n\t\tshell,\n\t\t$uses(newExternals) {\n\t\t\tcore.applyExternals(newExternals);\n\t\t\treturn this;\n\t\t},\n\t\t[$internal]: true,\n\t\t[$getNameForward]: core,\n\t\t$name(newLabel) {\n\t\t\tsetName(this, newLabel);\n\t\t\tif (isNamable(inputType)) inputType.$name(`${newLabel}_Input`);\n\t\t\treturn this;\n\t\t},\n\t\t[$resolve](ctx) {\n\t\t\tconst outputWithLocation = createIoSchema(shell.out, ctx.varyingLocations).$name(`${getName(this) ?? \"\"}_Output`);\n\t\t\tif (typeof implementation === \"string\") {\n\t\t\t\tif (inputType) core.applyExternals({ In: inputType });\n\t\t\t\tcore.applyExternals({ Out: outputWithLocation });\n\t\t\t}\n\t\t\treturn ctx.withSlots([[shaderStageSlot, \"vertex\"]], () => core.resolve(ctx, shell.argTypes, outputWithLocation));\n\t\t},\n\t\ttoString() {\n\t\t\treturn `vertexFn:${getName(core) ?? \"<unnamed>\"}`;\n\t\t}\n\t};\n}\n\n//#endregion\nexport { isTgpuVertexFn, vertexFn };","//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) {\n\t\t__defProp(target, name, {\n\t\t\tget: all[name],\n\t\t\tenumerable: true\n\t\t});\n\t}\n\tif (!no_symbols) {\n\t\t__defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\t}\n\treturn target;\n};\n\n//#endregion\nexport { __exportAll };","import { $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { isNaturallyEphemeral } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { inCodegenMode } from \"../../execMode.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\n\n//#region src/core/constant/tgpuConstant.ts\n/**\n* Creates a module constant with specified value.\n*/\nfunction constant(dataType, value) {\n\treturn new TgpuConstImpl(dataType, value);\n}\nfunction deepFreeze(object) {\n\tconst propNames = Reflect.ownKeys(object);\n\tfor (const name of propNames) {\n\t\tconst value = object[name];\n\t\tif (value && typeof value === \"object\" || typeof value === \"function\") deepFreeze(value);\n\t}\n\treturn Object.freeze(object);\n}\nvar TgpuConstImpl = class {\n\t[$internal] = {};\n\tresourceType;\n\t#value;\n\tconstructor(dataType, value) {\n\t\tthis.dataType = dataType;\n\t\tthis.resourceType = \"const\";\n\t\tthis.#value = value && typeof value === \"object\" ? deepFreeze(value) : value;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst resolvedDataType = ctx.resolve(this.dataType).value;\n\t\tconst resolvedValue = ctx.resolve(this.#value, this.dataType).value;\n\t\tctx.addDeclaration(`const ${id}: ${resolvedDataType} = ${resolvedValue};`);\n\t\treturn snip(id, this.dataType, isNaturallyEphemeral(this.dataType) ? \"constant\" : \"constant-tgpu-const-ref\");\n\t}\n\ttoString() {\n\t\treturn `const:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst dataType = this.dataType;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, dataType, isNaturallyEphemeral(dataType) ? \"constant\" : \"constant-tgpu-const-ref\");\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `const:${getName(this) ?? \"<unnamed>\"}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\treturn this.#value;\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n};\n\n//#endregion\nexport { constant };","import { $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { inCodegenMode } from \"../../execMode.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\nimport { textureExternal } from \"../../data/texture.js\";\n\n//#region src/core/texture/externalTexture.ts\nvar TgpuExternalTextureImpl = class {\n\tresourceType = \"external-texture\";\n\t[$internal] = true;\n\t#membership;\n\tconstructor(schema, membership) {\n\t\tthis.schema = schema;\n\t\tthis.#membership = membership;\n\t\tsetName(this, membership.key);\n\t}\n\t[$resolve](ctx) {\n\t\tconst id = ctx.getUniqueName(this);\n\t\tconst group = ctx.allocateLayoutEntry(this.#membership.layout);\n\t\tctx.addDeclaration(`@group(${group}) @binding(${this.#membership.idx}) var ${id}: ${ctx.resolve(this.schema).value};`);\n\t\treturn snip(id, textureExternal(), \"handle\");\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst schema = this.schema;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, schema, \"handle\");\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `textureExternal:${getName(this) ?? \"<unnamed>\"}.$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"Direct access to texture views values is possible only as part of a compute dispatch or draw call. Try .read() or .write() instead\");\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\ttoString() {\n\t\treturn `textureExternal:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\n\n//#endregion\nexport { TgpuExternalTextureImpl };","import { $gpuValueOf, $internal } from \"./shared/symbols.js\";\nimport { getName, setName } from \"./shared/meta.js\";\nimport { NotUniformError } from \"./errors.js\";\nimport { safeStringify } from \"./shared/stringify.js\";\nimport { f32, i32, u32 } from \"./data/numeric.js\";\nimport { comparisonSampler, sampler } from \"./data/sampler.js\";\nimport { textureDescriptorToSchema } from \"./data/texture.js\";\nimport { NotStorageError, isUsableAsStorage } from \"./extension.js\";\nimport { TgpuLaidOutBufferImpl, isUsableAsUniform } from \"./core/buffer/bufferUsage.js\";\nimport { isBuffer } from \"./core/buffer/buffer.js\";\nimport { TgpuLaidOutSamplerImpl, isComparisonSampler, isSampler } from \"./core/sampler/sampler.js\";\nimport { TgpuExternalTextureImpl } from \"./core/texture/externalTexture.js\";\nimport { TgpuLaidOutTextureViewImpl, isTexture, isTextureView } from \"./core/texture/texture.js\";\nimport { NotSampledError, isUsableAsSampled } from \"./core/texture/usageExtension.js\";\n\n//#region src/tgpuBindGroupLayout.ts\n/**\n* Converts legacy entries to new API format\n*/\nfunction convertLegacyEntries(entries) {\n\tconst result = {};\n\tfor (const [key, entry] of Object.entries(entries)) {\n\t\tif (entry === null) {\n\t\t\tresult[key] = null;\n\t\t\tcontinue;\n\t\t}\n\t\tif (\"texture\" in entry && typeof entry.texture === \"string\") {\n\t\t\tconst sampleType = entry.texture;\n\t\t\tresult[key] = {\n\t\t\t\t...entry,\n\t\t\t\ttexture: textureDescriptorToSchema({\n\t\t\t\t\tdimension: entry.viewDimension ?? \"2d\",\n\t\t\t\t\tsampleType: sampleType === \"sint\" ? i32 : sampleType === \"uint\" ? u32 : f32,\n\t\t\t\t\tmultisampled: entry.multisampled ?? false\n\t\t\t\t})\n\t\t\t};\n\t\t} else if (\"storageTexture\" in entry && typeof entry.storageTexture === \"string\") {\n\t\t\tconst accessMap = {\n\t\t\t\treadonly: \"read-only\",\n\t\t\t\twriteonly: \"write-only\",\n\t\t\t\tmutable: \"read-write\"\n\t\t\t};\n\t\t\tresult[key] = {\n\t\t\t\t...entry,\n\t\t\t\tstorageTexture: textureDescriptorToSchema({\n\t\t\t\t\taccess: accessMap[entry.access ?? \"writeonly\"],\n\t\t\t\t\tformat: entry.storageTexture,\n\t\t\t\t\tdimension: entry.viewDimension ?? \"2d\"\n\t\t\t\t})\n\t\t\t};\n\t\t} else if (\"externalTexture\" in entry && Object.keys(entry.externalTexture).length === 0) result[key] = {\n\t\t\t...entry,\n\t\t\texternalTexture: {\n\t\t\t\ttype: \"texture_external\",\n\t\t\t\tdimension: \"2d\"\n\t\t\t}\n\t\t};\n\t\telse result[key] = entry;\n\t}\n\treturn result;\n}\nfunction bindGroupLayout(entries) {\n\treturn new TgpuBindGroupLayoutImpl(convertLegacyEntries(entries));\n}\nfunction isBindGroupLayout(value) {\n\treturn !!value && value.resourceType === \"bind-group-layout\";\n}\nfunction isBindGroup(value) {\n\treturn !!value && value.resourceType === \"bind-group\";\n}\n/**\n* @category Errors\n*/\nvar MissingBindingError = class MissingBindingError extends Error {\n\tconstructor(groupLabel, key) {\n\t\tsuper(`Bind group '${groupLabel ?? \"<unnamed>\"}' is missing a required binding '${key}'`);\n\t\tObject.setPrototypeOf(this, MissingBindingError.prototype);\n\t}\n};\nconst DEFAULT_MUTABLE_VISIBILITY = [\"compute\", \"fragment\"];\nconst DEFAULT_READONLY_VISIBILITY = [\n\t\"compute\",\n\t\"vertex\",\n\t\"fragment\"\n];\nvar TgpuBindGroupLayoutImpl = class {\n\t[$internal];\n\t_index;\n\tresourceType = \"bind-group-layout\";\n\tvalue = {};\n\t$ = this.value;\n\tget [$gpuValueOf]() {\n\t\treturn this.$;\n\t}\n\tconstructor(entries) {\n\t\tthis.entries = entries;\n\t\tlet idx = 0;\n\t\tconst bound = {};\n\t\tthis[$internal] = { bound };\n\t\tfor (const [key, entry] of Object.entries(entries)) {\n\t\t\tif (entry === null) {\n\t\t\t\tidx++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst membership = {\n\t\t\t\tlayout: this,\n\t\t\t\tkey,\n\t\t\t\tidx\n\t\t\t};\n\t\t\tif (\"uniform\" in entry) bound[key] = new TgpuLaidOutBufferImpl(\"uniform\", entry.uniform, membership);\n\t\t\tif (\"storage\" in entry) {\n\t\t\t\tconst dataType = \"type\" in entry.storage ? entry.storage : entry.storage(0);\n\t\t\t\tbound[key] = new TgpuLaidOutBufferImpl(entry.access ?? \"readonly\", dataType, membership);\n\t\t\t}\n\t\t\tif (\"texture\" in entry) bound[key] = new TgpuLaidOutTextureViewImpl(entry.texture, membership);\n\t\t\tif (\"storageTexture\" in entry) bound[key] = new TgpuLaidOutTextureViewImpl(entry.storageTexture, membership);\n\t\t\tif (\"externalTexture\" in entry) bound[key] = new TgpuExternalTextureImpl(entry.externalTexture, membership);\n\t\t\tif (\"sampler\" in entry) bound[key] = new TgpuLaidOutSamplerImpl(entry.sampler === \"comparison\" ? comparisonSampler() : sampler(), membership);\n\t\t\tObject.defineProperty(this.value, key, { get: () => {\n\t\t\t\treturn bound[key].value;\n\t\t\t} });\n\t\t\tidx++;\n\t\t}\n\t}\n\ttoString() {\n\t\treturn `bindGroupLayout:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget index() {\n\t\treturn this._index;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\tget bound() {\n\t\treturn this[$internal].bound;\n\t}\n\t$idx(index) {\n\t\tthis._index = index;\n\t\treturn this;\n\t}\n\tunwrap(unwrapper) {\n\t\treturn unwrapper.device.createBindGroupLayout({\n\t\t\tlabel: getName(this) ?? \"<unnamed>\",\n\t\t\tentries: Object.values(this.entries).map((entry, idx) => {\n\t\t\t\tif (entry === null) return null;\n\t\t\t\tlet visibility = entry.visibility;\n\t\t\t\tconst binding = {\n\t\t\t\t\tbinding: idx,\n\t\t\t\t\tvisibility: 0\n\t\t\t\t};\n\t\t\t\tif (\"uniform\" in entry) {\n\t\t\t\t\tvisibility = visibility ?? DEFAULT_READONLY_VISIBILITY;\n\t\t\t\t\tbinding.buffer = { type: \"uniform\" };\n\t\t\t\t} else if (\"storage\" in entry) {\n\t\t\t\t\tvisibility = visibility ?? (entry.access === \"mutable\" ? DEFAULT_MUTABLE_VISIBILITY : DEFAULT_READONLY_VISIBILITY);\n\t\t\t\t\tbinding.buffer = { type: entry.access === \"mutable\" ? \"storage\" : \"read-only-storage\" };\n\t\t\t\t} else if (\"sampler\" in entry) {\n\t\t\t\t\tvisibility = visibility ?? DEFAULT_READONLY_VISIBILITY;\n\t\t\t\t\tbinding.sampler = { type: entry.sampler };\n\t\t\t\t} else if (\"texture\" in entry) {\n\t\t\t\t\tvisibility = visibility ?? DEFAULT_READONLY_VISIBILITY;\n\t\t\t\t\tconst { multisampled, dimension, bindingSampleType } = entry.texture;\n\t\t\t\t\tbinding.texture = {\n\t\t\t\t\t\tsampleType: entry.sampleType ?? bindingSampleType[0],\n\t\t\t\t\t\tviewDimension: dimension,\n\t\t\t\t\t\tmultisampled\n\t\t\t\t\t};\n\t\t\t\t} else if (\"storageTexture\" in entry) {\n\t\t\t\t\tvisibility = visibility ?? DEFAULT_MUTABLE_VISIBILITY;\n\t\t\t\t\tconst { dimension, access, format } = entry.storageTexture;\n\t\t\t\t\tbinding.storageTexture = {\n\t\t\t\t\t\taccess,\n\t\t\t\t\t\tformat,\n\t\t\t\t\t\tviewDimension: dimension\n\t\t\t\t\t};\n\t\t\t\t} else if (\"externalTexture\" in entry) {\n\t\t\t\t\tvisibility = visibility ?? DEFAULT_READONLY_VISIBILITY;\n\t\t\t\t\tbinding.externalTexture = {};\n\t\t\t\t}\n\t\t\t\tif (visibility?.includes(\"compute\")) binding.visibility |= GPUShaderStage.COMPUTE;\n\t\t\t\tif (visibility?.includes(\"vertex\")) binding.visibility |= GPUShaderStage.VERTEX;\n\t\t\t\tif (visibility?.includes(\"fragment\")) binding.visibility |= GPUShaderStage.FRAGMENT;\n\t\t\t\treturn binding;\n\t\t\t}).filter((v) => v !== null)\n\t\t});\n\t}\n};\nvar TgpuBindGroupImpl = class {\n\tresourceType = \"bind-group\";\n\tconstructor(layout, entries) {\n\t\tthis.layout = layout;\n\t\tthis.entries = entries;\n\t\tfor (const key of Object.keys(layout.entries)) if (layout.entries[key] !== null && !(key in entries)) throw new MissingBindingError(getName(layout), key);\n\t}\n\tunwrap(unwrapper) {\n\t\treturn unwrapper.device.createBindGroup({\n\t\t\tlabel: getName(this.layout) ?? \"<unnamed>\",\n\t\t\tlayout: unwrapper.unwrap(this.layout),\n\t\t\tentries: Object.entries(this.layout.entries).map(([key, entry], idx) => {\n\t\t\t\tif (entry === null) return null;\n\t\t\t\tconst value = this.entries[key];\n\t\t\t\tif (value === void 0) throw new Error(`'${key}' is a resource required to populate bind group layout '${getName(this.layout) ?? \"<unnamed>\"}'.`);\n\t\t\t\tif (\"uniform\" in entry) {\n\t\t\t\t\tlet resource;\n\t\t\t\t\tif (isBuffer(value)) {\n\t\t\t\t\t\tif (!isUsableAsUniform(value)) throw new NotUniformError(value);\n\t\t\t\t\t\tresource = { buffer: unwrapper.unwrap(value) };\n\t\t\t\t\t} else resource = { buffer: value };\n\t\t\t\t\treturn {\n\t\t\t\t\t\tbinding: idx,\n\t\t\t\t\t\tresource\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (\"storage\" in entry) {\n\t\t\t\t\tlet resource;\n\t\t\t\t\tif (isBuffer(value)) {\n\t\t\t\t\t\tif (!isUsableAsStorage(value)) throw new NotStorageError(value);\n\t\t\t\t\t\tresource = { buffer: unwrapper.unwrap(value) };\n\t\t\t\t\t} else resource = { buffer: value };\n\t\t\t\t\treturn {\n\t\t\t\t\t\tbinding: idx,\n\t\t\t\t\t\tresource\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (\"texture\" in entry) {\n\t\t\t\t\tlet resource;\n\t\t\t\t\tif (isTexture(value)) {\n\t\t\t\t\t\tif (!isUsableAsSampled(value)) throw new NotSampledError(value);\n\t\t\t\t\t\tresource = unwrapper.unwrap(value.createView(entry.texture));\n\t\t\t\t\t} else if (isTextureView(value)) resource = unwrapper.unwrap(value);\n\t\t\t\t\telse resource = value;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tbinding: idx,\n\t\t\t\t\t\tresource\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (\"storageTexture\" in entry) {\n\t\t\t\t\tlet resource;\n\t\t\t\t\tif (isTexture(value)) {\n\t\t\t\t\t\tif (!isUsableAsStorage(value)) throw new NotStorageError(value);\n\t\t\t\t\t\tresource = unwrapper.unwrap(value.createView(entry.storageTexture));\n\t\t\t\t\t} else if (isTextureView(value)) resource = unwrapper.unwrap(value);\n\t\t\t\t\telse resource = value;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tbinding: idx,\n\t\t\t\t\t\tresource\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (\"sampler\" in entry) {\n\t\t\t\t\tif (isComparisonSampler(value) || isSampler(value)) return {\n\t\t\t\t\t\tbinding: idx,\n\t\t\t\t\t\tresource: unwrapper.unwrap(value)\n\t\t\t\t\t};\n\t\t\t\t\treturn {\n\t\t\t\t\t\tbinding: idx,\n\t\t\t\t\t\tresource: value\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (\"externalTexture\" in entry) return {\n\t\t\t\t\tbinding: idx,\n\t\t\t\t\tresource: value\n\t\t\t\t};\n\t\t\t\tthrow new Error(`Malformed bind group entry: ${safeStringify(value)}`);\n\t\t\t}).filter((v) => v !== null)\n\t\t});\n\t}\n};\n\n//#endregion\nexport { TgpuBindGroupImpl, bindGroupLayout, isBindGroup, isBindGroupLayout };","import { $gpuCallable, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { stitch } from \"../resolve/stitch.js\";\n\n//#region src/core/unroll/tgpuUnroll.ts\n/**\n* The result of calling `tgpu.unroll(...)`. The code responsible for\n* generating shader code can check if the value of a snippet is\n* an instance of `UnrollableIterable`, and act accordingly.\n*/\nvar UnrollableIterable = class {\n\t[$internal] = true;\n\tconstructor(snippet) {\n\t\tthis.snippet = snippet;\n\t}\n\t[$resolve](_ctx) {\n\t\treturn snip(stitch`${this.snippet}`, this.snippet.dataType, this.snippet.origin);\n\t}\n};\n/**\n* Marks an iterable to be unrolled by the wgslGenerator.\n*/\nconst unroll = (() => {\n\tconst impl = ((value) => value);\n\tsetName(impl, \"unroll\");\n\timpl.toString = () => \"unroll\";\n\timpl[$internal] = true;\n\timpl[$gpuCallable] = { call(_ctx, [value]) {\n\t\treturn snip(new UnrollableIterable(value), value.dataType, value.origin);\n\t} };\n\treturn impl;\n})();\n\n//#endregion\nexport { UnrollableIterable, unroll };","import { $getNameForward, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { getName } from \"../../shared/meta.js\";\nimport { createFnCore } from \"./fnCore.js\";\n\n//#region src/core/function/shelllessImpl.ts\nfunction createShelllessImpl(argTypes, implementation) {\n\tconst core = createFnCore(implementation, \"\");\n\treturn {\n\t\t[$internal]: true,\n\t\t[$getNameForward]: core,\n\t\tresourceType: \"shellless-impl\",\n\t\targTypes,\n\t\t[$resolve](ctx) {\n\t\t\treturn core.resolve(ctx, argTypes, void 0);\n\t\t},\n\t\ttoString() {\n\t\t\treturn `fn*:${getName(core) ?? \"<unnamed>\"}(${argTypes.map((t) => t.toString()).join(\", \")})`;\n\t\t}\n\t};\n}\n\n//#endregion\nexport { createShelllessImpl };","import { getMetaData, getName } from \"../shared/meta.js\";\nimport { isPtr, isWgslArray, isWgslStruct } from \"../data/wgslTypes.js\";\nimport { UnknownData } from \"../data/dataTypes.js\";\nimport { WgslTypeError } from \"../errors.js\";\nimport { getResolutionCtx } from \"../execMode.js\";\nimport { RefOperator } from \"../data/ref.js\";\nimport { concretize } from \"./generationHelpers.js\";\nimport { createShelllessImpl } from \"../core/function/shelllessImpl.js\";\n\n//#region src/tgsl/shellless.ts\nfunction shallowEqualSchemas(a, b) {\n\tif (a.type !== b.type) return false;\n\tif (isPtr(a) && isPtr(b)) return a.access === b.access && a.addressSpace === b.addressSpace && a.implicit === b.implicit && shallowEqualSchemas(a.inner, b.inner);\n\tif (isWgslArray(a) && isWgslArray(b)) return a.elementCount === b.elementCount && shallowEqualSchemas(a.elementType, b.elementType);\n\tif (isWgslStruct(a) && isWgslStruct(b)) return a === b;\n\treturn true;\n}\nvar ShelllessRepository = class {\n\tcache = /* @__PURE__ */ new Map();\n\tget(fn, argSnippets) {\n\t\tconst meta = getMetaData(fn);\n\t\tif (!meta?.ast) return void 0;\n\t\tif (!argSnippets && meta.ast.params.length > 0) throw new Error(`Cannot resolve '${getName(fn)}' directly, because it expects arguments. Either call it from another function, or wrap it in a shell`);\n\t\tconst argTypes = (argSnippets ?? []).map((s, index) => {\n\t\t\tif (s.value instanceof RefOperator) {\n\t\t\t\tif (s.dataType === UnknownData) throw new WgslTypeError(`d.ref() created with primitive types must be stored in a variable before use`);\n\t\t\t\treturn s.dataType;\n\t\t\t}\n\t\t\tif (s.dataType === UnknownData) throw new Error(`Passed illegal value ${s.value} as the #${index} argument to ${meta.name}(...)\\nShellless functions can only accept arguments representing WGSL resources: constructible WGSL types, d.refs, samplers or texture views.\\nRemember, that arguments such as samplers, texture views, accessors, slots etc. should be dereferenced via '.$' first.`);\n\t\t\tlet type = concretize(s.dataType);\n\t\t\tif (s.origin === \"constant-tgpu-const-ref\" || s.origin === \"runtime-tgpu-const-ref\") {\n\t\t\t\tconst ctx = getResolutionCtx();\n\t\t\t\tthrow new Error(`Cannot pass constant references as function arguments. Explicitly copy them by wrapping them in a schema: '${ctx.resolve(type).value}(...)'`);\n\t\t\t}\n\t\t\tif (isPtr(type) && type.implicit) type = type.inner;\n\t\t\treturn type;\n\t\t});\n\t\tlet cache = this.cache.get(fn);\n\t\tif (cache) {\n\t\t\tconst variant = cache.find((v) => v.argTypes.length === argTypes.length && v.argTypes.every((t, i) => shallowEqualSchemas(t, argTypes[i])));\n\t\t\tif (variant) return variant;\n\t\t} else {\n\t\t\tcache = [];\n\t\t\tthis.cache.set(fn, cache);\n\t\t}\n\t\tconst shellless = createShelllessImpl(argTypes, fn);\n\t\tcache.push(shellless);\n\t\treturn shellless;\n\t}\n};\n\n//#endregion\nexport { ShelllessRepository };","import { $internal } from \"../../shared/symbols.js\";\nimport { getName } from \"../../shared/meta.js\";\nimport { RandomNameRegistry, StrictNameRegistry } from \"../../nameRegistry.js\";\nimport { ShelllessRepository } from \"../../tgsl/shellless.js\";\n\n//#region src/core/resolve/namespace.ts\nvar NamespaceImpl = class {\n\t[$internal];\n\tconstructor(nameRegistry) {\n\t\tthis[$internal] = {\n\t\t\tnameRegistry,\n\t\t\tshelllessRepo: new ShelllessRepository(),\n\t\t\tmemoizedResolves: /* @__PURE__ */ new WeakMap(),\n\t\t\tmemoizedLazy: /* @__PURE__ */ new WeakMap(),\n\t\t\tlisteners: { name: /* @__PURE__ */ new Set() }\n\t\t};\n\t}\n\ton(event, listener) {\n\t\tif (event === \"name\") {\n\t\t\tconst listeners = this[$internal].listeners.name;\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => listeners.delete(listener);\n\t\t}\n\t\tthrow new Error(`Unsupported event: ${event}`);\n\t}\n};\nfunction getUniqueName(namespace, resource) {\n\tconst name = namespace.nameRegistry.makeUnique(getName(resource), true);\n\tfor (const listener of namespace.listeners.name) listener({\n\t\ttarget: resource,\n\t\tname\n\t});\n\treturn name;\n}\nfunction namespace(options) {\n\tconst { names = \"strict\" } = options ?? {};\n\treturn new NamespaceImpl(names === \"strict\" ? new StrictNameRegistry() : new RandomNameRegistry());\n}\n\n//#endregion\nexport { getUniqueName, namespace };","import { getCustomLocation, isData } from \"../../data/dataTypes.js\";\nimport { isBuiltin } from \"../../data/attributes.js\";\n\n//#region src/core/vertexLayout/connectAttributesToShader.ts\nfunction isAttribute(value) {\n\treturn typeof value?.format === \"string\";\n}\nfunction connectAttributesToShader(shaderInputLayout, attributes) {\n\tconst usedVertexLayouts = [];\n\tif (isData(shaderInputLayout)) {\n\t\tif (!isAttribute(attributes)) throw new Error(\"Shader expected a single attribute, not a record of attributes to be passed in.\");\n\t\tusedVertexLayouts.push(attributes._layout);\n\t\treturn {\n\t\t\tusedVertexLayouts,\n\t\t\tbufferDefinitions: [{\n\t\t\t\tarrayStride: attributes._layout.stride,\n\t\t\t\tstepMode: attributes._layout.stepMode,\n\t\t\t\tattributes: [{\n\t\t\t\t\tformat: attributes.format,\n\t\t\t\t\toffset: attributes.offset,\n\t\t\t\t\tshaderLocation: getCustomLocation(shaderInputLayout) ?? 0\n\t\t\t\t}]\n\t\t\t}]\n\t\t};\n\t}\n\tconst bufferDefinitions = [];\n\tconst layoutToAttribListMap = /* @__PURE__ */ new WeakMap();\n\tlet nextShaderLocation = 0;\n\tfor (const [key, member] of Object.entries(shaderInputLayout)) {\n\t\tif (isBuiltin(member)) continue;\n\t\tconst matchingAttribute = attributes[key];\n\t\tif (!matchingAttribute) throw new Error(`An attribute by the name of '${key}' was not provided to the shader.`);\n\t\tconst layout = matchingAttribute._layout;\n\t\tlet attribList = layoutToAttribListMap.get(layout);\n\t\tif (!attribList) {\n\t\t\tusedVertexLayouts.push(layout);\n\t\t\tattribList = [];\n\t\t\tbufferDefinitions.push({\n\t\t\t\tarrayStride: layout.stride,\n\t\t\t\tstepMode: layout.stepMode,\n\t\t\t\tattributes: attribList\n\t\t\t});\n\t\t\tlayoutToAttribListMap.set(layout, attribList);\n\t\t}\n\t\tnextShaderLocation = getCustomLocation(member) ?? nextShaderLocation;\n\t\tattribList.push({\n\t\t\tformat: matchingAttribute.format,\n\t\t\toffset: matchingAttribute.offset,\n\t\t\tshaderLocation: nextShaderLocation++\n\t\t});\n\t}\n\treturn {\n\t\tusedVertexLayouts,\n\t\tbufferDefinitions\n\t};\n}\n\n//#endregion\nexport { connectAttributesToShader, isAttribute };","import { $internal } from \"../../shared/symbols.js\";\nimport { isLooseData } from \"../../data/dataTypes.js\";\nimport { assertExhaustive } from \"../../shared/utilityTypes.js\";\nimport { formatToWGSLType } from \"../../data/vertexFormatData.js\";\nimport { getAttributesString } from \"../../data/attributes.js\";\nimport { isWgslComparisonSampler, isWgslSampler } from \"../../data/sampler.js\";\nimport { accessModeMap, isWgslStorageTexture, isWgslTexture } from \"../../data/texture.js\";\nimport { isAttribute } from \"../vertexLayout/connectAttributesToShader.js\";\n\n//#region src/core/resolve/resolveData.ts\n/**\n* Schemas for which their `type` property directly\n* translates to the resulting WGSL code.\n*/\nconst identityTypes = [\n\t\"bool\",\n\t\"f32\",\n\t\"f16\",\n\t\"i32\",\n\t\"u32\",\n\t\"vec2f\",\n\t\"vec3f\",\n\t\"vec4f\",\n\t\"vec2h\",\n\t\"vec3h\",\n\t\"vec4h\",\n\t\"vec2i\",\n\t\"vec3i\",\n\t\"vec4i\",\n\t\"vec2u\",\n\t\"vec3u\",\n\t\"vec4u\",\n\t\"vec2<bool>\",\n\t\"vec3<bool>\",\n\t\"vec4<bool>\",\n\t\"mat2x2f\",\n\t\"mat3x3f\",\n\t\"mat4x4f\",\n\t\"texture_external\"\n];\nfunction isIdentityType(data) {\n\treturn identityTypes.includes(data.type);\n}\n/**\n* Resolves a single property of a struct.\n* @param ctx - The resolution context.\n* @param key - The key of the property.\n* @param property - The property itself.\n*\n* @returns The resolved property string.\n*/\nfunction resolveStructProperty(ctx, [key, property]) {\n\treturn ` ${getAttributesString(property)}${key}: ${ctx.resolve(property).value},\\n`;\n}\n/**\n* Resolves a struct and adds its declaration to the resolution context.\n* @param ctx - The resolution context.\n* @param struct - The struct to resolve.\n*\n* @returns The resolved struct name.\n*/\nfunction resolveStruct(ctx, struct) {\n\tif (struct[$internal].isAbstruct) throw new Error(\"Cannot resolve abstract struct types to WGSL.\");\n\tconst id = ctx.getUniqueName(struct);\n\tctx.addDeclaration(`\\\nstruct ${id} {\n${Object.entries(struct.propTypes).map((prop) => resolveStructProperty(ctx, prop)).join(\"\")}\\\n}`);\n\treturn id;\n}\n/**\n* Resolves an unstruct (struct that does not align data by default) to its struct data counterpart.\n* @param ctx - The resolution context.\n* @param unstruct - The unstruct to resolve.\n*\n* @returns The resolved unstruct name.\n*\n* @example\n* ```ts\n* resolveUnstruct(ctx, {\n* uv: d.float16x2, // -> d.vec2f after resolution\n* color: d.snorm8x4, -> d.vec4f after resolution\n* });\n* ```\n*/\nfunction resolveUnstruct(ctx, unstruct) {\n\tconst id = ctx.getUniqueName(unstruct);\n\tctx.addDeclaration(`\\\nstruct ${id} {\n${Object.entries(unstruct.propTypes).map((prop) => isAttribute(prop[1]) ? resolveStructProperty(ctx, [prop[0], formatToWGSLType[prop[1].format]]) : resolveStructProperty(ctx, prop)).join(\"\")}\n}`);\n\treturn id;\n}\n/**\n* Resolves an array.\n* @param ctx - The resolution context.\n* @param array - The array to resolve.\n*\n* @returns The resolved array name along with its element type and count (if not runtime-sized).\n*\n* @example\n* ```ts\n* resolveArray(ctx, d.arrayOf(d.u32, 0)); // 'array<u32>' (not a real pattern, a function is preferred)\n* resolveArray(ctx, d.arrayOf(d.u32, 5)); // 'array<u32, 5>'\n* ```\n*/\nfunction resolveArray(ctx, array) {\n\tconst element = ctx.resolve(array.elementType).value;\n\treturn array.elementCount === 0 ? `array<${element}>` : `array<${element}, ${array.elementCount}>`;\n}\nfunction resolveDisarray(ctx, disarray) {\n\tconst element = ctx.resolve(isAttribute(disarray.elementType) ? formatToWGSLType[disarray.elementType.format] : disarray.elementType).value;\n\treturn disarray.elementCount === 0 ? `array<${element}>` : `array<${element}, ${disarray.elementCount}>`;\n}\n/**\n* Resolves a WGSL data-type schema to a string.\n* @param ctx - The resolution context.\n* @param data - The data-type to resolve.\n*\n* @returns The resolved data-type string.\n*/\nfunction resolveData(ctx, data) {\n\tif (isLooseData(data)) {\n\t\tif (data.type === \"unstruct\") return resolveUnstruct(ctx, data);\n\t\tif (data.type === \"disarray\") return resolveDisarray(ctx, data);\n\t\tif (data.type === \"loose-decorated\") return ctx.resolve(isAttribute(data.inner) ? formatToWGSLType[data.inner.format] : data.inner).value;\n\t\treturn ctx.resolve(formatToWGSLType[data.type]).value;\n\t}\n\tif (isIdentityType(data)) return data.type;\n\tif (data.type === \"struct\") return resolveStruct(ctx, data);\n\tif (data.type === \"array\") return resolveArray(ctx, data);\n\tif (data.type === \"atomic\") return `atomic<${resolveData(ctx, data.inner)}>`;\n\tif (data.type === \"decorated\") return ctx.resolve(data.inner).value;\n\tif (data.type === \"ptr\") {\n\t\tif (data.addressSpace === \"storage\") return `ptr<storage, ${ctx.resolve(data.inner).value}, ${data.access === \"read-write\" ? \"read_write\" : data.access}>`;\n\t\treturn `ptr<${data.addressSpace}, ${ctx.resolve(data.inner).value}>`;\n\t}\n\tif (data.type === \"abstractInt\" || data.type === \"abstractFloat\" || data.type === \"void\" || data.type === \"u16\") throw new Error(`${data.type} has no representation in WGSL`);\n\tif (isWgslStorageTexture(data)) return `${data.type}<${data.format}, ${accessModeMap[data.access]}>`;\n\tif (isWgslTexture(data)) return data.type.startsWith(\"texture_depth\") ? data.type : `${data.type}<${data.sampleType.type}>`;\n\tif (isWgslComparisonSampler(data) || isWgslSampler(data)) return data.type;\n\tassertExhaustive(data, \"resolveData\");\n}\n\n//#endregion\nexport { resolveData };","import { isAccessor, isMutableAccessor } from \"../slot/slotTypes.js\";\n\n//#region src/core/root/configurableImpl.ts\nvar ConfigurableImpl = class ConfigurableImpl {\n\tconstructor(bindings) {\n\t\tthis.bindings = bindings;\n\t}\n\twith(slot, value) {\n\t\treturn new ConfigurableImpl([...this.bindings, [isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot, value]]);\n\t}\n\tpipe(transform) {\n\t\tconst newCfg = transform(this);\n\t\treturn new ConfigurableImpl([...this.bindings, ...newCfg.bindings]);\n\t}\n};\n\n//#endregion\nexport { ConfigurableImpl };","//#region src/shared/generators.ts\n/**\n* Yields values in the sequence 0,1,2..∞ except for the ones in the `excluded` set.\n*/\nfunction* naturalsExcept(excluded) {\n\tlet next = 0;\n\twhile (true) {\n\t\tif (!excluded.has(next)) yield next;\n\t\tnext++;\n\t}\n}\n\n//#endregion\nexport { naturalsExcept };","import { $internal } from \"../shared/symbols.js\";\nimport { schemaCallWrapper } from \"./schemaCallWrapper.js\";\nimport { sizeOf } from \"./sizeOf.js\";\nimport { comptime } from \"../core/function/comptime.js\";\n\n//#region src/data/array.ts\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*/\nconst arrayOf = comptime(((elementType, elementCount) => {\n\tif (elementCount === void 0) return comptime((count) => cpu_arrayOf(elementType, count));\n\treturn cpu_arrayOf(elementType, elementCount);\n})).$name(\"arrayOf\");\nfunction cpu_arrayOf(elementType, elementCount) {\n\tconst arraySchema = (elements) => {\n\t\tif (elements && elements.length !== elementCount) throw new Error(`Array schema of ${elementCount} elements of type ${elementType.type} called with ${elements.length} argument(s).`);\n\t\treturn Array.from({ length: elementCount }, (_, i) => schemaCallWrapper(elementType, elements?.[i]));\n\t};\n\tObject.setPrototypeOf(arraySchema, WgslArrayImpl);\n\tif (Number.isNaN(sizeOf(elementType))) throw new Error(\"Cannot nest runtime sized arrays.\");\n\tarraySchema.elementType = elementType;\n\tif (!Number.isInteger(elementCount) || elementCount < 0) throw new Error(`Cannot create array schema with invalid element count: ${elementCount}.`);\n\tarraySchema.elementCount = elementCount;\n\treturn arraySchema;\n}\nconst WgslArrayImpl = {\n\t[$internal]: true,\n\ttype: \"array\",\n\ttoString() {\n\t\treturn `arrayOf(${this.elementType}, ${this.elementCount})`;\n\t}\n};\n\n//#endregion\nexport { arrayOf };","import { $internal } from \"../shared/symbols.js\";\n\n//#region src/data/atomic.ts\n/**\n* Marks a concrete integer scalar type schema (u32 or i32) as a WGSL atomic.\n*\n* @example\n* const atomicU32 = d.atomic(d.u32);\n* const atomicI32 = d.atomic(d.i32);\n*\n* @param data Underlying type schema.\n*/\nfunction atomic(data) {\n\treturn new AtomicImpl(data);\n}\nvar AtomicImpl = class {\n\t[$internal] = {};\n\ttype = \"atomic\";\n\tconstructor(inner) {\n\t\tthis.inner = inner;\n\t}\n};\n\n//#endregion\nexport { atomic };","import { getName } from \"../../shared/meta.js\";\nimport { isWgslArray, isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { bool, f16, f32, i32, u32 } from \"../../data/numeric.js\";\nimport { vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u } from \"../../data/vector.js\";\nimport { sizeOf } from \"../../data/sizeOf.js\";\nimport { mat2x2f, mat3x3f, mat4x4f } from \"../../data/matrix.js\";\nimport { fn } from \"../../core/function/tgpuFn.js\";\nimport { slot } from \"../../core/slot/slot.js\";\nimport { privateVar } from \"../../core/variable/tgpuVariable.js\";\n\n//#region src/tgsl/consoleLog/serializers.ts\nconst dataBlockIndex = privateVar(u32, 0).$name(\"dataBlockIndex\");\nconst dataByteIndex = privateVar(u32, 0).$name(\"dataByteIndex\");\nconst dataBufferSlot = slot().$name(\"dataBuffer\");\nconst nextByteIndex = fn([], u32)`() {\n let i = dataByteIndex;\n dataByteIndex = dataByteIndex + 1u;\n return i;\n}`.$uses({ dataByteIndex }).$name(\"nextByteIndex\");\nconst nextU32 = \"dataBuffer[dataBlockIndex].serializedData[nextByteIndex()]\";\nconst serializerMap = {\n\tf32: fn([f32])`(n) => {\n ${nextU32} = bitcast<u32>(n);\n}`,\n\tf16: fn([f16])`(n) => {\n ${nextU32} = pack2x16float(vec2f(f32(n), 0.0));\n}`,\n\ti32: fn([i32])`(n) => {\n ${nextU32} = bitcast<u32>(n);\n}`,\n\tu32: fn([u32])`(n) => {\n ${nextU32} = n;\n}`,\n\tbool: fn([bool])`(b) => {\n ${nextU32} = u32(b);\n}`,\n\tvec2f: fn([vec2f])`(v) => {\n ${nextU32} = bitcast<u32>(v.x);\n ${nextU32} = bitcast<u32>(v.y);\n}`,\n\tvec3f: fn([vec3f])`(v) => {\n ${nextU32} = bitcast<u32>(v.x);\n ${nextU32} = bitcast<u32>(v.y);\n ${nextU32} = bitcast<u32>(v.z);\n}`,\n\tvec4f: fn([vec4f])`(v) => {\n ${nextU32} = bitcast<u32>(v.x);\n ${nextU32} = bitcast<u32>(v.y);\n ${nextU32} = bitcast<u32>(v.z);\n ${nextU32} = bitcast<u32>(v.w);\n}`,\n\tvec2h: fn([vec2h])`(v) => {\n ${nextU32} = pack2x16float(vec2f(f32(v.x), f32(v.y)));\n}`,\n\tvec3h: fn([vec3h])`(v) => {\n ${nextU32} = pack2x16float(vec2f(f32(v.x), f32(v.y)));\n ${nextU32} = pack2x16float(vec2f(f32(v.z), 0.0));\n}`,\n\tvec4h: fn([vec4h])`(v) => {\n ${nextU32} = pack2x16float(vec2f(f32(v.x), f32(v.y)));\n ${nextU32} = pack2x16float(vec2f(f32(v.z), f32(v.w)));\n}`,\n\tvec2i: fn([vec2i])`(v) => {\n ${nextU32} = bitcast<u32>(v.x);\n ${nextU32} = bitcast<u32>(v.y);\n}`,\n\tvec3i: fn([vec3i])`(v) => {\n ${nextU32} = bitcast<u32>(v.x);\n ${nextU32} = bitcast<u32>(v.y);\n ${nextU32} = bitcast<u32>(v.z);\n}`,\n\tvec4i: fn([vec4i])`(v) => {\n ${nextU32} = bitcast<u32>(v.x);\n ${nextU32} = bitcast<u32>(v.y);\n ${nextU32} = bitcast<u32>(v.z);\n ${nextU32} = bitcast<u32>(v.w);\n}`,\n\tvec2u: fn([vec2u])`(v) => {\n ${nextU32} = v.x;\n ${nextU32} = v.y;\n}`,\n\tvec3u: fn([vec3u])`(v) => {\n ${nextU32} = v.x;\n ${nextU32} = v.y;\n ${nextU32} = v.z;\n}`,\n\tvec4u: fn([vec4u])`(v) => {\n ${nextU32} = v.x;\n ${nextU32} = v.y;\n ${nextU32} = v.z;\n ${nextU32} = v.w;\n}`,\n\t\"vec2<bool>\": fn([vec2b])`(v) => {\n ${nextU32} = u32(v.x);\n ${nextU32} = u32(v.y);\n}`,\n\t\"vec3<bool>\": fn([vec3b])`(v) => {\n ${nextU32} = u32(v.x);\n ${nextU32} = u32(v.y);\n ${nextU32} = u32(v.z);\n}`,\n\t\"vec4<bool>\": fn([vec4b])`(v) => {\n ${nextU32} = u32(v.x);\n ${nextU32} = u32(v.y);\n ${nextU32} = u32(v.z);\n ${nextU32} = u32(v.w);\n}`,\n\tmat2x2f: fn([mat2x2f])`(m) => {\n ${nextU32} = bitcast<u32>(m[0][0]);\n ${nextU32} = bitcast<u32>(m[0][1]);\n ${nextU32} = bitcast<u32>(m[1][0]);\n ${nextU32} = bitcast<u32>(m[1][1]);\n}`,\n\tmat3x3f: fn([mat3x3f])`(m) => {\n ${nextU32} = bitcast<u32>(m[0][0]);\n ${nextU32} = bitcast<u32>(m[0][1]);\n ${nextU32} = bitcast<u32>(m[0][2]);\n ${nextU32} = 0u;\n ${nextU32} = bitcast<u32>(m[1][0]);\n ${nextU32} = bitcast<u32>(m[1][1]);\n ${nextU32} = bitcast<u32>(m[1][2]);\n ${nextU32} = 0u;\n ${nextU32} = bitcast<u32>(m[2][0]);\n ${nextU32} = bitcast<u32>(m[2][1]);\n ${nextU32} = bitcast<u32>(m[2][2]);\n ${nextU32} = 0u;\n}`,\n\tmat4x4f: fn([mat4x4f])`(m) => {\n ${nextU32} = bitcast<u32>(m[0][0]);\n ${nextU32} = bitcast<u32>(m[0][1]);\n ${nextU32} = bitcast<u32>(m[0][2]);\n ${nextU32} = bitcast<u32>(m[0][3]);\n ${nextU32} = bitcast<u32>(m[1][0]);\n ${nextU32} = bitcast<u32>(m[1][1]);\n ${nextU32} = bitcast<u32>(m[1][2]);\n ${nextU32} = bitcast<u32>(m[1][3]);\n ${nextU32} = bitcast<u32>(m[2][0]);\n ${nextU32} = bitcast<u32>(m[2][1]);\n ${nextU32} = bitcast<u32>(m[2][2]);\n ${nextU32} = bitcast<u32>(m[2][3]);\n ${nextU32} = bitcast<u32>(m[3][0]);\n ${nextU32} = bitcast<u32>(m[3][1]);\n ${nextU32} = bitcast<u32>(m[3][2]);\n ${nextU32} = bitcast<u32>(m[3][3]);\n}`\n};\nfor (const [name, serializer] of Object.entries(serializerMap)) serializer.$name(`serialize${name[0].toLocaleUpperCase()}${name.slice(1)}`).$uses({\n\tdataBlockIndex,\n\tnextByteIndex,\n\tdataBuffer: dataBufferSlot\n});\nfunction generateHeader(argTypes) {\n\treturn `(${argTypes.map((_, i) => `_arg_${i}`).join(\", \")})`;\n}\n/**\n* Returns a serializer TGPU function for a given WGSL data type.\n* If the data type is a base type, one of the preexisting functions (with the `dataBufferSlot` filled) is returned.\n* Otherwise, a new function is generated.\n*\n* @param dataType - The WGSL data type descriptor to return a serializer for\n* @param dataBuffer - A buffer to store serialized log call data (a necessary external for the returned function)\n*/\nfunction getSerializer(dataType, dataBuffer) {\n\tconst maybeSerializer = serializerMap[dataType.type];\n\tif (maybeSerializer) return maybeSerializer.with(dataBufferSlot, dataBuffer);\n\tif (isWgslStruct(dataType)) {\n\t\tconst props = Object.keys(dataType.propTypes);\n\t\tconst propsSerializer = createCompoundSerializer(Object.values(dataType.propTypes), dataBuffer);\n\t\treturn fn([dataType])`(arg) {\\n propsSerializer(${props.map((prop) => `arg.${prop}`).join(\", \")});\\n}`.$uses({ propsSerializer }).$name(`${getName(dataType) ?? \"struct\"}Serializer`);\n\t}\n\tif (isWgslArray(dataType)) {\n\t\tconst elementType = dataType.elementType;\n\t\tconst length = dataType.elementCount;\n\t\tconst elementSerializer = getSerializer(elementType, dataBuffer);\n\t\treturn fn([dataType])`(arg) {\\n${Array.from({ length }, (_, i) => ` elementSerializer(arg[${i}]);`).join(\"\\n\")}\\n}`.$uses({ elementSerializer }).$name(\"arraySerializer\");\n\t}\n\tthrow new Error(`Cannot serialize data of type ${dataType.type}`);\n}\n/**\n* Creates a compound serializer TGPU function that serializes multiple arguments of different types to the data buffer.\n*\n* @param dataTypes - Array of WGSL data types that define the types of arguments to be serialized\n* @param dataBuffer - A buffer to store serialized log call data (a necessary external for the returned function)\n*/\nfunction createCompoundSerializer(dataTypes, dataBuffer) {\n\tconst usedSerializers = {};\n\treturn fn(dataTypes)`${generateHeader(dataTypes)} {\\n${dataTypes.map((arg, i) => {\n\t\tusedSerializers[`serializer${i}`] = getSerializer(arg, dataBuffer);\n\t\treturn ` serializer${i}(_arg_${i});`;\n\t}).join(\"\\n\")}\\n}`.$uses(usedSerializers).$name(\"compoundSerializer\");\n}\n/**\n* Creates a TGPU function that serializes data to the log buffer.\n*\n* @param id - Identifier for this logging function instance\n* @param dataTypes - Array of WGSL data types that will be logged by this function\n* @param dataBuffer - Mutable buffer array to store serialized log call data\n* @param indexBuffer - Atomic counter buffer to track the next available log data slot\n* @param logOptions - Configuration options\n*/\nfunction createLoggingFunction(id, dataTypes, dataBuffer, indexBuffer, logOptions) {\n\tconst serializedSize = dataTypes.map(sizeOf).reduce((a, b) => a + b, 0);\n\tif (serializedSize > logOptions.logSizeLimit) throw new Error(`Logged data needs to fit in ${logOptions.logSizeLimit} bytes (one of the logs requires ${serializedSize} bytes). Consider increasing the limit by passing appropriate options to tgpu.init().`);\n\tconst compoundSerializer = createCompoundSerializer(dataTypes, dataBuffer).$name(`log${id}serializer`);\n\tconst header = generateHeader(dataTypes);\n\treturn fn(dataTypes)`${header} {\n dataBlockIndex = atomicAdd(&indexBuffer, 1);\n if (dataBlockIndex >= ${logOptions.logCountLimit}) {\n return;\n }\n dataBuffer[dataBlockIndex].id = ${id};\n dataByteIndex = 0;\n\n compoundSerializer${header};\n}`.$uses({\n\t\tindexBuffer,\n\t\tdataBuffer,\n\t\tdataBlockIndex,\n\t\tdataByteIndex,\n\t\tcompoundSerializer\n\t}).$name(`log${id}`);\n}\n\n//#endregion\nexport { createLoggingFunction };","//#region src/tgsl/consoleLog/types.ts\nconst supportedLogOps = [\n\t\"log\",\n\t\"debug\",\n\t\"info\",\n\t\"warn\",\n\t\"error\",\n\t\"clear\"\n];\n\n//#endregion\nexport { supportedLogOps };","import { $internal } from \"../../shared/symbols.js\";\nimport { Void } from \"../../data/wgslTypes.js\";\nimport { UnknownData } from \"../../data/dataTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { stitch } from \"../../core/resolve/stitch.js\";\nimport { u32 } from \"../../data/numeric.js\";\nimport { struct } from \"../../data/struct.js\";\nimport { concretizeSnippets } from \"../generationHelpers.js\";\nimport { shaderStageSlot } from \"../../core/slot/internalSlots.js\";\nimport { arrayOf } from \"../../data/array.js\";\nimport { atomic } from \"../../data/atomic.js\";\nimport { createLoggingFunction } from \"./serializers.js\";\nimport { supportedLogOps } from \"./types.js\";\n\n//#region src/tgsl/consoleLog/logGenerator.ts\nconst defaultOptions = {\n\tlogCountLimit: 64,\n\tlogSizeLimit: 252,\n\tmessagePrefix: \" GPU \"\n};\nconst fallbackSnippet = snip(\"/* console.log() */\", Void, \"runtime\");\nvar LogGeneratorNullImpl = class {\n\tget logResources() {}\n\tgenerateLog() {\n\t\tconsole.warn(\"'console.log' is only supported when resolving pipelines.\");\n\t\treturn fallbackSnippet;\n\t}\n};\nvar LogGeneratorImpl = class {\n\t#options;\n\t#logIdToMeta;\n\t#firstUnusedId = 1;\n\t#indexBuffer;\n\t#dataBuffer;\n\tconstructor(root) {\n\t\tthis.#options = {\n\t\t\t...defaultOptions,\n\t\t\t...root[$internal].logOptions\n\t\t};\n\t\tthis.#logIdToMeta = /* @__PURE__ */ new Map();\n\t\tconst SerializedLogData = struct({\n\t\t\tid: u32,\n\t\t\tserializedData: arrayOf(u32, Math.ceil(this.#options.logSizeLimit / 4))\n\t\t}).$name(\"SerializedLogData\");\n\t\tthis.#dataBuffer = root.createMutable(arrayOf(SerializedLogData, this.#options.logCountLimit)).$name(\"dataBuffer\");\n\t\tthis.#indexBuffer = root.createMutable(atomic(u32)).$name(\"indexBuffer\");\n\t}\n\t/**\n\t* Generates all necessary resources for serializing arguments for logging purposes.\n\t*\n\t* @param ctx Resolution context.\n\t* @param args Argument snippets. Snippets of UnknownType will be treated as string literals.\n\t* @returns A snippet containing the call to the logging function.\n\t*/\n\tgenerateLog(ctx, op, args) {\n\t\tif (shaderStageSlot.$ === \"vertex\") {\n\t\t\tconsole.warn(`'console.${op}' is not supported in vertex shaders.`);\n\t\t\treturn fallbackSnippet;\n\t\t}\n\t\tif (!supportedLogOps.includes(op)) {\n\t\t\tconsole.warn(`Unsupported log method '${op}'.`);\n\t\t\treturn fallbackSnippet;\n\t\t}\n\t\tconst concreteArgs = concretizeSnippets(args);\n\t\tconst id = this.#firstUnusedId++;\n\t\tconst nonStringArgs = concreteArgs.filter((e) => e.dataType !== UnknownData);\n\t\tconst logFn = createLoggingFunction(id, nonStringArgs.map((e) => e.dataType), this.#dataBuffer, this.#indexBuffer, this.#options);\n\t\tconst argTypes = concreteArgs.map((e) => e.dataType === UnknownData ? e.value : e.dataType);\n\t\tthis.#logIdToMeta.set(id, {\n\t\t\top,\n\t\t\targTypes\n\t\t});\n\t\treturn snip(stitch`${ctx.resolve(logFn).value}(${nonStringArgs})`, Void, \"runtime\");\n\t}\n\tget logResources() {\n\t\treturn this.#firstUnusedId === 1 ? void 0 : {\n\t\t\tdataBuffer: this.#dataBuffer,\n\t\t\tindexBuffer: this.#indexBuffer,\n\t\t\toptions: this.#options,\n\t\t\tlogIdToMeta: this.#logIdToMeta\n\t\t};\n\t}\n};\n\n//#endregion\nexport { LogGeneratorImpl, LogGeneratorNullImpl };","import { isHalfPrecisionSchema, isVecInstance } from \"../data/wgslTypes.js\";\nimport { SignatureNotSupportedError } from \"../errors.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { unify } from \"../tgsl/conversion.js\";\nimport { abstractFloat, abstractInt, f16, f32, i32, u32 } from \"../data/numeric.js\";\nimport { vec2f, vec2h, vec2i, vec2u, vec3f, vec3h, vec3i, vec3u, vec4f, vec4h, vec4i, vec4u } from \"../data/vector.js\";\nimport { abstruct } from \"../data/struct.js\";\nimport { MissingCpuImplError, dualImpl } from \"../core/function/dualImpl.js\";\nimport { mat2x2f, mat3x3f, mat4x4f } from \"../data/matrix.js\";\nimport { smoothstepScalar } from \"../data/numberOps.js\";\nimport { VectorOps } from \"../data/vectorOps.js\";\nimport { mul, sub } from \"./operators.js\";\n\n//#region src/std/numeric.ts\nconst unaryIdentitySignature = (arg) => {\n\treturn {\n\t\targTypes: [arg],\n\t\treturnType: arg\n\t};\n};\nconst variadicUnifySignature = (...args) => {\n\tconst uargs = unify(args) ?? args;\n\treturn {\n\t\targTypes: uargs,\n\t\treturnType: uargs[0]\n\t};\n};\nconst unifyRestrictedSignature = (restrict) => (...args) => {\n\tconst uargs = unify(args, restrict);\n\tif (!uargs) throw new SignatureNotSupportedError(args, restrict);\n\treturn {\n\t\targTypes: uargs,\n\t\treturnType: uargs[0]\n\t};\n};\nfunction variadicReduce(fn) {\n\treturn (fst, ...rest) => {\n\t\tlet acc = fst;\n\t\tfor (const r of rest) acc = fn(acc, r);\n\t\treturn acc;\n\t};\n}\nfunction variadicStitch(wrapper) {\n\treturn (_ctx, [fst, ...rest]) => {\n\t\tlet acc = stitch`${fst}`;\n\t\tfor (const r of rest) acc = stitch`${wrapper}(${acc}, ${r})`;\n\t\treturn acc;\n\t};\n}\nconst anyFloatPrimitive = [\n\tf32,\n\tf16,\n\tabstractFloat\n];\nconst anyFloatVec = [\n\tvec2f,\n\tvec3f,\n\tvec4f,\n\tvec2h,\n\tvec3h,\n\tvec4h\n];\nconst anyFloat = [...anyFloatPrimitive, ...anyFloatVec];\nconst anyConcreteIntegerPrimitive = [i32, u32];\nconst anyConcreteIntegerVec = [\n\tvec2i,\n\tvec3i,\n\tvec4i,\n\tvec2u,\n\tvec3u,\n\tvec4u\n];\nconst anyConcreteInteger = [...anyConcreteIntegerPrimitive, ...anyConcreteIntegerVec];\nfunction cpuAbs(value) {\n\tif (typeof value === \"number\") return Math.abs(value);\n\treturn VectorOps.abs[value.kind](value);\n}\nconst abs = dualImpl({\n\tname: \"abs\",\n\tsignature: unaryIdentitySignature,\n\tnormalImpl: cpuAbs,\n\tcodegenImpl: (_ctx, [value]) => stitch`abs(${value})`\n});\nfunction cpuAcos(value) {\n\tif (typeof value === \"number\") return Math.acos(value);\n\treturn VectorOps.acos[value.kind](value);\n}\nconst acos = dualImpl({\n\tname: \"acos\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAcos,\n\tcodegenImpl: (_ctx, [value]) => stitch`acos(${value})`\n});\nfunction cpuAcosh(value) {\n\tif (typeof value === \"number\") return Math.acosh(value);\n\treturn VectorOps.acosh[value.kind](value);\n}\nconst acosh = dualImpl({\n\tname: \"acosh\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAcosh,\n\tcodegenImpl: (_ctx, [value]) => stitch`acosh(${value})`\n});\nfunction cpuAsin(value) {\n\tif (typeof value === \"number\") return Math.asin(value);\n\treturn VectorOps.asin[value.kind](value);\n}\nconst asin = dualImpl({\n\tname: \"asin\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAsin,\n\tcodegenImpl: (_ctx, [value]) => stitch`asin(${value})`\n});\nfunction cpuAsinh(value) {\n\tif (typeof value === \"number\") return Math.asinh(value);\n\treturn VectorOps.asinh[value.kind](value);\n}\nconst asinh = dualImpl({\n\tname: \"asinh\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAsinh,\n\tcodegenImpl: (_ctx, [value]) => stitch`asinh(${value})`\n});\nfunction cpuAtan(value) {\n\tif (typeof value === \"number\") return Math.atan(value);\n\treturn VectorOps.atan[value.kind](value);\n}\nconst atan = dualImpl({\n\tname: \"atan\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAtan,\n\tcodegenImpl: (_ctx, [value]) => stitch`atan(${value})`\n});\nfunction cpuAtanh(value) {\n\tif (typeof value === \"number\") return Math.atanh(value);\n\treturn VectorOps.atanh[value.kind](value);\n}\nconst atanh = dualImpl({\n\tname: \"atanh\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAtanh,\n\tcodegenImpl: (_ctx, [value]) => stitch`atanh(${value})`\n});\nfunction cpuAtan2(y, x) {\n\tif (typeof y === \"number\" && typeof x === \"number\") return Math.atan2(y, x);\n\treturn VectorOps.atan2[y.kind](y, x);\n}\nconst atan2 = dualImpl({\n\tname: \"atan2\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuAtan2,\n\tcodegenImpl: (_ctx, [y, x]) => stitch`atan2(${y}, ${x})`\n});\nfunction cpuCeil(value) {\n\tif (typeof value === \"number\") return Math.ceil(value);\n\treturn VectorOps.ceil[value.kind](value);\n}\nconst ceil = dualImpl({\n\tname: \"ceil\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuCeil,\n\tcodegenImpl: (_ctx, [value]) => stitch`ceil(${value})`\n});\nfunction cpuClamp(value, low, high) {\n\tif (typeof value === \"number\") return Math.min(Math.max(low, value), high);\n\treturn VectorOps.clamp[value.kind](value, low, high);\n}\nconst clamp = dualImpl({\n\tname: \"clamp\",\n\tsignature: variadicUnifySignature,\n\tnormalImpl: cpuClamp,\n\tcodegenImpl: (_ctx, [value, low, high]) => stitch`clamp(${value}, ${low}, ${high})`\n});\nfunction cpuCos(value) {\n\tif (typeof value === \"number\") return Math.cos(value);\n\treturn VectorOps.cos[value.kind](value);\n}\nconst cos = dualImpl({\n\tname: \"cos\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuCos,\n\tcodegenImpl: (_ctx, [value]) => stitch`cos(${value})`\n});\nfunction cpuCosh(value) {\n\tif (typeof value === \"number\") return Math.cosh(value);\n\treturn VectorOps.cosh[value.kind](value);\n}\nconst cosh = dualImpl({\n\tname: \"cosh\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuCosh,\n\tcodegenImpl: (_ctx, [value]) => stitch`cosh(${value})`\n});\nconst countLeadingZeros = dualImpl({\n\tname: \"countLeadingZeros\",\n\tsignature: unifyRestrictedSignature(anyConcreteInteger),\n\tnormalImpl: \"CPU implementation for countLeadingZeros not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`countLeadingZeros(${value})`\n});\nconst countOneBits = dualImpl({\n\tname: \"countOneBits\",\n\tsignature: unifyRestrictedSignature(anyConcreteInteger),\n\tnormalImpl: \"CPU implementation for countOneBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`countOneBits(${value})`\n});\nconst countTrailingZeros = dualImpl({\n\tname: \"countTrailingZeros\",\n\tsignature: unifyRestrictedSignature(anyConcreteInteger),\n\tnormalImpl: \"CPU implementation for countTrailingZeros not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`countTrailingZeros(${value})`\n});\nconst cross = dualImpl({\n\tname: \"cross\",\n\tsignature: unifyRestrictedSignature([vec3f, vec3h]),\n\tnormalImpl: (a, b) => VectorOps.cross[a.kind](a, b),\n\tcodegenImpl: (_ctx, [a, b]) => stitch`cross(${a}, ${b})`\n});\nfunction cpuDegrees(value) {\n\tif (typeof value === \"number\") return value * 180 / Math.PI;\n\tthrow new MissingCpuImplError(\"CPU implementation for degrees on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst degrees = dualImpl({\n\tname: \"degrees\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuDegrees,\n\tcodegenImpl: (_ctx, [value]) => stitch`degrees(${value})`\n});\nconst determinant = dualImpl({\n\tname: \"determinant\",\n\tsignature: (arg) => {\n\t\tif (!(arg.type === \"mat2x2f\" || arg.type === \"mat3x3f\" || arg.type === \"mat4x4f\")) throw new SignatureNotSupportedError([arg], [\n\t\t\tmat2x2f,\n\t\t\tmat3x3f,\n\t\t\tmat4x4f\n\t\t]);\n\t\treturn {\n\t\t\targTypes: [arg],\n\t\t\treturnType: f32\n\t\t};\n\t},\n\tnormalImpl: \"CPU implementation for determinant not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`determinant(${value})`\n});\nfunction cpuDistance(a, b) {\n\tif (typeof a === \"number\" && typeof b === \"number\") return Math.abs(a - b);\n\treturn length(sub(a, b));\n}\nconst distance = dualImpl({\n\tname: \"distance\",\n\tsignature: (...args) => {\n\t\tconst uargs = unify(args, anyFloat);\n\t\tif (!uargs) throw new SignatureNotSupportedError(args, anyFloat);\n\t\treturn {\n\t\t\targTypes: uargs,\n\t\t\treturnType: isHalfPrecisionSchema(uargs[0]) ? f16 : f32\n\t\t};\n\t},\n\tnormalImpl: cpuDistance,\n\tcodegenImpl: (_ctx, [a, b]) => stitch`distance(${a}, ${b})`\n});\nconst dot = dualImpl({\n\tname: \"dot\",\n\tsignature: (...args) => ({\n\t\targTypes: args,\n\t\treturnType: args[0].primitive\n\t}),\n\tnormalImpl: (lhs, rhs) => VectorOps.dot[lhs.kind](lhs, rhs),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`dot(${lhs}, ${rhs})`\n});\nconst dot4U8Packed = dualImpl({\n\tname: \"dot4U8Packed\",\n\tsignature: {\n\t\targTypes: [u32, u32],\n\t\treturnType: u32\n\t},\n\tnormalImpl: \"CPU implementation for dot4U8Packed not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e1, e2]) => stitch`dot4U8Packed(${e1}, ${e2})`\n});\nconst dot4I8Packed = dualImpl({\n\tname: \"dot4I8Packed\",\n\tsignature: {\n\t\targTypes: [u32, u32],\n\t\treturnType: i32\n\t},\n\tnormalImpl: \"CPU implementation for dot4I8Packed not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e1, e2]) => stitch`dot4I8Packed(${e1}, ${e2})`\n});\nfunction cpuExp(value) {\n\tif (typeof value === \"number\") return Math.exp(value);\n\treturn VectorOps.exp[value.kind](value);\n}\nconst exp = dualImpl({\n\tname: \"exp\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuExp,\n\tcodegenImpl: (_ctx, [value]) => stitch`exp(${value})`\n});\nfunction cpuExp2(value) {\n\tif (typeof value === \"number\") return 2 ** value;\n\treturn VectorOps.exp2[value.kind](value);\n}\nconst exp2 = dualImpl({\n\tname: \"exp2\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuExp2,\n\tcodegenImpl: (_ctx, [value]) => stitch`exp2(${value})`\n});\nconst extractBits = dualImpl({\n\tname: \"extractBits\",\n\tsignature: (arg, _offset, _count) => {\n\t\tconst argRestricted = unify([arg], anyConcreteInteger)?.[0];\n\t\tif (!argRestricted) throw new SignatureNotSupportedError([arg], anyConcreteInteger);\n\t\treturn {\n\t\t\targTypes: [\n\t\t\t\targRestricted,\n\t\t\t\tu32,\n\t\t\t\tu32\n\t\t\t],\n\t\t\treturnType: argRestricted\n\t\t};\n\t},\n\tnormalImpl: \"CPU implementation for extractBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e, offset, count]) => stitch`extractBits(${e}, ${offset}, ${count})`\n});\nconst faceForward = dualImpl({\n\tname: \"faceForward\",\n\tsignature: unifyRestrictedSignature(anyFloatVec),\n\tnormalImpl: \"CPU implementation for faceForward not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e1, e2, e3]) => stitch`faceForward(${e1}, ${e2}, ${e3})`\n});\nconst firstLeadingBit = dualImpl({\n\tname: \"firstLeadingBit\",\n\tsignature: unaryIdentitySignature,\n\tnormalImpl: \"CPU implementation for firstLeadingBit not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`firstLeadingBit(${value})`\n});\nconst firstTrailingBit = dualImpl({\n\tname: \"firstTrailingBit\",\n\tsignature: unifyRestrictedSignature(anyConcreteInteger),\n\tnormalImpl: \"CPU implementation for firstTrailingBit not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`firstTrailingBit(${value})`\n});\nfunction cpuFloor(value) {\n\tif (typeof value === \"number\") return Math.floor(value);\n\treturn VectorOps.floor[value.kind](value);\n}\nconst floor = dualImpl({\n\tname: \"floor\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuFloor,\n\tcodegenImpl: (_ctx, [arg]) => stitch`floor(${arg})`\n});\nfunction cpuFma(e1, e2, e3) {\n\tif (typeof e1 === \"number\") return e1 * e2 + e3;\n\tthrow new MissingCpuImplError(\"CPU implementation for fma on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst fma = dualImpl({\n\tname: \"fma\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuFma,\n\tcodegenImpl: (_ctx, [e1, e2, e3]) => stitch`fma(${e1}, ${e2}, ${e3})`\n});\nfunction cpuFract(value) {\n\tif (typeof value === \"number\") return value - Math.floor(value);\n\treturn VectorOps.fract[value.kind](value);\n}\nconst fract = dualImpl({\n\tname: \"fract\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuFract,\n\tcodegenImpl: (_ctx, [a]) => stitch`fract(${a})`\n});\nconst FrexpResults = {\n\tf32: abstruct({\n\t\tfract: f32,\n\t\texp: i32\n\t}),\n\tf16: abstruct({\n\t\tfract: f16,\n\t\texp: i32\n\t}),\n\tabstractFloat: abstruct({\n\t\tfract: abstractFloat,\n\t\texp: abstractInt\n\t}),\n\tvec2f: abstruct({\n\t\tfract: vec2f,\n\t\texp: vec2i\n\t}),\n\tvec3f: abstruct({\n\t\tfract: vec3f,\n\t\texp: vec3i\n\t}),\n\tvec4f: abstruct({\n\t\tfract: vec4f,\n\t\texp: vec4i\n\t}),\n\tvec2h: abstruct({\n\t\tfract: vec2h,\n\t\texp: vec2i\n\t}),\n\tvec3h: abstruct({\n\t\tfract: vec3h,\n\t\texp: vec3i\n\t}),\n\tvec4h: abstruct({\n\t\tfract: vec4h,\n\t\texp: vec4i\n\t})\n};\nconst frexp = dualImpl({\n\tname: \"frexp\",\n\tnormalImpl: \"CPU implementation for frexp not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tsignature: (value) => {\n\t\tconst returnType = FrexpResults[value.type];\n\t\tif (!returnType) throw new SignatureNotSupportedError([value], anyFloat);\n\t\treturn {\n\t\t\targTypes: [value],\n\t\t\treturnType\n\t\t};\n\t},\n\tcodegenImpl: (_ctx, [value]) => stitch`frexp(${value})`\n});\nconst insertBits = dualImpl({\n\tname: \"insertBits\",\n\tsignature: (e, newbits, _offset, _count) => {\n\t\tconst uargs = unify([e, newbits], anyConcreteInteger);\n\t\tif (!uargs) throw new SignatureNotSupportedError([e, newbits], anyConcreteInteger);\n\t\treturn {\n\t\t\targTypes: [\n\t\t\t\t...uargs,\n\t\t\t\tu32,\n\t\t\t\tu32\n\t\t\t],\n\t\t\treturnType: uargs[0]\n\t\t};\n\t},\n\tnormalImpl: \"CPU implementation for insertBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e, newbits, offset, count]) => stitch`insertBits(${e}, ${newbits}, ${offset}, ${count})`\n});\nfunction cpuInverseSqrt(value) {\n\tif (typeof value === \"number\") return 1 / Math.sqrt(value);\n\tthrow new MissingCpuImplError(\"CPU implementation for inverseSqrt on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst inverseSqrt = dualImpl({\n\tname: \"inverseSqrt\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuInverseSqrt,\n\tcodegenImpl: (_ctx, [value]) => stitch`inverseSqrt(${value})`\n});\nconst ldexp = dualImpl({\n\tname: \"ldexp\",\n\tsignature: (e1, _e2) => {\n\t\tswitch (e1.type) {\n\t\t\tcase \"abstractFloat\": return {\n\t\t\t\targTypes: [e1, abstractInt],\n\t\t\t\treturnType: e1\n\t\t\t};\n\t\t\tcase \"f32\":\n\t\t\tcase \"f16\": return {\n\t\t\t\targTypes: [e1, i32],\n\t\t\t\treturnType: e1\n\t\t\t};\n\t\t\tcase \"vec2f\":\n\t\t\tcase \"vec2h\": return {\n\t\t\t\targTypes: [e1, vec2i],\n\t\t\t\treturnType: e1\n\t\t\t};\n\t\t\tcase \"vec3f\":\n\t\t\tcase \"vec3h\": return {\n\t\t\t\targTypes: [e1, vec3i],\n\t\t\t\treturnType: e1\n\t\t\t};\n\t\t\tcase \"vec4f\":\n\t\t\tcase \"vec4h\": return {\n\t\t\t\targTypes: [e1, vec4i],\n\t\t\t\treturnType: e1\n\t\t\t};\n\t\t\tdefault: throw new Error(`Unsupported data type for ldexp: ${e1.type}. Supported types are abstractFloat, f32, f16, vec2f, vec2h, vec3f, vec3h, vec4f, vec4h.`);\n\t\t}\n\t},\n\tnormalImpl: \"CPU implementation for ldexp not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e1, e2]) => stitch`ldexp(${e1}, ${e2})`\n});\nfunction cpuLength(value) {\n\tif (typeof value === \"number\") return Math.abs(value);\n\treturn VectorOps.length[value.kind](value);\n}\nconst length = dualImpl({\n\tname: \"length\",\n\tsignature: (arg) => {\n\t\tconst uarg = unify([arg], anyFloat);\n\t\tif (!uarg) throw new SignatureNotSupportedError([arg], anyFloat);\n\t\treturn {\n\t\t\targTypes: uarg,\n\t\t\treturnType: isHalfPrecisionSchema(uarg[0]) ? f16 : f32\n\t\t};\n\t},\n\tnormalImpl: cpuLength,\n\tcodegenImpl: (_ctx, [arg]) => stitch`length(${arg})`\n});\nfunction cpuLog(value) {\n\tif (typeof value === \"number\") return Math.log(value);\n\treturn VectorOps.log[value.kind](value);\n}\nconst log = dualImpl({\n\tname: \"log\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuLog,\n\tcodegenImpl: (_ctx, [value]) => stitch`log(${value})`\n});\nfunction cpuLog2(value) {\n\tif (typeof value === \"number\") return Math.log2(value);\n\treturn VectorOps.log2[value.kind](value);\n}\nconst log2 = dualImpl({\n\tname: \"log2\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuLog2,\n\tcodegenImpl: (_ctx, [value]) => stitch`log2(${value})`\n});\nfunction cpuMax(a, b) {\n\tif (typeof a === \"number\") return Math.max(a, b);\n\treturn VectorOps.max[a.kind](a, b);\n}\nconst max = dualImpl({\n\tname: \"max\",\n\tsignature: variadicUnifySignature,\n\tnormalImpl: variadicReduce(cpuMax),\n\tcodegenImpl: variadicStitch(\"max\")\n});\nfunction cpuMin(a, b) {\n\tif (typeof a === \"number\") return Math.min(a, b);\n\treturn VectorOps.min[a.kind](a, b);\n}\nconst min = dualImpl({\n\tname: \"min\",\n\tsignature: variadicUnifySignature,\n\tnormalImpl: variadicReduce(cpuMin),\n\tcodegenImpl: variadicStitch(\"min\")\n});\nfunction cpuMix(e1, e2, e3) {\n\tif (typeof e1 === \"number\") {\n\t\tif (typeof e3 !== \"number\" || typeof e2 !== \"number\") throw new Error(\"When e1 and e2 are numbers, the blend factor must be a number.\");\n\t\treturn e1 * (1 - e3) + e2 * e3;\n\t}\n\tif (typeof e1 === \"number\" || typeof e2 === \"number\") throw new Error(\"e1 and e2 need to both be vectors of the same kind.\");\n\treturn VectorOps.mix[e1.kind](e1, e2, e3);\n}\nconst mix = dualImpl({\n\tname: \"mix\",\n\tsignature: (e1, e2, e3) => {\n\t\tif (e1.type.startsWith(\"vec\") && !e3.type.startsWith(\"vec\")) {\n\t\t\tconst uarg = unify([e3], [e1.primitive]);\n\t\t\tif (!uarg) throw new SignatureNotSupportedError([e3], [e1.primitive]);\n\t\t\treturn {\n\t\t\t\targTypes: [\n\t\t\t\t\te1,\n\t\t\t\t\te2,\n\t\t\t\t\tuarg[0]\n\t\t\t\t],\n\t\t\t\treturnType: e1\n\t\t\t};\n\t\t}\n\t\tconst uargs = unify([\n\t\t\te1,\n\t\t\te2,\n\t\t\te3\n\t\t], anyFloat);\n\t\tif (!uargs) throw new SignatureNotSupportedError([\n\t\t\te1,\n\t\t\te2,\n\t\t\te3\n\t\t], anyFloat);\n\t\treturn {\n\t\t\targTypes: uargs,\n\t\t\treturnType: uargs[0]\n\t\t};\n\t},\n\tnormalImpl: cpuMix,\n\tcodegenImpl: (_ctx, [e1, e2, e3]) => stitch`mix(${e1}, ${e2}, ${e3})`\n});\nconst ModfResult = {\n\tf32: abstruct({\n\t\tfract: f32,\n\t\twhole: f32\n\t}),\n\tf16: abstruct({\n\t\tfract: f16,\n\t\twhole: f16\n\t}),\n\tabstractFloat: abstruct({\n\t\tfract: abstractFloat,\n\t\twhole: abstractFloat\n\t}),\n\tvec2f: abstruct({\n\t\tfract: vec2f,\n\t\twhole: vec2f\n\t}),\n\tvec3f: abstruct({\n\t\tfract: vec3f,\n\t\twhole: vec3f\n\t}),\n\tvec4f: abstruct({\n\t\tfract: vec4f,\n\t\twhole: vec4f\n\t}),\n\tvec2h: abstruct({\n\t\tfract: vec2h,\n\t\twhole: vec2h\n\t}),\n\tvec3h: abstruct({\n\t\tfract: vec3h,\n\t\twhole: vec3h\n\t}),\n\tvec4h: abstruct({\n\t\tfract: vec4h,\n\t\twhole: vec4h\n\t})\n};\nconst modf = dualImpl({\n\tname: \"modf\",\n\tsignature: (e) => {\n\t\tconst returnType = ModfResult[e.type];\n\t\tif (!returnType) throw new Error(`Unsupported data type for modf: ${e.type}. Supported types are f32, f16, abstractFloat, vec2f, vec3f, vec4f, vec2h, vec3h, vec4h.`);\n\t\treturn {\n\t\t\targTypes: [e],\n\t\t\treturnType\n\t\t};\n\t},\n\tnormalImpl: \"CPU implementation for modf not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`modf(${value})`\n});\nconst normalize = dualImpl({\n\tname: \"normalize\",\n\tsignature: unifyRestrictedSignature(anyFloatVec),\n\tnormalImpl: (v) => VectorOps.normalize[v.kind](v),\n\tcodegenImpl: (_ctx, [value]) => stitch`normalize(${value})`\n});\nfunction powCpu(base, exponent) {\n\tif (typeof base === \"number\" && typeof exponent === \"number\") return base ** exponent;\n\tif (isVecInstance(base) && isVecInstance(exponent)) return VectorOps.pow[base.kind](base, exponent);\n\tthrow new Error(`Invalid arguments to pow(): '${base}' '${exponent}'`);\n}\nconst pow = dualImpl({\n\tname: \"pow\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: powCpu,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`pow(${lhs}, ${rhs})`\n});\nconst quantizeToF16 = dualImpl({\n\tname: \"quantizeToF16\",\n\tsignature: (arg) => {\n\t\tconst candidates = [\n\t\t\tvec2f,\n\t\t\tvec3f,\n\t\t\tvec4f,\n\t\t\tf32\n\t\t];\n\t\tconst uarg = unify([arg], candidates)?.[0];\n\t\tif (!uarg) throw new SignatureNotSupportedError([arg], candidates);\n\t\treturn {\n\t\t\targTypes: [uarg],\n\t\t\treturnType: uarg\n\t\t};\n\t},\n\tnormalImpl: \"CPU implementation for quantizeToF16 not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`quantizeToF16(${value})`\n});\nfunction cpuRadians(value) {\n\tif (typeof value === \"number\") return value * Math.PI / 180;\n\tthrow new MissingCpuImplError(\"CPU implementation for radians on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst radians = dualImpl({\n\tname: \"radians\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuRadians,\n\tcodegenImpl: (_ctx, [value]) => stitch`radians(${value})`\n});\nconst reflect = dualImpl({\n\tname: \"reflect\",\n\tsignature: (...args) => {\n\t\tconst uargs = unify(args, anyFloatVec);\n\t\tif (!uargs) throw new SignatureNotSupportedError(args, anyFloatVec);\n\t\treturn {\n\t\t\targTypes: uargs,\n\t\t\treturnType: uargs[0]\n\t\t};\n\t},\n\tnormalImpl: (e1, e2) => sub(e1, mul(2 * dot(e2, e1), e2)),\n\tcodegenImpl: (_ctx, [e1, e2]) => stitch`reflect(${e1}, ${e2})`\n});\nconst refract = dualImpl({\n\tname: \"refract\",\n\tnormalImpl: \"CPU implementation for refract not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e1, e2, e3]) => stitch`refract(${e1}, ${e2}, ${e3})`,\n\tsignature: (e1, e2, _e3) => ({\n\t\targTypes: [\n\t\t\te1,\n\t\t\te2,\n\t\t\tisHalfPrecisionSchema(e1) ? f16 : f32\n\t\t],\n\t\treturnType: e1\n\t})\n});\nconst reverseBits = dualImpl({\n\tname: \"reverseBits\",\n\tsignature: unifyRestrictedSignature(anyConcreteInteger),\n\tnormalImpl: \"CPU implementation for reverseBits not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`reverseBits(${value})`\n});\nfunction cpuRound(value) {\n\tif (typeof value === \"number\") {\n\t\tconst floor = Math.floor(value);\n\t\tif (value === floor + .5) {\n\t\t\tif (floor % 2 === 0) return floor;\n\t\t\treturn floor + 1;\n\t\t}\n\t\treturn Math.round(value);\n\t}\n\tthrow new MissingCpuImplError(\"CPU implementation for round on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst round = dualImpl({\n\tname: \"round\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuRound,\n\tcodegenImpl: (_ctx, [value]) => stitch`round(${value})`\n});\nfunction cpuSaturate(value) {\n\tif (typeof value === \"number\") return Math.max(0, Math.min(1, value));\n\tthrow new MissingCpuImplError(\"CPU implementation for saturate on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst saturate = dualImpl({\n\tname: \"saturate\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuSaturate,\n\tcodegenImpl: (_ctx, [value]) => stitch`saturate(${value})`\n});\nfunction cpuSign(e) {\n\tif (typeof e === \"number\") return Math.sign(e);\n\treturn VectorOps.sign[e.kind](e);\n}\nconst sign = dualImpl({\n\tname: \"sign\",\n\tsignature: (arg) => {\n\t\tconst candidates = [\n\t\t\t...anyFloat,\n\t\t\ti32,\n\t\t\tvec2i,\n\t\t\tvec3i,\n\t\t\tvec4i\n\t\t];\n\t\tconst uarg = unify([arg], candidates)?.[0];\n\t\tif (!uarg) throw new SignatureNotSupportedError([arg], candidates);\n\t\treturn {\n\t\t\targTypes: [uarg],\n\t\t\treturnType: uarg\n\t\t};\n\t},\n\tnormalImpl: cpuSign,\n\tcodegenImpl: (_ctx, [e]) => stitch`sign(${e})`\n});\nfunction cpuSin(value) {\n\tif (typeof value === \"number\") return Math.sin(value);\n\treturn VectorOps.sin[value.kind](value);\n}\nconst sin = dualImpl({\n\tname: \"sin\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuSin,\n\tcodegenImpl: (_ctx, [value]) => stitch`sin(${value})`\n});\nfunction cpuSinh(value) {\n\tif (typeof value === \"number\") return Math.sinh(value);\n\tthrow new MissingCpuImplError(\"CPU implementation for sinh on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst sinh = dualImpl({\n\tname: \"sinh\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuSinh,\n\tcodegenImpl: (_ctx, [value]) => stitch`sinh(${value})`\n});\nfunction cpuSmoothstep(edge0, edge1, x) {\n\tif (typeof x === \"number\") return smoothstepScalar(edge0, edge1, x);\n\treturn VectorOps.smoothstep[x.kind](edge0, edge1, x);\n}\nconst smoothstep = dualImpl({\n\tname: \"smoothstep\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuSmoothstep,\n\tcodegenImpl: (_ctx, [edge0, edge1, x]) => stitch`smoothstep(${edge0}, ${edge1}, ${x})`\n});\nfunction cpuSqrt(value) {\n\tif (typeof value === \"number\") return Math.sqrt(value);\n\treturn VectorOps.sqrt[value.kind](value);\n}\nconst sqrt = dualImpl({\n\tname: \"sqrt\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuSqrt,\n\tcodegenImpl: (_ctx, [value]) => stitch`sqrt(${value})`\n});\nfunction cpuStep(edge, x) {\n\tif (typeof edge === \"number\") return edge <= x ? 1 : 0;\n\tthrow new MissingCpuImplError(\"CPU implementation for step on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst step = dualImpl({\n\tname: \"step\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuStep,\n\tcodegenImpl: (_ctx, [edge, x]) => stitch`step(${edge}, ${x})`\n});\nfunction cpuTan(value) {\n\tif (typeof value === \"number\") return Math.tan(value);\n\tthrow new MissingCpuImplError(\"CPU implementation for tan on vectors not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\");\n}\nconst tan = dualImpl({\n\tname: \"tan\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuTan,\n\tcodegenImpl: (_ctx, [value]) => stitch`tan(${value})`\n});\nfunction cpuTanh(value) {\n\tif (typeof value === \"number\") return Math.tanh(value);\n\treturn VectorOps.tanh[value.kind](value);\n}\nconst tanh = dualImpl({\n\tname: \"tanh\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: cpuTanh,\n\tcodegenImpl: (_ctx, [value]) => stitch`tanh(${value})`\n});\nconst transpose = dualImpl({\n\tname: \"transpose\",\n\tsignature: unaryIdentitySignature,\n\tnormalImpl: \"CPU implementation for transpose not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [e]) => stitch`transpose(${e})`\n});\nconst trunc = dualImpl({\n\tname: \"trunc\",\n\tsignature: unifyRestrictedSignature(anyFloat),\n\tnormalImpl: \"CPU implementation for trunc not implemented yet. Please submit an issue at https://github.com/software-mansion/TypeGPU/issues\",\n\tcodegenImpl: (_ctx, [value]) => stitch`trunc(${value})`\n});\n\n//#endregion\nexport { abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, clamp, cos, cosh, countLeadingZeros, countOneBits, countTrailingZeros, cross, degrees, determinant, distance, dot, dot4I8Packed, dot4U8Packed, exp, exp2, extractBits, faceForward, firstLeadingBit, firstTrailingBit, floor, fma, fract, frexp, insertBits, inverseSqrt, ldexp, length, log, log2, max, min, mix, modf, normalize, pow, quantizeToF16, radians, reflect, refract, reverseBits, round, saturate, sign, sin, sinh, smoothstep, sqrt, step, tan, tanh, transpose, trunc };","import { f32 } from \"../data/numeric.js\";\nimport { abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, countLeadingZeros, exp, floor, log, log2, max, min, pow, sign, sin, sinh, sqrt, tan, tanh, trunc } from \"../std/numeric.js\";\n\n//#region src/tgsl/math.ts\nconst mathToStd = {\n\tabs,\n\tacos,\n\tacosh,\n\tasin,\n\tasinh,\n\tatan,\n\tatan2,\n\tatanh,\n\tceil,\n\tcos,\n\tcosh,\n\texp,\n\tfloor,\n\tfround: f32,\n\tclz32: countLeadingZeros,\n\ttrunc,\n\tlog,\n\tlog2,\n\tpow,\n\tsign,\n\tsin,\n\tsinh,\n\tsqrt,\n\ttan,\n\ttanh,\n\tmax,\n\tmin,\n\tcbrt: void 0,\n\tlog10: void 0,\n\tlog1p: void 0,\n\tf16round: void 0,\n\thypot: void 0,\n\texpm1: void 0,\n\trandom: void 0,\n\timul: void 0,\n\tround: void 0\n};\n\n//#endregion\nexport { mathToStd };","import { isPtr, isWgslArray } from \"../data/wgslTypes.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { ptrFn } from \"../data/ptr.js\";\nimport { isRef } from \"../data/ref.js\";\nimport { abstractInt, u32 } from \"../data/numeric.js\";\nimport { dualImpl } from \"../core/function/dualImpl.js\";\n\n//#region src/std/array.ts\nconst sizeOfPointedToArray = (dataType) => isPtr(dataType) && isWgslArray(dataType.inner) ? dataType.inner.elementCount : 0;\nconst arrayLength = dualImpl({\n\tname: \"arrayLength\",\n\tsignature: (arg) => {\n\t\tconst ptrArg = isPtr(arg) ? arg : ptrFn(arg);\n\t\treturn {\n\t\t\targTypes: [ptrArg],\n\t\t\treturnType: sizeOfPointedToArray(ptrArg) > 0 ? abstractInt : u32\n\t\t};\n\t},\n\tnormalImpl: (a) => isRef(a) ? a.$.length : a.length,\n\tcodegenImpl(_ctx, [a]) {\n\t\tconst length = sizeOfPointedToArray(a.dataType);\n\t\treturn length > 0 ? `${length}` : stitch`arrayLength(${a})`;\n\t}\n});\n\n//#endregion\nexport { arrayLength };","import { $gpuCallable } from \"../shared/symbols.js\";\nimport { isPtr, isVec, isWgslArray } from \"../data/wgslTypes.js\";\nimport { UnknownData } from \"../data/dataTypes.js\";\nimport { isEphemeralSnippet, snip } from \"../data/snippet.js\";\nimport { WgslTypeError, invariant } from \"../errors.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { createPtrFromOrigin, implicitFrom } from \"../data/ptr.js\";\nimport { u32 } from \"../data/numeric.js\";\nimport { ArrayExpression, concretize } from \"./generationHelpers.js\";\nimport { accessIndex } from \"./accessIndex.js\";\nimport { arrayLength } from \"../std/array.js\";\n\n//#region src/tgsl/forOfUtils.ts\nfunction getLoopVarKind(elementSnippet) {\n\treturn elementSnippet.origin === \"constant-tgpu-const-ref\" ? \"const\" : \"let\";\n}\nfunction getElementSnippet(iterableSnippet, index) {\n\tconst elementSnippet = accessIndex(iterableSnippet, index);\n\tif (!elementSnippet) throw new WgslTypeError(\"`for ... of ...` loops only support array or vector iterables\");\n\treturn elementSnippet;\n}\nfunction getElementType(elementSnippet, iterableSnippet) {\n\tlet elementType = elementSnippet.dataType;\n\tif (elementType === UnknownData) throw new WgslTypeError(stitch`The elements in iterable ${iterableSnippet} are of unknown type`);\n\tif (isEphemeralSnippet(elementSnippet) || elementSnippet.origin === \"constant-tgpu-const-ref\" || elementSnippet.origin === \"runtime-tgpu-const-ref\") return elementType;\n\tif (!isPtr(elementType)) {\n\t\tconst ptrType = createPtrFromOrigin(elementSnippet.origin, concretize(elementType));\n\t\tinvariant(ptrType !== void 0, `Creating pointer type from origin ${elementSnippet.origin}`);\n\t\telementType = ptrType;\n\t}\n\treturn implicitFrom(elementType);\n}\nfunction getElementCountSnippet(ctx, iterableSnippet, unroll = false) {\n\tconst { value, dataType } = iterableSnippet;\n\tif (isWgslArray(dataType)) return dataType.elementCount > 0 ? snip(dataType.elementCount, u32, \"constant\") : arrayLength[$gpuCallable].call(ctx, [iterableSnippet]);\n\tif (isVec(dataType)) return snip(dataType.componentCount, u32, \"constant\");\n\tif (unroll) {\n\t\tif (Array.isArray(value)) return snip(value.length, u32, \"constant\");\n\t\tif (value instanceof ArrayExpression) return snip(value.elements.length, u32, \"constant\");\n\t}\n\tthrow new WgslTypeError(\"`for ... of ...` loops only support array or vector iterables\");\n}\n\n//#endregion\nexport { getElementCountSnippet, getElementSnippet, getElementType, getLoopVarKind };","//#region src/nodes.ts\nconst NodeTypeCatalog = {\n\tblock: 0,\n\tbinaryExpr: 1,\n\tassignmentExpr: 2,\n\tlogicalExpr: 3,\n\tunaryExpr: 4,\n\tnumericLiteral: 5,\n\tcall: 6,\n\tmemberAccess: 7,\n\tindexAccess: 8,\n\treturn: 10,\n\tif: 11,\n\tlet: 12,\n\tconst: 13,\n\tfor: 14,\n\twhile: 15,\n\tcontinue: 16,\n\tbreak: 17,\n\tforOf: 18,\n\tarrayExpr: 100,\n\tpreUpdate: 101,\n\tpostUpdate: 102,\n\tstringLiteral: 103,\n\tobjectExpr: 104,\n\tconditionalExpr: 105\n};\nconst FuncParameterType = {\n\tidentifier: \"i\",\n\tdestructuredObject: \"d\"\n};\n\n//#endregion\nexport { FuncParameterType, NodeTypeCatalog };","import { FuncParameterType, NodeTypeCatalog } from \"./nodes.js\";\n\n//#region src/index.ts\n/**\n* Each breaking change to the format requires a bump to this number.\n* It's used at runtime by `typegpu` to determine how to interpret\n* a function's AST. It gets embedded by `unplugin-typegpu` into\n* the source code at build time.\n*/\nconst FORMAT_VERSION = 1;\n\n//#endregion\nexport { FORMAT_VERSION, FuncParameterType, NodeTypeCatalog };","import { $gpuCallable, $internal, $providing, isMarkedInternal } from \"../shared/symbols.js\";\nimport { getName } from \"../shared/meta.js\";\nimport { Void, isNaturallyEphemeral, isPtr, isWgslArray, isWgslStruct } from \"../data/wgslTypes.js\";\nimport { ConsoleLog, InfixDispatch, UnknownData, isLooseData, unptr } from \"../data/dataTypes.js\";\nimport { isEphemeralOrigin, isEphemeralSnippet, snip } from \"../data/snippet.js\";\nimport { ResolutionError, WgslTypeError, invariant } from \"../errors.js\";\nimport { isGPUCallable, isKnownAtComptime } from \"../types.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { createPtrFromOrigin, implicitFrom, ptrFn } from \"../data/ptr.js\";\nimport { RefOperator } from \"../data/ref.js\";\nimport { safeStringify } from \"../shared/stringify.js\";\nimport { convertStructValues, convertToCommonType, tryConvertSnippet } from \"./conversion.js\";\nimport { bool, i32, u32 } from \"../data/numeric.js\";\nimport { AutoStruct } from \"../data/autoStruct.js\";\nimport { ArrayExpression, coerceToSnippet, concretize, numericLiteralToSnippet } from \"./generationHelpers.js\";\nimport { add, div, mul, neg, sub } from \"../std/operators.js\";\nimport { accessProp } from \"./accessProp.js\";\nimport { accessIndex } from \"./accessIndex.js\";\nimport { constant } from \"../core/constant/tgpuConstant.js\";\nimport { isGenericFn } from \"../core/function/tgpuFn.js\";\nimport { arrayOf } from \"../data/array.js\";\nimport { pow } from \"../std/numeric.js\";\nimport { UnrollableIterable } from \"../core/unroll/tgpuUnroll.js\";\nimport { mathToStd } from \"./math.js\";\nimport { getElementCountSnippet, getElementSnippet, getElementType, getLoopVarKind } from \"./forOfUtils.js\";\nimport * as tinyest from \"tinyest\";\n\n//#region src/tgsl/wgslGenerator.ts\nconst { NodeTypeCatalog: NODE } = tinyest;\nconst parenthesizedOps = [\n\t\"==\",\n\t\"!=\",\n\t\"===\",\n\t\"!==\",\n\t\"<\",\n\t\"<=\",\n\t\">\",\n\t\">=\",\n\t\"<<\",\n\t\">>\",\n\t\"+\",\n\t\"-\",\n\t\"*\",\n\t\"/\",\n\t\"%\",\n\t\"|\",\n\t\"^\",\n\t\"&\",\n\t\"&&\",\n\t\"||\"\n];\nconst binaryLogicalOps = [\n\t\"&&\",\n\t\"||\",\n\t\"==\",\n\t\"!=\",\n\t\"===\",\n\t\"!==\",\n\t\"<\",\n\t\"<=\",\n\t\">\",\n\t\">=\"\n];\nconst OP_MAP = {\n\t\"===\": \"==\",\n\t\"!==\": \"!=\",\n\tget \">>>\"() {\n\t\tthrow new Error(\"The `>>>` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget in() {\n\t\tthrow new Error(\"The `in` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget instanceof() {\n\t\tthrow new Error(\"The `instanceof` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \"|>\"() {\n\t\tthrow new Error(\"The `|>` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \"??\"() {\n\t\tthrow new Error(\"The `??` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \">>>=\"() {\n\t\tthrow new Error(\"The `>>>=` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \"**=\"() {\n\t\tthrow new Error(\"The `**=` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \"??=\"() {\n\t\tthrow new Error(\"The `??=` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \"&&=\"() {\n\t\tthrow new Error(\"The `&&=` operator is unsupported in TypeGPU functions.\");\n\t},\n\tget \"||=\"() {\n\t\tthrow new Error(\"The `||=` operator is unsupported in TypeGPU functions.\");\n\t}\n};\nfunction operatorToType(lhs, op, rhs) {\n\tif (!rhs) {\n\t\tif (op === \"!\") return bool;\n\t\treturn lhs;\n\t}\n\tif (binaryLogicalOps.includes(op)) return bool;\n\tif (op === \"=\") return rhs;\n\treturn lhs;\n}\nconst unaryOpCodeToCodegen = {\n\t\"-\": neg[$gpuCallable].call.bind(neg),\n\tvoid: () => snip(void 0, Void, \"constant\")\n};\nconst binaryOpCodeToCodegen = {\n\t\"+\": add[$gpuCallable].call.bind(add),\n\t\"-\": sub[$gpuCallable].call.bind(sub),\n\t\"*\": mul[$gpuCallable].call.bind(mul),\n\t\"/\": div[$gpuCallable].call.bind(div),\n\t\"**\": pow[$gpuCallable].call.bind(pow)\n};\nvar WgslGenerator = class {\n\t#ctx = void 0;\n\t#unrolling = false;\n\tinitGenerator(ctx) {\n\t\tthis.#ctx = ctx;\n\t}\n\tget ctx() {\n\t\tif (!this.#ctx) throw new Error(\"WGSL Generator has not yet been initialized. Please call initialize(ctx) before using the generator.\");\n\t\treturn this.#ctx;\n\t}\n\tblock([_, statements], externalMap) {\n\t\tthis.ctx.pushBlockScope();\n\t\tif (externalMap) {\n\t\t\tconst externals = Object.fromEntries(Object.entries(externalMap).map(([id, value]) => [id, coerceToSnippet(value)]));\n\t\t\tthis.ctx.setBlockExternals(externals);\n\t\t}\n\t\ttry {\n\t\t\tthis.ctx.indent();\n\t\t\tconst body = statements.map((statement) => this.statement(statement)).filter((statement) => statement.length > 0).join(\"\\n\");\n\t\t\tthis.ctx.dedent();\n\t\t\treturn `{\n${body}\n${this.ctx.pre}}`;\n\t\t} finally {\n\t\t\tthis.ctx.popBlockScope();\n\t\t}\n\t}\n\trefVariable(id, dataType) {\n\t\tconst varName = this.ctx.makeNameValid(id);\n\t\tconst ptrType = ptrFn(dataType);\n\t\tconst snippet = snip(new RefOperator(snip(varName, dataType, \"function\"), ptrType), ptrType, \"function\");\n\t\tthis.ctx.defineVariable(id, snippet);\n\t\treturn varName;\n\t}\n\tblockVariable(varType, id, dataType, origin) {\n\t\tconst naturallyEphemeral = isNaturallyEphemeral(dataType);\n\t\tlet varOrigin;\n\t\tif (origin === \"constant-tgpu-const-ref\" || origin === \"runtime-tgpu-const-ref\") varOrigin = origin;\n\t\telse if (origin === \"argument\") if (naturallyEphemeral) varOrigin = \"runtime\";\n\t\telse varOrigin = \"argument\";\n\t\telse if (!naturallyEphemeral) varOrigin = isEphemeralOrigin(origin) ? \"this-function\" : origin;\n\t\telse if (origin === \"constant\" && varType === \"const\") varOrigin = \"constant\";\n\t\telse varOrigin = \"runtime\";\n\t\tconst snippet = snip(this.ctx.makeNameValid(id), dataType, varOrigin);\n\t\tthis.ctx.defineVariable(id, snippet);\n\t\treturn snippet;\n\t}\n\tidentifier(id) {\n\t\tif (!id) throw new Error(\"Cannot resolve an empty identifier\");\n\t\tif (id === \"undefined\") return snip(void 0, Void, \"constant\");\n\t\tconst res = this.ctx.getById(id);\n\t\tif (!res) throw new Error(`Identifier ${id} not found`);\n\t\treturn res;\n\t}\n\t/**\n\t* A wrapper for `generateExpression` that updates `ctx.expectedType`\n\t* and tries to convert the result when it does not match the expected type.\n\t*/\n\ttypedExpression(expression, expectedType) {\n\t\tconst prevExpectedType = this.ctx.expectedType;\n\t\tthis.ctx.expectedType = expectedType;\n\t\ttry {\n\t\t\tconst result = this.expression(expression);\n\t\t\tif (expectedType instanceof AutoStruct) return result;\n\t\t\treturn tryConvertSnippet(this.ctx, result, expectedType);\n\t\t} finally {\n\t\t\tthis.ctx.expectedType = prevExpectedType;\n\t\t}\n\t}\n\texpression(expression) {\n\t\tif (typeof expression === \"string\") return this.identifier(expression);\n\t\tif (typeof expression === \"boolean\") return snip(expression, bool, \"constant\");\n\t\tif (expression[0] === NODE.logicalExpr || expression[0] === NODE.binaryExpr || expression[0] === NODE.assignmentExpr) {\n\t\t\tconst [exprType, lhs, op, rhs] = expression;\n\t\t\tconst lhsExpr = this.expression(lhs);\n\t\t\tconst rhsExpr = this.expression(rhs);\n\t\t\tif (rhsExpr.value instanceof RefOperator) throw new WgslTypeError(stitch`Cannot assign a ref to an existing variable '${lhsExpr}', define a new variable instead.`);\n\t\t\tif (op === \"==\") throw new Error(\"Please use the === operator instead of ==\");\n\t\t\tif (op === \"===\" && isKnownAtComptime(lhsExpr) && isKnownAtComptime(rhsExpr)) return snip(lhsExpr.value === rhsExpr.value, bool, \"constant\");\n\t\t\tif (lhsExpr.dataType === UnknownData) throw new WgslTypeError(`Left-hand side of '${op}' is of unknown type`);\n\t\t\tif (rhsExpr.dataType === UnknownData) throw new WgslTypeError(`Right-hand side of '${op}' is of unknown type`);\n\t\t\tconst codegen = binaryOpCodeToCodegen[op];\n\t\t\tif (codegen) return codegen(this.ctx, [lhsExpr, rhsExpr]);\n\t\t\tconst forcedType = exprType === NODE.assignmentExpr ? [lhsExpr.dataType] : void 0;\n\t\t\tconst [convLhs, convRhs] = convertToCommonType(this.ctx, [lhsExpr, rhsExpr], forcedType) ?? [lhsExpr, rhsExpr];\n\t\t\tconst lhsStr = this.ctx.resolve(convLhs.value, convLhs.dataType).value;\n\t\t\tconst rhsStr = this.ctx.resolve(convRhs.value, convRhs.dataType).value;\n\t\t\tconst type = operatorToType(convLhs.dataType, op, convRhs.dataType);\n\t\t\tif (exprType === NODE.assignmentExpr) {\n\t\t\t\tif (convLhs.origin === \"constant\" || convLhs.origin === \"constant-tgpu-const-ref\" || convLhs.origin === \"runtime-tgpu-const-ref\") throw new WgslTypeError(`'${lhsStr} = ${rhsStr}' is invalid, because ${lhsStr} is a constant. This error may also occur when assigning to a value defined outside of a TypeGPU function's scope.`);\n\t\t\t\tif (lhsExpr.origin === \"argument\") throw new WgslTypeError(`'${lhsStr} ${op} ${rhsStr}' is invalid, because non-pointer arguments cannot be mutated.`);\n\t\t\t\tif (op === \"=\" && rhsExpr.origin === \"argument\" && !isNaturallyEphemeral(rhsExpr.dataType)) throw new WgslTypeError(`'${lhsStr} = ${rhsStr}' is invalid, because argument references cannot be assigned.\\n-----\\nTry '${lhsStr} = ${this.ctx.resolve(rhsExpr.dataType).value}(${rhsStr})' to copy the value instead.\\n-----`);\n\t\t\t\tif (op === \"=\" && !isEphemeralSnippet(rhsExpr)) throw new WgslTypeError(`'${lhsStr} = ${rhsStr}' is invalid, because references cannot be assigned.\\n-----\\nTry '${lhsStr} = ${this.ctx.resolve(rhsExpr.dataType).value}(${rhsStr})' to copy the value instead.\\n-----`);\n\t\t\t}\n\t\t\treturn snip(parenthesizedOps.includes(op) ? `(${lhsStr} ${OP_MAP[op] ?? op} ${rhsStr})` : `${lhsStr} ${OP_MAP[op] ?? op} ${rhsStr}`, type, \"runtime\");\n\t\t}\n\t\tif (expression[0] === NODE.postUpdate) {\n\t\t\tconst [_, op, arg] = expression;\n\t\t\tconst argExpr = this.expression(arg);\n\t\t\tconst argStr = this.ctx.resolve(argExpr.value, argExpr.dataType).value;\n\t\t\treturn snip(`${argStr}${op}`, argExpr.dataType, \"runtime\");\n\t\t}\n\t\tif (expression[0] === NODE.unaryExpr) {\n\t\t\tconst [_, op, arg] = expression;\n\t\t\tconst argExpr = this.expression(arg);\n\t\t\tconst codegen = unaryOpCodeToCodegen[op];\n\t\t\tif (codegen) return codegen(this.ctx, [argExpr]);\n\t\t\tconst argStr = this.ctx.resolve(argExpr.value, argExpr.dataType).value;\n\t\t\tconst type = operatorToType(argExpr.dataType, op);\n\t\t\treturn snip(`${op}${argStr}`, type, \"runtime\");\n\t\t}\n\t\tif (expression[0] === NODE.memberAccess) {\n\t\t\tconst [_, targetNode, property] = expression;\n\t\t\tconst target = this.expression(targetNode);\n\t\t\tif (target.value === console) return snip(new ConsoleLog(property), UnknownData, \"runtime\");\n\t\t\tif (target.value === Math) {\n\t\t\t\tif (property in mathToStd && mathToStd[property]) return snip(mathToStd[property], UnknownData, \"runtime\");\n\t\t\t\tif (typeof Math[property] === \"function\") throw new Error(`Unsupported functionality 'Math.${property}'. Use an std alternative, or implement the function manually.`);\n\t\t\t}\n\t\t\tconst accessed = accessProp(target, property);\n\t\t\tif (!accessed) throw new Error(stitch`Property '${property}' not found on value '${target}' of type ${this.ctx.resolve(target.dataType)}`);\n\t\t\treturn accessed;\n\t\t}\n\t\tif (expression[0] === NODE.indexAccess) {\n\t\t\tconst [_, targetNode, propertyNode] = expression;\n\t\t\tconst target = this.expression(targetNode);\n\t\t\tconst inProperty = this.expression(propertyNode);\n\t\t\tconst property = convertToCommonType(this.ctx, [inProperty], [u32, i32], false)?.[0] ?? inProperty;\n\t\t\tconst accessed = accessIndex(target, property);\n\t\t\tif (!accessed) {\n\t\t\t\tconst targetStr = this.ctx.resolve(target.value, target.dataType).value;\n\t\t\t\tconst propertyStr = this.ctx.resolve(property.value, property.dataType).value;\n\t\t\t\tthrow new Error(`Unable to index value ${targetStr} of unknown type with index ${propertyStr}. If the value is an array, to address this, consider one of the following approaches: (1) declare the array using 'tgpu.const', (2) store the array in a buffer, or (3) define the array within the GPU function scope.`);\n\t\t\t}\n\t\t\treturn accessed;\n\t\t}\n\t\tif (expression[0] === NODE.numericLiteral) {\n\t\t\tconst type = typeof expression[1] === \"string\" ? numericLiteralToSnippet(parseNumericString(expression[1])) : numericLiteralToSnippet(expression[1]);\n\t\t\tif (!type) throw new Error(`Invalid numeric literal ${expression[1]}`);\n\t\t\treturn type;\n\t\t}\n\t\tif (expression[0] === NODE.call) {\n\t\t\tconst [_, calleeNode, argNodes] = expression;\n\t\t\tconst callee = this.expression(calleeNode);\n\t\t\tif (isWgslStruct(callee.value)) {\n\t\t\t\tif (argNodes.length > 1) throw new WgslTypeError(\"Struct schemas should always be called with at most 1 argument\");\n\t\t\t\tif (!argNodes[0]) return snip(`${this.ctx.resolve(callee.value).value}()`, callee.value, \"runtime\");\n\t\t\t\tconst arg = this.typedExpression(argNodes[0], callee.value);\n\t\t\t\treturn snip(this.ctx.resolve(arg.value, callee.value).value, callee.value, \"runtime\");\n\t\t\t}\n\t\t\tif (isWgslArray(callee.value)) {\n\t\t\t\tif (argNodes.length > 1) throw new WgslTypeError(\"Array schemas should always be called with at most 1 argument\");\n\t\t\t\tif (!argNodes[0]) return snip(`${this.ctx.resolve(callee.value).value}()`, callee.value, \"runtime\");\n\t\t\t\tconst arg = this.typedExpression(argNodes[0], callee.value);\n\t\t\t\tif (arg.value instanceof ArrayExpression) return snip(stitch`${this.ctx.resolve(callee.value).value}(${arg.value.elements})`, arg.dataType, \"runtime\");\n\t\t\t\treturn snip(this.ctx.resolve(arg.value, callee.value).value, callee.value, \"runtime\");\n\t\t\t}\n\t\t\tif (callee.value === constant) throw new Error(\"Constants cannot be defined within TypeGPU function scope. To address this, move the constant definition outside the function scope.\");\n\t\t\tif (callee.value instanceof InfixDispatch) {\n\t\t\t\tif (!argNodes[0]) throw new WgslTypeError(`An infix operator '${callee.value.name}' was called without any arguments`);\n\t\t\t\tconst rhs = this.expression(argNodes[0]);\n\t\t\t\treturn callee.value.operator(this.ctx, [callee.value.lhs, rhs]);\n\t\t\t}\n\t\t\tif (callee.value instanceof ConsoleLog) return this.ctx.generateLog(callee.value.op, argNodes.map((arg) => this.expression(arg)));\n\t\t\tif (isGPUCallable(callee.value)) {\n\t\t\t\tconst callable = callee.value[$gpuCallable];\n\t\t\t\tconst strictSignature = callable.strictSignature;\n\t\t\t\tlet convertedArguments;\n\t\t\t\tif (strictSignature) convertedArguments = argNodes.map((arg, i) => {\n\t\t\t\t\tconst argType = strictSignature.argTypes[i];\n\t\t\t\t\tif (!argType) throw new WgslTypeError(`Function '${getName(callee.value)}' was called with too many arguments`);\n\t\t\t\t\treturn this.typedExpression(arg, argType);\n\t\t\t\t});\n\t\t\t\telse convertedArguments = argNodes.map((arg) => this.expression(arg));\n\t\t\t\ttry {\n\t\t\t\t\treturn callable.call(this.ctx, convertedArguments);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ResolutionError) throw err;\n\t\t\t\t\tthrow new ResolutionError(err, [{ toString: () => `fn:${getName(callee.value)}` }]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst isGeneric = isGenericFn(callee.value);\n\t\t\tif (!isMarkedInternal(callee.value) || isGeneric) {\n\t\t\t\tconst slotPairs = isGeneric ? callee.value[$providing]?.pairs ?? [] : [];\n\t\t\t\tconst callback = isGeneric ? callee.value[$internal].inner : callee.value;\n\t\t\t\tconst shelllessCall = this.ctx.withRenamed(callback, getName(callee.value), () => this.ctx.withSlots(slotPairs, () => {\n\t\t\t\t\tconst args = argNodes.map((arg) => this.expression(arg));\n\t\t\t\t\tconst shellless = this.ctx.shelllessRepo.get(callback, args);\n\t\t\t\t\tif (!shellless) return;\n\t\t\t\t\tconst converted = args.map((s, idx) => {\n\t\t\t\t\t\tconst argType = shellless.argTypes[idx];\n\t\t\t\t\t\treturn tryConvertSnippet(this.ctx, s, argType, false);\n\t\t\t\t\t});\n\t\t\t\t\treturn this.ctx.withResetIndentLevel(() => {\n\t\t\t\t\t\tconst snippet = this.ctx.resolve(shellless);\n\t\t\t\t\t\treturn snip(stitch`${snippet.value}(${converted})`, snippet.dataType, \"runtime\");\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t\tif (shelllessCall) return shelllessCall;\n\t\t\t}\n\t\t\tthrow new Error(`Function '${getName(callee.value) ?? String(callee.value)}' is not marked with the 'use gpu' directive and cannot be used in a shader`);\n\t\t}\n\t\tif (expression[0] === NODE.objectExpr) {\n\t\t\tconst obj = expression[1];\n\t\t\tconst structType = this.ctx.expectedType;\n\t\t\tif (structType instanceof AutoStruct) {\n\t\t\t\tconst entries = Object.fromEntries(Object.entries(obj).map(([key, value]) => {\n\t\t\t\t\tlet accessed = structType.accessProp(key);\n\t\t\t\t\tlet expr;\n\t\t\t\t\tif (accessed) expr = this.typedExpression(value, accessed.type);\n\t\t\t\t\telse {\n\t\t\t\t\t\texpr = this.expression(value);\n\t\t\t\t\t\tif (expr.dataType === UnknownData) throw new WgslTypeError(stitch`Property ${key} in object literal has a value of unknown type: '${expr}'`);\n\t\t\t\t\t\taccessed = structType.provideProp(key, concretize(expr.dataType));\n\t\t\t\t\t}\n\t\t\t\t\treturn [accessed.prop, expr];\n\t\t\t\t}));\n\t\t\t\tconst completeStruct = structType.completeStruct;\n\t\t\t\tconst convertedSnippets = convertStructValues(this.ctx, completeStruct, entries);\n\t\t\t\treturn snip(stitch`${this.ctx.resolve(structType).value}(${convertedSnippets})`, completeStruct, \"runtime\");\n\t\t\t}\n\t\t\tif (isWgslStruct(structType)) {\n\t\t\t\tconst entries = Object.fromEntries(Object.entries(structType.propTypes).map(([key, value]) => {\n\t\t\t\t\tconst val = obj[key];\n\t\t\t\t\tif (val === void 0) throw new WgslTypeError(`Missing property ${key} in object literal for struct ${structType}`);\n\t\t\t\t\treturn [key, this.typedExpression(val, value)];\n\t\t\t\t}));\n\t\t\t\tconst convertedSnippets = convertStructValues(this.ctx, structType, entries);\n\t\t\t\treturn snip(stitch`${this.ctx.resolve(structType).value}(${convertedSnippets})`, structType, \"runtime\");\n\t\t\t}\n\t\t\tthrow new WgslTypeError(`No target type could be inferred for object with keys [${Object.keys(obj).join(\", \")}], please wrap the object in the corresponding schema.`);\n\t\t}\n\t\tif (expression[0] === NODE.arrayExpr) {\n\t\t\tconst [_, valueNodes] = expression;\n\t\t\tconst arrType = this.ctx.expectedType;\n\t\t\tlet elemType;\n\t\t\tlet values;\n\t\t\tif (isWgslArray(arrType)) {\n\t\t\t\telemType = arrType.elementType;\n\t\t\t\tvalues = valueNodes.map((value) => this.typedExpression(value, elemType));\n\t\t\t\tif (values.length !== arrType.elementCount) throw new WgslTypeError(`Cannot create value of type '${arrType}' from an array of length: ${values.length}`);\n\t\t\t} else {\n\t\t\t\tconst valuesSnippets = valueNodes.map((value) => this.expression(value));\n\t\t\t\tif (valuesSnippets.length === 0) throw new WgslTypeError(\"Cannot infer the type of an empty array literal.\");\n\t\t\t\tconst converted = convertToCommonType(this.ctx, valuesSnippets);\n\t\t\t\tif (!converted) throw new WgslTypeError(\"The given values cannot be automatically converted to a common type. Consider wrapping the array in an appropriate schema\");\n\t\t\t\tvalues = converted;\n\t\t\t\telemType = concretize(values[0]?.dataType);\n\t\t\t}\n\t\t\tconst arrayType = arrayOf(elemType, values.length);\n\t\t\treturn snip(new ArrayExpression(arrayType, values), arrayType, \"runtime\");\n\t\t}\n\t\tif (expression[0] === NODE.conditionalExpr) {\n\t\t\tconst [_, test, consequent, alternative] = expression;\n\t\t\tconst testExpression = this.expression(test);\n\t\t\tif (isKnownAtComptime(testExpression)) return testExpression.value ? this.expression(consequent) : this.expression(alternative);\n\t\t\telse throw new Error(`Ternary operator is only supported for comptime-known checks (used with '${testExpression.value}'). For runtime checks, please use 'std.select' or if/else statements.`);\n\t\t}\n\t\tif (expression[0] === NODE.stringLiteral) return snip(expression[1], UnknownData, \"constant\");\n\t\tif (expression[0] === NODE.preUpdate) throw new Error(\"Cannot use pre-updates in TypeGPU functions.\");\n\t\tassertExhaustive(expression);\n\t}\n\tfunctionDefinition(body) {\n\t\treturn this.block(body);\n\t}\n\tstatement(statement) {\n\t\tif (typeof statement === \"string\") {\n\t\t\tconst id = this.identifier(statement);\n\t\t\tconst resolved = id.value && this.ctx.resolve(id.value).value;\n\t\t\treturn resolved ? `${this.ctx.pre}${resolved};` : \"\";\n\t\t}\n\t\tif (typeof statement === \"boolean\") return `${this.ctx.pre}${statement ? \"true\" : \"false\"};`;\n\t\tif (statement[0] === NODE.return) {\n\t\t\tconst returnNode = statement[1];\n\t\t\tif (returnNode !== void 0) {\n\t\t\t\tconst expectedReturnType = this.ctx.topFunctionReturnType;\n\t\t\t\tlet returnSnippet = expectedReturnType ? this.typedExpression(returnNode, expectedReturnType) : this.expression(returnNode);\n\t\t\t\tif (returnSnippet.value instanceof RefOperator) throw new WgslTypeError(stitch`Cannot return references, returning '${returnSnippet.value.snippet}'`);\n\t\t\t\tif (returnSnippet.origin === \"argument\" && !isNaturallyEphemeral(returnSnippet.dataType) && this.ctx.topFunctionScope?.functionType === \"normal\") throw new WgslTypeError(stitch`Cannot return references to arguments, returning '${returnSnippet}'. Copy the argument before returning it.`);\n\t\t\t\tif (!expectedReturnType && !isEphemeralSnippet(returnSnippet) && returnSnippet.origin !== \"this-function\") {\n\t\t\t\t\tconst str = this.ctx.resolve(returnSnippet.value, returnSnippet.dataType).value;\n\t\t\t\t\tconst typeStr = this.ctx.resolve(unptr(returnSnippet.dataType)).value;\n\t\t\t\t\tthrow new WgslTypeError(`'return ${str};' is invalid, cannot return references.\n-----\nTry 'return ${typeStr}(${str});' instead.\n-----`);\n\t\t\t\t}\n\t\t\t\treturnSnippet = tryConvertSnippet(this.ctx, returnSnippet, unptr(returnSnippet.dataType), false);\n\t\t\t\tinvariant(returnSnippet.dataType !== UnknownData, \"Return type should be known\");\n\t\t\t\tthis.ctx.reportReturnType(returnSnippet.dataType);\n\t\t\t\treturn stitch`${this.ctx.pre}return ${returnSnippet};`;\n\t\t\t}\n\t\t\treturn `${this.ctx.pre}return;`;\n\t\t}\n\t\tif (statement[0] === NODE.if) {\n\t\t\tconst [_, condNode, consNode, altNode] = statement;\n\t\t\tconst condition = this.typedExpression(condNode, bool);\n\t\t\tconst consequent = condition.value === false ? void 0 : this.block(blockifySingleStatement(consNode));\n\t\t\tconst alternate = condition.value === true || !altNode ? void 0 : this.block(blockifySingleStatement(altNode));\n\t\t\tif (condition.value === true) return `${this.ctx.pre}${consequent}`;\n\t\t\tif (condition.value === false) return alternate ? `${this.ctx.pre}${alternate}` : \"\";\n\t\t\tif (!alternate) return stitch`${this.ctx.pre}if (${condition}) ${consequent}`;\n\t\t\treturn stitch`\\\n${this.ctx.pre}if (${condition}) ${consequent}\n${this.ctx.pre}else ${alternate}`;\n\t\t}\n\t\tif (statement[0] === NODE.let || statement[0] === NODE.const) {\n\t\t\tlet varType = \"var\";\n\t\t\tconst [stmtType, rawId, rawValue] = statement;\n\t\t\tconst eq = rawValue !== void 0 ? this.expression(rawValue) : void 0;\n\t\t\tif (!eq) throw new Error(`Cannot create variable '${rawId}' without an initial value.`);\n\t\t\tconst ephemeral = isEphemeralSnippet(eq);\n\t\t\tlet dataType = eq.dataType;\n\t\t\tconst naturallyEphemeral = isNaturallyEphemeral(dataType);\n\t\t\tif (isLooseData(eq.dataType)) throw new Error(`Cannot create variable '${rawId}' with loose data type.`);\n\t\t\tif (eq.value instanceof RefOperator) {\n\t\t\t\tif (eq.dataType !== UnknownData) throw new WgslTypeError(`Cannot store d.ref() in a variable if it references another value. Copy the value passed into d.ref() instead.`);\n\t\t\t\tconst refSnippet = eq.value.snippet;\n\t\t\t\tconst varName = this.refVariable(rawId, concretize(refSnippet.dataType));\n\t\t\t\treturn stitch`${this.ctx.pre}var ${varName} = ${tryConvertSnippet(this.ctx, refSnippet, refSnippet.dataType, false)};`;\n\t\t\t}\n\t\t\tif (!ephemeral) {\n\t\t\t\tif (stmtType === NODE.let) {\n\t\t\t\t\tconst rhsStr = this.ctx.resolve(eq.value).value;\n\t\t\t\t\tconst rhsTypeStr = this.ctx.resolve(unptr(eq.dataType)).value;\n\t\t\t\t\tthrow new WgslTypeError(`'let ${rawId} = ${rhsStr}' is invalid, because references cannot be assigned to 'let' variable declarations.\n-----\n- Try 'let ${rawId} = ${rhsTypeStr}(${rhsStr})' if you need to reassign '${rawId}' later\n- Try 'const ${rawId} = ${rhsStr}' if you won't reassign '${rawId}' later.\n-----`);\n\t\t\t\t}\n\t\t\t\tif (eq.origin === \"constant-tgpu-const-ref\") varType = \"const\";\n\t\t\t\telse if (eq.origin === \"runtime-tgpu-const-ref\") varType = \"let\";\n\t\t\t\telse {\n\t\t\t\t\tvarType = \"let\";\n\t\t\t\t\tif (!isPtr(dataType)) {\n\t\t\t\t\t\tconst ptrType = createPtrFromOrigin(eq.origin, concretize(dataType));\n\t\t\t\t\t\tinvariant(ptrType !== void 0, `Creating pointer type from origin ${eq.origin}`);\n\t\t\t\t\t\tdataType = ptrType;\n\t\t\t\t\t}\n\t\t\t\t\tif (!(eq.value instanceof RefOperator)) dataType = implicitFrom(dataType);\n\t\t\t\t}\n\t\t\t} else if (stmtType === NODE.const) {\n\t\t\t\tif (eq.origin === \"argument\") varType = \"let\";\n\t\t\t\telse if (naturallyEphemeral) varType = eq.origin === \"constant\" ? \"const\" : \"let\";\n\t\t\t} else if (eq.origin === \"argument\") {\n\t\t\t\tif (!naturallyEphemeral) {\n\t\t\t\t\tconst rhsStr = this.ctx.resolve(eq.value).value;\n\t\t\t\t\tconst rhsTypeStr = this.ctx.resolve(unptr(eq.dataType)).value;\n\t\t\t\t\tthrow new WgslTypeError(`'let ${rawId} = ${rhsStr}' is invalid, because references to arguments cannot be assigned to 'let' variable declarations.\n -----\n - Try 'let ${rawId} = ${rhsTypeStr}(${rhsStr})' if you need to reassign '${rawId}' later\n - Try 'const ${rawId} = ${rhsStr}' if you won't reassign '${rawId}' later.\n -----`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst snippet = this.blockVariable(varType, rawId, concretize(dataType), eq.origin);\n\t\t\treturn stitch`${this.ctx.pre}${varType} ${snippet.value} = ${tryConvertSnippet(this.ctx, eq, dataType, false)};`;\n\t\t}\n\t\tif (statement[0] === NODE.block) return `${this.ctx.pre}${this.block(statement)}`;\n\t\tif (statement[0] === NODE.for) {\n\t\t\tconst [_, init, condition, update, body] = statement;\n\t\t\tconst prevUnrollingFlag = this.#unrolling;\n\t\t\tthis.#unrolling = false;\n\t\t\ttry {\n\t\t\t\tthis.ctx.pushBlockScope();\n\t\t\t\tconst [initStatement, conditionExpr, updateStatement] = this.ctx.withResetIndentLevel(() => [\n\t\t\t\t\tinit ? this.statement(init) : void 0,\n\t\t\t\t\tcondition ? this.typedExpression(condition, bool) : void 0,\n\t\t\t\t\tupdate ? this.statement(update) : void 0\n\t\t\t\t]);\n\t\t\t\tconst initStr = initStatement ? initStatement.slice(0, -1) : \"\";\n\t\t\t\tconst updateStr = updateStatement ? updateStatement.slice(0, -1) : \"\";\n\t\t\t\tconst bodyStr = this.block(blockifySingleStatement(body));\n\t\t\t\treturn stitch`${this.ctx.pre}for (${initStr}; ${conditionExpr}; ${updateStr}) ${bodyStr}`;\n\t\t\t} finally {\n\t\t\t\tthis.#unrolling = prevUnrollingFlag;\n\t\t\t\tthis.ctx.popBlockScope();\n\t\t\t}\n\t\t}\n\t\tif (statement[0] === NODE.while) {\n\t\t\tconst prevUnrollingFlag = this.#unrolling;\n\t\t\tthis.#unrolling = false;\n\t\t\ttry {\n\t\t\t\tconst [_, condition, body] = statement;\n\t\t\t\tconst condSnippet = this.typedExpression(condition, bool);\n\t\t\t\tconst conditionStr = this.ctx.resolve(condSnippet.value).value;\n\t\t\t\tconst bodyStr = this.block(blockifySingleStatement(body));\n\t\t\t\treturn `${this.ctx.pre}while (${conditionStr}) ${bodyStr}`;\n\t\t\t} finally {\n\t\t\t\tthis.#unrolling = prevUnrollingFlag;\n\t\t\t}\n\t\t}\n\t\tif (statement[0] === NODE.forOf) {\n\t\t\tconst [_, loopVar, iterable, body] = statement;\n\t\t\tif (loopVar[0] !== NODE.const) throw new WgslTypeError(\"Only `for (const ... of ... )` loops are supported\");\n\t\t\tlet ctxIndent = false;\n\t\t\tconst prevUnrollingFlag = this.#unrolling;\n\t\t\ttry {\n\t\t\t\tthis.ctx.pushBlockScope();\n\t\t\t\tconst iterableExpr = this.expression(iterable);\n\t\t\t\tconst shouldUnroll = iterableExpr.value instanceof UnrollableIterable;\n\t\t\t\tconst iterableSnippet = shouldUnroll ? iterableExpr.value.snippet : iterableExpr;\n\t\t\t\tconst elementCountSnippet = getElementCountSnippet(this.ctx, iterableSnippet, shouldUnroll);\n\t\t\t\tconst originalLoopVarName = loopVar[1];\n\t\t\t\tconst blockified = blockifySingleStatement(body);\n\t\t\t\tif (shouldUnroll) {\n\t\t\t\t\tif (!isKnownAtComptime(elementCountSnippet)) throw new Error(\"Cannot unroll loop. Length of iterable is unknown at comptime.\");\n\t\t\t\t\tthis.#unrolling = true;\n\t\t\t\t\tconst length = elementCountSnippet.value;\n\t\t\t\t\tif (length === 0) return \"\";\n\t\t\t\t\tconst { value } = iterableSnippet;\n\t\t\t\t\tconst elements = value instanceof ArrayExpression ? value.elements : Array.from({ length }, (_, i) => getElementSnippet(iterableSnippet, snip(i, u32, \"constant\")));\n\t\t\t\t\tif (isEphemeralSnippet(elements[0]) && !isNaturallyEphemeral(elements[0]?.dataType)) throw new WgslTypeError(\"Cannot unroll loop. The elements of iterable are emphemeral but not naturally ephemeral.\");\n\t\t\t\t\treturn elements.map((e, i) => `${this.ctx.pre}// unrolled iteration #${i}\\n${this.ctx.pre}${this.block(blockified, { [originalLoopVarName]: e })}`).join(\"\\n\");\n\t\t\t\t}\n\t\t\t\tif (isEphemeralSnippet(iterableSnippet)) throw new Error(`\\`for ... of ...\\` loops only support iterables stored in variables.\n -----\n You can wrap iterable with \\`tgpu.unroll(...)\\`. If iterable is known at comptime, the loop will be unrolled.\n -----`);\n\t\t\t\tthis.#unrolling = false;\n\t\t\t\tconst index = this.ctx.makeNameValid(\"i\");\n\t\t\t\tconst elementSnippet = getElementSnippet(iterableSnippet, snip(index, u32, \"runtime\"));\n\t\t\t\tconst loopVarName = this.ctx.makeNameValid(originalLoopVarName);\n\t\t\t\tconst loopVarKind = getLoopVarKind(elementSnippet);\n\t\t\t\tconst elementType = getElementType(elementSnippet, iterableSnippet);\n\t\t\t\tconst forHeaderStr = stitch`${this.ctx.pre}for (var ${index} = 0u; ${index} < ${elementCountSnippet}; ${index}++) {`;\n\t\t\t\tthis.ctx.indent();\n\t\t\t\tctxIndent = true;\n\t\t\t\tconst loopVarDeclStr = stitch`${this.ctx.pre}${loopVarKind} ${loopVarName} = ${tryConvertSnippet(this.ctx, elementSnippet, elementType, false)};`;\n\t\t\t\tconst bodyStr = `${this.ctx.pre}${this.block(blockified, { [originalLoopVarName]: snip(loopVarName, elementType, elementSnippet.origin) })}`;\n\t\t\t\tthis.ctx.dedent();\n\t\t\t\tctxIndent = false;\n\t\t\t\treturn stitch`${forHeaderStr}\\n${loopVarDeclStr}\\n${bodyStr}\\n${this.ctx.pre}}`;\n\t\t\t} finally {\n\t\t\t\tif (ctxIndent) this.ctx.dedent();\n\t\t\t\tthis.#unrolling = prevUnrollingFlag;\n\t\t\t\tthis.ctx.popBlockScope();\n\t\t\t}\n\t\t}\n\t\tif (statement[0] === NODE.continue) {\n\t\t\tif (this.#unrolling) throw new WgslTypeError(\"Cannot unroll loop containing `continue`\");\n\t\t\treturn `${this.ctx.pre}continue;`;\n\t\t}\n\t\tif (statement[0] === NODE.break) {\n\t\t\tif (this.#unrolling) throw new WgslTypeError(\"Cannot unroll loop containing `break`\");\n\t\t\treturn `${this.ctx.pre}break;`;\n\t\t}\n\t\tconst expr = this.expression(statement);\n\t\tconst resolved = expr.value && this.ctx.resolve(expr.value).value;\n\t\treturn resolved ? `${this.ctx.pre}${resolved};` : \"\";\n\t}\n};\nfunction assertExhaustive(value) {\n\tthrow new Error(`'${safeStringify(value)}' was not handled by the WGSL generator.`);\n}\nfunction parseNumericString(str) {\n\tif (/^0x[0-9a-f]+$/i.test(str)) return Number.parseInt(str);\n\tif (/^0b[01]+$/i.test(str)) return Number.parseInt(str.slice(2), 2);\n\treturn Number.parseFloat(str);\n}\nfunction blockifySingleStatement(statement) {\n\treturn typeof statement !== \"object\" || statement[0] !== NODE.block ? [NODE.block, [statement]] : statement;\n}\nconst wgslGenerator = new WgslGenerator();\n\n//#endregion\nexport { wgslGenerator as default };","import { $internal, $providing, $resolve, isMarkedInternal } from \"./shared/symbols.js\";\nimport { getName, hasTinyestMetadata, setName } from \"./shared/meta.js\";\nimport { Void, isPtr, isWgslArray, isWgslStruct } from \"./data/wgslTypes.js\";\nimport { UnknownData, isData } from \"./data/dataTypes.js\";\nimport { snip } from \"./data/snippet.js\";\nimport { MissingSlotValueError, ResolutionError, WgslTypeError, invariant } from \"./errors.js\";\nimport { isLazy, isProviding, isSlot } from \"./core/slot/slotTypes.js\";\nimport { CodegenState, NormalState, isSelfResolvable } from \"./types.js\";\nimport { provideCtx, topLevelState } from \"./execMode.js\";\nimport { stitch } from \"./core/resolve/stitch.js\";\nimport { safeStringify } from \"./shared/stringify.js\";\nimport { getBestConversion } from \"./tgsl/conversion.js\";\nimport { bool } from \"./data/numeric.js\";\nimport { getAttributesString } from \"./data/attributes.js\";\nimport { createIoSchema } from \"./core/function/ioSchema.js\";\nimport { AutoStruct } from \"./data/autoStruct.js\";\nimport { coerceToSnippet, concretize, numericLiteralToSnippet } from \"./tgsl/generationHelpers.js\";\nimport { accessProp } from \"./tgsl/accessProp.js\";\nimport { isTgpuFn } from \"./core/function/tgpuFn.js\";\nimport { getUniqueName } from \"./core/resolve/namespace.js\";\nimport { resolveData } from \"./core/resolve/resolveData.js\";\nimport { ConfigurableImpl } from \"./core/root/configurableImpl.js\";\nimport { naturalsExcept } from \"./shared/generators.js\";\nimport { TgpuBindGroupImpl, bindGroupLayout } from \"./tgpuBindGroupLayout.js\";\nimport { LogGeneratorImpl, LogGeneratorNullImpl } from \"./tgsl/consoleLog/logGenerator.js\";\nimport wgslGenerator from \"./tgsl/wgslGenerator.js\";\nimport { FuncParameterType } from \"tinyest\";\n\n//#region src/resolutionCtx.ts\n/**\n* Inserted into bind group entry definitions that belong\n* to the automatically generated catch-all bind group.\n*\n* A non-occupied group index can only be determined after\n* every resource has been resolved, so this acts as a placeholder\n* to be replaced with an actual numeric index at the very end\n* of the resolution process.\n*/\nconst CATCHALL_BIND_GROUP_IDX_MARKER = \"#CATCHALL#\";\nvar ItemStateStackImpl = class {\n\t_stack = [];\n\t_itemDepth = 0;\n\tget itemDepth() {\n\t\treturn this._itemDepth;\n\t}\n\tget topItem() {\n\t\tconst state = this._stack[this._stack.length - 1];\n\t\tif (!state || state.type !== \"item\") throw new Error(\"Internal error, expected item layer to be on top.\");\n\t\treturn state;\n\t}\n\tget topFunctionScope() {\n\t\treturn this._stack.findLast((e) => e.type === \"functionScope\");\n\t}\n\tpushItem() {\n\t\tthis._itemDepth++;\n\t\tthis._stack.push({\n\t\t\ttype: \"item\",\n\t\t\tusedSlots: /* @__PURE__ */ new Set()\n\t\t});\n\t}\n\tpushSlotBindings(pairs) {\n\t\tthis._stack.push({\n\t\t\ttype: \"slotBinding\",\n\t\t\tbindingMap: new WeakMap(pairs)\n\t\t});\n\t}\n\tpushFunctionScope(functionType, args, argAliases, returnType, externalMap) {\n\t\tconst scope = {\n\t\t\ttype: \"functionScope\",\n\t\t\tfunctionType,\n\t\t\targs,\n\t\t\targAliases,\n\t\t\treturnType,\n\t\t\texternalMap,\n\t\t\treportedReturnTypes: /* @__PURE__ */ new Set()\n\t\t};\n\t\tthis._stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushBlockScope() {\n\t\tthis._stack.push({\n\t\t\ttype: \"blockScope\",\n\t\t\tdeclarations: /* @__PURE__ */ new Map(),\n\t\t\texternals: /* @__PURE__ */ new Map()\n\t\t});\n\t}\n\tpop(type) {\n\t\tconst layer = this._stack[this._stack.length - 1];\n\t\tif (!layer || type && layer.type !== type) throw new Error(`Internal error, expected a ${type} layer to be on top.`);\n\t\tconst poppedValue = this._stack.pop();\n\t\tif (type === \"item\") this._itemDepth--;\n\t\treturn poppedValue;\n\t}\n\treadSlot(slot) {\n\t\tfor (let i = this._stack.length - 1; i >= 0; --i) {\n\t\t\tconst layer = this._stack[i];\n\t\t\tif (layer?.type === \"item\") layer.usedSlots.add(slot);\n\t\t\telse if (layer?.type === \"slotBinding\") {\n\t\t\t\tconst boundValue = layer.bindingMap.get(slot);\n\t\t\t\tif (boundValue !== void 0) return boundValue;\n\t\t\t} else if (layer?.type === \"functionScope\" || layer?.type === \"blockScope\") {} else throw new Error(\"Unknown layer type.\");\n\t\t}\n\t\treturn slot.defaultValue;\n\t}\n\tgetSnippetById(id) {\n\t\tfor (let i = this._stack.length - 1; i >= 0; --i) {\n\t\t\tconst layer = this._stack[i];\n\t\t\tif (layer?.type === \"functionScope\") {\n\t\t\t\tconst arg = layer.args.find((a) => a.value === id);\n\t\t\t\tif (arg !== void 0) return arg;\n\t\t\t\tif (layer.argAliases[id]) return layer.argAliases[id];\n\t\t\t\tconst external = layer.externalMap[id];\n\t\t\t\tif (external !== void 0 && external !== null) return coerceToSnippet(external);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (layer?.type === \"blockScope\") {\n\t\t\t\tconst snippet = layer.declarations.get(id) ?? layer.externals.get(id);\n\t\t\t\tif (snippet !== void 0) return snippet;\n\t\t\t}\n\t\t}\n\t}\n\tdefineBlockVariable(id, snippet) {\n\t\tif (snippet.dataType === UnknownData) throw Error(`Tried to define variable '${id}' of unknown type`);\n\t\tfor (let i = this._stack.length - 1; i >= 0; --i) {\n\t\t\tconst layer = this._stack[i];\n\t\t\tif (layer?.type === \"blockScope\") {\n\t\t\t\tlayer.declarations.set(id, snippet);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"No block scope found to define a variable in.\");\n\t}\n\tsetBlockExternals(externals) {\n\t\tfor (let i = this._stack.length - 1; i >= 0; --i) {\n\t\t\tconst layer = this._stack[i];\n\t\t\tif (layer?.type === \"blockScope\") {\n\t\t\t\tObject.entries(externals).forEach(([id, snippet]) => {\n\t\t\t\t\tlayer.externals.set(id, snippet);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"No block scope found to set externals in.\");\n\t}\n\tclearBlockExternals() {\n\t\tfor (let i = this._stack.length - 1; i >= 0; --i) {\n\t\t\tconst layer = this._stack[i];\n\t\t\tif (layer?.type === \"blockScope\") {\n\t\t\t\tlayer.externals.clear();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"No block scope found to clear externals in.\");\n\t}\n};\nconst INDENT = [\n\t\"\",\n\t\" \",\n\t\" \",\n\t\" \",\n\t\" \",\n\t\" \",\n\t\" \",\n\t\" \",\n\t\" \"\n];\nconst N = INDENT.length - 1;\nvar IndentController = class {\n\tidentLevel = 0;\n\tget pre() {\n\t\treturn INDENT[this.identLevel] ?? INDENT[N].repeat(this.identLevel / N) + INDENT[this.identLevel % N];\n\t}\n\tindent() {\n\t\tconst str = this.pre;\n\t\tthis.identLevel++;\n\t\treturn str;\n\t}\n\tdedent() {\n\t\tthis.identLevel--;\n\t\treturn this.pre;\n\t}\n\twithResetLevel(callback) {\n\t\tconst savedLevel = this.identLevel;\n\t\tthis.identLevel = 0;\n\t\ttry {\n\t\t\treturn callback();\n\t\t} finally {\n\t\t\tthis.identLevel = savedLevel;\n\t\t}\n\t}\n};\nvar ResolutionCtxImpl = class {\n\t#namespaceInternal;\n\t#shaderGenerator;\n\t_indentController = new IndentController();\n\t_itemStateStack = new ItemStateStackImpl();\n\t#modeStack = [];\n\t_declarations = [];\n\t_varyingLocations;\n\t#currentlyResolvedItems = /* @__PURE__ */ new WeakSet();\n\t#logGenerator;\n\tget varyingLocations() {\n\t\treturn this._varyingLocations;\n\t}\n\t[$internal] = { itemStateStack: this._itemStateStack };\n\t/**\n\t* A map from registered bind group layouts to random strings put in\n\t* place of their group index. The whole tree has to be traversed to\n\t* collect every use of a typed bind group layout, since they can be\n\t* explicitly imposed group indices, and they cannot collide.\n\t*/\n\tbindGroupLayoutsToPlaceholderMap = /* @__PURE__ */ new Map();\n\t_nextFreeLayoutPlaceholderIdx = 0;\n\tfixedBindings = [];\n\tenableExtensions;\n\texpectedType;\n\tconstructor(opts) {\n\t\tthis.enableExtensions = opts.enableExtensions;\n\t\tthis.#shaderGenerator = opts.shaderGenerator ?? wgslGenerator;\n\t\tthis.#logGenerator = opts.root ? new LogGeneratorImpl(opts.root) : new LogGeneratorNullImpl();\n\t\tthis.#namespaceInternal = opts.namespace[$internal];\n\t}\n\tgetUniqueName(resource) {\n\t\treturn getUniqueName(this.#namespaceInternal, resource);\n\t}\n\tmakeNameValid(name) {\n\t\treturn this.#namespaceInternal.nameRegistry.makeValid(name);\n\t}\n\tget pre() {\n\t\treturn this._indentController.pre;\n\t}\n\tget topFunctionScope() {\n\t\treturn this._itemStateStack.topFunctionScope;\n\t}\n\tget topFunctionReturnType() {\n\t\tconst scope = this._itemStateStack.topFunctionScope;\n\t\tinvariant(scope, \"Internal error, expected function scope to be present.\");\n\t\treturn scope.returnType;\n\t}\n\tget shelllessRepo() {\n\t\treturn this.#namespaceInternal.shelllessRepo;\n\t}\n\tindent() {\n\t\treturn this._indentController.indent();\n\t}\n\tdedent() {\n\t\treturn this._indentController.dedent();\n\t}\n\twithResetIndentLevel(callback) {\n\t\treturn this._indentController.withResetLevel(callback);\n\t}\n\tgetById(id) {\n\t\tconst item = this._itemStateStack.getSnippetById(id);\n\t\tif (item === void 0) return null;\n\t\treturn item;\n\t}\n\tdefineVariable(id, snippet) {\n\t\tthis._itemStateStack.defineBlockVariable(id, snippet);\n\t}\n\treportReturnType(dataType) {\n\t\tconst scope = this._itemStateStack.topFunctionScope;\n\t\tinvariant(scope, \"Internal error, expected function scope to be present.\");\n\t\tscope.reportedReturnTypes.add(dataType);\n\t}\n\tpushBlockScope() {\n\t\tthis.#namespaceInternal.nameRegistry.pushBlockScope();\n\t\tthis._itemStateStack.pushBlockScope();\n\t}\n\tpopBlockScope() {\n\t\tthis.#namespaceInternal.nameRegistry.popBlockScope();\n\t\tthis._itemStateStack.pop(\"blockScope\");\n\t}\n\tsetBlockExternals(externals) {\n\t\tthis._itemStateStack.setBlockExternals(externals);\n\t}\n\tclearBlockExternals() {\n\t\tthis._itemStateStack.clearBlockExternals();\n\t}\n\tgenerateLog(op, args) {\n\t\treturn this.#logGenerator.generateLog(this, op, args);\n\t}\n\tget logResources() {\n\t\treturn this.#logGenerator.logResources;\n\t}\n\tfnToWgsl(options) {\n\t\tlet fnScopePushed = false;\n\t\ttry {\n\t\t\tthis.#namespaceInternal.nameRegistry.pushFunctionScope();\n\t\t\tconst args = [];\n\t\t\tconst argAliases = [];\n\t\t\tfor (const [i, argType] of options.argTypes.entries()) {\n\t\t\t\tconst astParam = options.params[i];\n\t\t\t\tconst origin = isPtr(argType) ? argType.addressSpace === \"storage\" ? argType.access === \"read\" ? \"readonly\" : \"mutable\" : argType.addressSpace : \"argument\";\n\t\t\t\tswitch (astParam?.type) {\n\t\t\t\t\tcase FuncParameterType.identifier: {\n\t\t\t\t\t\tconst rawName = astParam.name;\n\t\t\t\t\t\tconst snippet = snip(this.makeNameValid(rawName), argType, origin);\n\t\t\t\t\t\targs.push(snippet);\n\t\t\t\t\t\tif (snippet.value !== rawName) argAliases.push([rawName, snippet]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase FuncParameterType.destructuredObject: {\n\t\t\t\t\t\tconst objSnippet = snip(`_arg_${i}`, argType, origin);\n\t\t\t\t\t\targs.push(objSnippet);\n\t\t\t\t\t\targAliases.push(...astParam.props.map(({ name, alias }) => [alias, accessProp(objSnippet, name)]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase void 0: if (!(argType instanceof AutoStruct)) args.push(snip(`_arg_${i}`, argType, origin));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst scope = this._itemStateStack.pushFunctionScope(options.functionType, args, Object.fromEntries(argAliases), options.returnType, options.externalMap);\n\t\t\tfnScopePushed = true;\n\t\t\tthis.#shaderGenerator.initGenerator(this);\n\t\t\tconst body = this.#shaderGenerator.functionDefinition(options.body);\n\t\t\tlet returnType = options.returnType;\n\t\t\tif (returnType instanceof AutoStruct) if (isWgslStruct(scope.reportedReturnTypes.values().next().value)) returnType = returnType.completeStruct;\n\t\t\telse returnType = void 0;\n\t\t\tif (!returnType) {\n\t\t\t\tconst returnTypes = [...scope.reportedReturnTypes];\n\t\t\t\tif (returnTypes.length === 0) returnType = Void;\n\t\t\t\telse {\n\t\t\t\t\tconst conversion = getBestConversion(returnTypes);\n\t\t\t\t\tif (conversion && !conversion.hasImplicitConversions) returnType = conversion.targetType;\n\t\t\t\t}\n\t\t\t\tif (!returnType) throw new Error(`Expected function to have a single return type, got [${returnTypes.join(\", \")}]. Cast explicitly to the desired type.`);\n\t\t\t\treturnType = concretize(returnType);\n\t\t\t\tif (options.functionType === \"vertex\" || options.functionType === \"fragment\") returnType = createIoSchema(returnType);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\thead: resolveFunctionHeader(this, args, returnType),\n\t\t\t\tbody,\n\t\t\t\treturnType\n\t\t\t};\n\t\t} finally {\n\t\t\tif (fnScopePushed) this._itemStateStack.pop(\"functionScope\");\n\t\t\tthis.#namespaceInternal.nameRegistry.popFunctionScope();\n\t\t}\n\t}\n\taddDeclaration(declaration) {\n\t\tthis._declarations.push(declaration);\n\t}\n\tallocateLayoutEntry(layout) {\n\t\tconst memoMap = this.bindGroupLayoutsToPlaceholderMap;\n\t\tlet placeholderKey = memoMap.get(layout);\n\t\tif (!placeholderKey) {\n\t\t\tplaceholderKey = `#BIND_GROUP_LAYOUT_${this._nextFreeLayoutPlaceholderIdx++}#`;\n\t\t\tmemoMap.set(layout, placeholderKey);\n\t\t}\n\t\treturn placeholderKey;\n\t}\n\tallocateFixedEntry(layoutEntry, resource) {\n\t\tconst binding = this.fixedBindings.length;\n\t\tthis.fixedBindings.push({\n\t\t\tlayoutEntry,\n\t\t\tresource\n\t\t});\n\t\treturn {\n\t\t\tgroup: CATCHALL_BIND_GROUP_IDX_MARKER,\n\t\t\tbinding\n\t\t};\n\t}\n\treadSlot(slot) {\n\t\tconst value = this._itemStateStack.readSlot(slot);\n\t\tif (value === void 0) throw new MissingSlotValueError(slot);\n\t\treturn value;\n\t}\n\twithSlots(pairs, callback) {\n\t\tif (pairs.length === 0) return callback();\n\t\tthis._itemStateStack.pushSlotBindings(pairs);\n\t\ttry {\n\t\t\treturn callback();\n\t\t} finally {\n\t\t\tthis._itemStateStack.pop(\"slotBinding\");\n\t\t}\n\t}\n\twithVaryingLocations(locations, callback) {\n\t\tthis._varyingLocations = locations;\n\t\ttry {\n\t\t\treturn callback();\n\t\t} finally {\n\t\t\tthis._varyingLocations = void 0;\n\t\t}\n\t}\n\twithRenamed(item, name, callback) {\n\t\tif (!name) return callback();\n\t\tconst oldName = getName(item);\n\t\ttry {\n\t\t\tsetName(item, name);\n\t\t\treturn callback();\n\t\t} finally {\n\t\t\tsetName(item, oldName);\n\t\t}\n\t}\n\tunwrap(eventual) {\n\t\tif (isProviding(eventual)) return this.withRenamed(eventual[$providing].inner, getName(eventual), () => this.withSlots(eventual[$providing].pairs, () => this.unwrap(eventual[$providing].inner)));\n\t\tlet maybeEventual = eventual;\n\t\twhile (true) if (isSlot(maybeEventual)) maybeEventual = this.readSlot(maybeEventual);\n\t\telse if (isLazy(maybeEventual)) maybeEventual = this._getOrCompute(maybeEventual);\n\t\telse break;\n\t\treturn maybeEventual;\n\t}\n\t_getOrCompute(lazy) {\n\t\tconst instances = this.#namespaceInternal.memoizedLazy.get(lazy) ?? [];\n\t\tthis._itemStateStack.pushItem();\n\t\ttry {\n\t\t\tfor (const instance of instances) if ([...instance.slotToValueMap.entries()].every(([slot, expectedValue]) => slot.areEqual(this._itemStateStack.readSlot(slot), expectedValue))) return instance.result;\n\t\t\tthis.pushMode(new NormalState());\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = lazy[$internal].compute();\n\t\t\t} finally {\n\t\t\t\tthis.popMode(\"normal\");\n\t\t\t}\n\t\t\tconst slotToValueMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const usedSlot of this._itemStateStack.topItem.usedSlots) slotToValueMap.set(usedSlot, this._itemStateStack.readSlot(usedSlot));\n\t\t\tinstances.push({\n\t\t\t\tslotToValueMap,\n\t\t\t\tresult\n\t\t\t});\n\t\t\tthis.#namespaceInternal.memoizedLazy.set(lazy, instances);\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tif (err instanceof ResolutionError) throw err.appendToTrace(lazy);\n\t\t\tthrow new ResolutionError(err, [lazy]);\n\t\t} finally {\n\t\t\tthis._itemStateStack.pop(\"item\");\n\t\t}\n\t}\n\t/**\n\t* @param item The item whose resolution should be either retrieved from the cache (if there is a cache hit), or resolved.\n\t*/\n\t_getOrInstantiate(item) {\n\t\tconst instances = this.#namespaceInternal.memoizedResolves.get(item) ?? [];\n\t\tthis._itemStateStack.pushItem();\n\t\ttry {\n\t\t\tfor (const instance of instances) if ([...instance.slotToValueMap.entries()].every(([slot, expectedValue]) => slot.areEqual(this._itemStateStack.readSlot(slot), expectedValue))) return instance.result;\n\t\t\tlet result;\n\t\t\tif (isData(item)) result = snip(resolveData(this, item), Void, \"runtime\");\n\t\t\telse if (isLazy(item) || isSlot(item)) result = this.resolve(this.unwrap(item));\n\t\t\telse if (isSelfResolvable(item)) result = item[$resolve](this);\n\t\t\telse if (hasTinyestMetadata(item)) {\n\t\t\t\tconst shellless = this.#namespaceInternal.shelllessRepo.get(item, void 0);\n\t\t\t\tif (!shellless) throw new Error(`Couldn't resolve ${item.name}. Make sure it's a function that accepts no arguments, or call it from another TypeGPU function.`);\n\t\t\t\treturn this.withResetIndentLevel(() => this.resolve(shellless));\n\t\t\t} else throw new TypeError(`Unresolvable internal value: ${safeStringify(item)}`);\n\t\t\tconst slotToValueMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const usedSlot of this._itemStateStack.topItem.usedSlots) slotToValueMap.set(usedSlot, this._itemStateStack.readSlot(usedSlot));\n\t\t\tinstances.push({\n\t\t\t\tslotToValueMap,\n\t\t\t\tresult\n\t\t\t});\n\t\t\tthis.#namespaceInternal.memoizedResolves.set(item, instances);\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tif (err instanceof ResolutionError) throw err.appendToTrace(item);\n\t\t\tthrow new ResolutionError(err, [item]);\n\t\t} finally {\n\t\t\tthis._itemStateStack.pop(\"item\");\n\t\t}\n\t}\n\tresolve(item, schema) {\n\t\tif (isTgpuFn(item) || hasTinyestMetadata(item)) {\n\t\t\tif (this.#currentlyResolvedItems.has(item) && !this.#namespaceInternal.memoizedResolves.has(item)) throw new Error(`Recursive function ${item} detected. Recursion is not allowed on the GPU.`);\n\t\t\tthis.#currentlyResolvedItems.add(item);\n\t\t}\n\t\tif (isProviding(item)) return this.withRenamed(item[$providing].inner, getName(item), () => this.withSlots(item[$providing].pairs, () => this.resolve(item[$providing].inner, schema)));\n\t\tif (isMarkedInternal(item) || hasTinyestMetadata(item)) {\n\t\t\tif (this._itemStateStack.itemDepth === 0) try {\n\t\t\t\tthis.pushMode(new CodegenState());\n\t\t\t\tconst result = provideCtx(this, () => this._getOrInstantiate(item));\n\t\t\t\treturn snip(`${[...this._declarations].join(\"\\n\\n\")}${result.value}`, Void, \"runtime\");\n\t\t\t} finally {\n\t\t\t\tthis.popMode(\"codegen\");\n\t\t\t}\n\t\t\treturn this._getOrInstantiate(item);\n\t\t}\n\t\tif (typeof item === \"number\") {\n\t\t\tconst realSchema = schema ?? numericLiteralToSnippet(item).dataType;\n\t\t\tinvariant(realSchema !== UnknownData, \"Schema has to be known for resolving numbers\");\n\t\t\tif (realSchema.type === \"abstractInt\") return snip(`${item}`, realSchema, \"constant\");\n\t\t\tif (realSchema.type === \"u32\") return snip(`${item}u`, realSchema, \"constant\");\n\t\t\tif (realSchema.type === \"i32\") return snip(`${item}i`, realSchema, \"constant\");\n\t\t\tconst exp = item.toExponential();\n\t\t\tconst decimal = realSchema.type === \"abstractFloat\" && Number.isInteger(item) ? `${item}.` : `${item}`;\n\t\t\tconst base = exp.length < decimal.length ? exp : decimal;\n\t\t\tif (realSchema.type === \"f32\") return snip(`${base}f`, realSchema, \"constant\");\n\t\t\tif (realSchema.type === \"f16\") return snip(`${base}h`, realSchema, \"constant\");\n\t\t\treturn snip(base, realSchema, \"constant\");\n\t\t}\n\t\tif (typeof item === \"boolean\") return snip(item ? \"true\" : \"false\", bool, \"constant\");\n\t\tif (typeof item === \"string\") return snip(item, Void, \"runtime\");\n\t\tif (schema && isWgslArray(schema)) {\n\t\t\tif (!Array.isArray(item)) throw new WgslTypeError(`Cannot coerce ${item} into value of type '${schema}'`);\n\t\t\tif (schema.elementCount !== item.length) throw new WgslTypeError(`Cannot create value of type '${schema}' from an array of length: ${item.length}`);\n\t\t\treturn snip(stitch`array<${this.resolve(schema.elementType)}, ${schema.elementCount}>(${item.map((element) => snip(element, schema.elementType, \"runtime\"))})`, schema, \"runtime\");\n\t\t}\n\t\tif (Array.isArray(item)) return snip(stitch`array(${item.map((element) => this.resolve(element))})`, UnknownData, \"runtime\");\n\t\tif (schema && isWgslStruct(schema)) return snip(stitch`${this.resolve(schema)}(${Object.entries(schema.propTypes).map(([key, propType]) => snip(item[key], propType, \"runtime\"))})`, schema, \"runtime\");\n\t\tthrow new WgslTypeError(`Value ${item} (as json: ${safeStringify(item)}) is not resolvable${schema ? ` to type ${safeStringify(schema)}` : \"\"}`);\n\t}\n\tpushMode(mode) {\n\t\tthis.#modeStack.push(mode);\n\t}\n\tpopMode(expected) {\n\t\tconst mode = this.#modeStack.pop();\n\t\tif (expected !== void 0) invariant(mode?.type === expected, \"Unexpected mode\");\n\t}\n\tget mode() {\n\t\treturn this.#modeStack[this.#modeStack.length - 1] ?? topLevelState;\n\t}\n};\nfunction resolve(item, options) {\n\tconst ctx = new ResolutionCtxImpl(options);\n\tlet code = (options.config ? ctx.withSlots(options.config(new ConfigurableImpl([])).bindings, () => ctx.resolve(item)) : ctx.resolve(item)).value;\n\tconst memoMap = ctx.bindGroupLayoutsToPlaceholderMap;\n\tconst usedBindGroupLayouts = [];\n\tconst automaticIds = naturalsExcept(new Set([...memoMap.keys()].map((layout) => layout.index).filter((v) => v !== void 0)));\n\tconst layoutEntries = ctx.fixedBindings.map((binding, idx) => [String(idx), binding.layoutEntry]);\n\tconst createCatchallGroup = () => {\n\t\tconst catchallIdx = automaticIds.next().value;\n\t\tconst catchallLayout = bindGroupLayout(Object.fromEntries(layoutEntries));\n\t\tusedBindGroupLayouts[catchallIdx] = catchallLayout;\n\t\tcode = code.replaceAll(CATCHALL_BIND_GROUP_IDX_MARKER, String(catchallIdx));\n\t\treturn [catchallIdx, new TgpuBindGroupImpl(catchallLayout, Object.fromEntries(ctx.fixedBindings.map((binding, idx) => [String(idx), binding.resource])))];\n\t};\n\tconst catchall = layoutEntries.length > 0 ? createCatchallGroup() : void 0;\n\tfor (const [layout, placeholder] of memoMap.entries()) {\n\t\tconst idx = layout.index ?? automaticIds.next().value;\n\t\tusedBindGroupLayouts[idx] = layout;\n\t\tcode = code.replaceAll(placeholder, String(idx));\n\t}\n\tif (options.enableExtensions && options.enableExtensions.length > 0) code = `${options.enableExtensions.map((ext) => `enable ${ext};`).join(\"\\n\")}\\n\\n${code}`;\n\treturn {\n\t\tcode,\n\t\tusedBindGroupLayouts,\n\t\tcatchall,\n\t\tlogResources: ctx.logResources\n\t};\n}\nfunction resolveFunctionHeader(ctx, args, returnType) {\n\tconst argList = args.map((arg) => `${arg.value}: ${ctx.resolve(arg.dataType).value}`).join(\", \");\n\treturn returnType.type !== \"void\" ? `(${argList}) -> ${getAttributesString(returnType)}${ctx.resolve(returnType).value} ` : `(${argList}) `;\n}\n\n//#endregion\nexport { ResolutionCtxImpl, resolve };","import { $internal } from \"../../shared/symbols.js\";\n\n//#region src/core/pipeline/typeGuards.ts\nfunction isComputePipeline(value) {\n\tconst maybe = value;\n\treturn maybe?.resourceType === \"compute-pipeline\" && !!maybe[$internal];\n}\nfunction isRenderPipeline(value) {\n\tconst maybe = value;\n\treturn maybe?.resourceType === \"render-pipeline\" && !!maybe[$internal];\n}\nfunction isPipeline(value) {\n\treturn isRenderPipeline(value) || isComputePipeline(value);\n}\nfunction isGPUCommandEncoder(value) {\n\treturn !!value && typeof value === \"object\" && \"beginRenderPass\" in value && \"beginComputePass\" in value;\n}\nfunction isGPUComputePassEncoder(value) {\n\treturn !!value && typeof value === \"object\" && \"dispatchWorkgroups\" in value && !(\"beginRenderPass\" in value);\n}\nfunction isGPURenderPassEncoder(value) {\n\treturn !!value && typeof value === \"object\" && \"executeBundles\" in value && \"draw\" in value;\n}\nfunction isGPURenderBundleEncoder(value) {\n\treturn !!value && typeof value === \"object\" && \"draw\" in value && \"finish\" in value && !(\"executeBundles\" in value) && !(\"beginRenderPass\" in value) && !(\"dispatchWorkgroups\" in value);\n}\n\n//#endregion\nexport { isComputePipeline, isGPUCommandEncoder, isGPUComputePassEncoder, isGPURenderBundleEncoder, isGPURenderPassEncoder, isPipeline, isRenderPipeline };","import { $internal, $resolve } from \"../../shared/symbols.js\";\nimport { Void } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { applyExternals, replaceExternalsInWgsl } from \"./externals.js\";\nimport { namespace } from \"./namespace.js\";\nimport { isBindGroupLayout } from \"../../tgpuBindGroupLayout.js\";\nimport { resolve as resolve$1 } from \"../../resolutionCtx.js\";\nimport { isPipeline } from \"../pipeline/typeGuards.js\";\n\n//#region src/core/resolve/tgpuResolve.ts\nfunction resolveWithContext(arg0, options) {\n\tif (Array.isArray(arg0)) return resolveFromArray(arg0, options);\n\treturn resolveFromTemplate(arg0);\n}\nfunction resolve(arg, options) {\n\tif (Array.isArray(arg)) return resolveWithContext(arg, options).code;\n\treturn resolveWithContext(arg).code;\n}\nfunction resolveFromTemplate(options) {\n\tconst { template, externals, shaderGenerator, names = \"strict\", config, enableExtensions } = options;\n\tif (!template) console.warn(\"Calling resolve with an empty template is deprecated and will soon return an empty string. Consider using the 'tgpu.resolve(resolvableArray, options)' API instead.\");\n\tconst dependencies = {};\n\tapplyExternals(dependencies, externals ?? {});\n\treturn resolve$1({\n\t\t[$internal]: true,\n\t\t[$resolve](ctx) {\n\t\t\treturn snip(replaceExternalsInWgsl(ctx, dependencies, template ?? \"\"), Void, \"runtime\");\n\t\t},\n\t\ttoString: () => \"<root>\"\n\t}, {\n\t\tnamespace: typeof names === \"string\" ? namespace({ names }) : names,\n\t\tenableExtensions,\n\t\tshaderGenerator,\n\t\tconfig,\n\t\troot: tryFindRoot(Object.values(externals))\n\t});\n}\nfunction resolveFromArray(items, options) {\n\tconst { shaderGenerator, names = \"strict\", config, enableExtensions } = options ?? {};\n\treturn resolve$1({\n\t\t[$internal]: true,\n\t\t[$resolve](ctx) {\n\t\t\tfor (const item of items) if (isBindGroupLayout(item)) for (const binding of Object.values(item[$internal].bound)) ctx.resolve(binding);\n\t\t\telse ctx.resolve(item);\n\t\t\treturn snip(\"\", Void, \"runtime\");\n\t\t},\n\t\ttoString: () => \"<root>\"\n\t}, {\n\t\tnamespace: typeof names === \"string\" ? namespace({ names }) : names,\n\t\tenableExtensions,\n\t\tshaderGenerator,\n\t\tconfig,\n\t\troot: tryFindRoot(items)\n\t});\n}\n/**\n* Attempts to locate a pipeline in a list of items and returns the root.\n* Does not check recursively.\n* Throws an error if multiple pipelines are found.\n*/\nfunction tryFindRoot(items) {\n\tconst pipelines = items.filter(isPipeline);\n\tif (pipelines.length > 1) throw new Error(`Found ${pipelines.length} pipelines but can only resolve one at a time.`);\n\treturn pipelines[0]?.[$internal].root;\n}\n\n//#endregion\nexport { resolve, resolveWithContext };","import { $internal } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\nimport { kindToDefaultFormatMap, vertexFormats } from \"../../shared/vertexFormat.js\";\nimport { isDecorated, isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { getCustomLocation, isLooseDecorated, isUnstruct } from \"../../data/dataTypes.js\";\nimport { alignmentOf, customAlignmentOf } from \"../../data/alignmentOf.js\";\nimport { roundUp } from \"../../mathUtils.js\";\nimport { sizeOf } from \"../../data/sizeOf.js\";\n\n//#region src/core/vertexLayout/vertexLayout.ts\nfunction vertexLayout(schemaForCount, stepMode = \"vertex\") {\n\treturn new TgpuVertexLayoutImpl(schemaForCount, stepMode);\n}\nfunction isVertexLayout(value) {\n\treturn value?.resourceType === \"vertex-layout\";\n}\nconst defaultAttribEntry = Symbol(\"defaultAttribEntry\");\nfunction dataToContainedAttribs(layout, data, offset, customLocationMap, key) {\n\tif (isDecorated(data) || isLooseDecorated(data)) {\n\t\tconst customLocation = getCustomLocation(data);\n\t\tif (customLocation !== void 0) customLocationMap[key ?? defaultAttribEntry] = customLocation;\n\t\treturn dataToContainedAttribs(layout, data.inner, roundUp(offset, customAlignmentOf(data)), customLocationMap);\n\t}\n\tif (isWgslStruct(data)) {\n\t\tlet memberOffset = offset;\n\t\tconst propTypes = data.propTypes;\n\t\treturn Object.fromEntries(Object.entries(propTypes).map(([key, value]) => {\n\t\t\tmemberOffset = roundUp(memberOffset, alignmentOf(value));\n\t\t\tconst attrib = [key, dataToContainedAttribs(layout, value, memberOffset, customLocationMap, key)];\n\t\t\tmemberOffset += sizeOf(value);\n\t\t\treturn attrib;\n\t\t}));\n\t}\n\tif (isUnstruct(data)) {\n\t\tlet memberOffset = offset;\n\t\tconst propTypes = data.propTypes;\n\t\treturn Object.fromEntries(Object.entries(propTypes).map(([key, value]) => {\n\t\t\tmemberOffset = roundUp(memberOffset, customAlignmentOf(value));\n\t\t\tconst attrib = [key, dataToContainedAttribs(layout, value, memberOffset, customLocationMap, key)];\n\t\t\tmemberOffset += sizeOf(value);\n\t\t\treturn attrib;\n\t\t}));\n\t}\n\tif (\"type\" in data && typeof data.type === \"string\") {\n\t\tif (vertexFormats.includes(data.type)) return {\n\t\t\t_layout: layout,\n\t\t\tformat: data.type,\n\t\t\toffset\n\t\t};\n\t\tconst format = kindToDefaultFormatMap[data.type];\n\t\tif (format) return {\n\t\t\t_layout: layout,\n\t\t\tformat,\n\t\t\toffset\n\t\t};\n\t}\n\tthrow new Error(`Unsupported data used in vertex layout: ${String(data)}`);\n}\nvar TgpuVertexLayoutImpl = class {\n\t[$internal] = true;\n\tresourceType = \"vertex-layout\";\n\tstride;\n\tattrib;\n\t_customLocationMap = {};\n\tconstructor(schemaForCount, stepMode) {\n\t\tthis.schemaForCount = schemaForCount;\n\t\tthis.stepMode = stepMode;\n\t\tconst arraySchema = schemaForCount(0);\n\t\tthis.stride = roundUp(sizeOf(arraySchema.elementType), alignmentOf(arraySchema));\n\t\tthis.attrib = dataToContainedAttribs(this, arraySchema.elementType, 0, this._customLocationMap);\n\t}\n\tget vertexLayout() {\n\t\tif (this._customLocationMap[defaultAttribEntry] !== void 0) {\n\t\t\tif (typeof this.attrib.format !== \"string\" || typeof this.attrib.offset !== \"number\") throw new Error(\"Single attribute vertex layouts must have a format and offset.\");\n\t\t\treturn {\n\t\t\t\tarrayStride: this.stride,\n\t\t\t\tstepMode: this.stepMode,\n\t\t\t\tattributes: [{\n\t\t\t\t\tformat: this.attrib.format,\n\t\t\t\t\toffset: this.attrib.offset,\n\t\t\t\t\tshaderLocation: this._customLocationMap[defaultAttribEntry]\n\t\t\t\t}]\n\t\t\t};\n\t\t}\n\t\tif (!Object.keys(this.attrib).every((key) => this._customLocationMap[key] !== void 0)) throw new Error(\"All attributes must have custom locations in order to unwrap a vertex layout.\");\n\t\treturn {\n\t\t\tarrayStride: this.stride,\n\t\t\tstepMode: this.stepMode,\n\t\t\tattributes: Object.entries(this.attrib).map(([key, attrib]) => ({\n\t\t\t\tformat: attrib.format,\n\t\t\t\toffset: attrib.offset,\n\t\t\t\tshaderLocation: this._customLocationMap[key]\n\t\t\t}))\n\t\t};\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n};\n\n//#endregion\nexport { isVertexLayout, vertexLayout };","import { $internal } from \"./shared/symbols.js\";\nimport { bool, f32, u32 } from \"./data/numeric.js\";\nimport { vec3u, vec4f } from \"./data/vector.js\";\nimport { attribute } from \"./data/attributes.js\";\nimport { arrayOf } from \"./data/array.js\";\n\n//#region src/builtin.ts\nfunction defineBuiltin(dataType, value) {\n\treturn attribute(dataType, {\n\t\t[$internal]: true,\n\t\ttype: \"@builtin\",\n\t\tparams: [value]\n\t});\n}\nconst builtin = {\n\tvertexIndex: defineBuiltin(u32, \"vertex_index\"),\n\tinstanceIndex: defineBuiltin(u32, \"instance_index\"),\n\tclipDistances: defineBuiltin(arrayOf(u32, 8), \"clip_distances\"),\n\tposition: defineBuiltin(vec4f, \"position\"),\n\tfrontFacing: defineBuiltin(bool, \"front_facing\"),\n\tfragDepth: defineBuiltin(f32, \"frag_depth\"),\n\tprimitiveIndex: defineBuiltin(u32, \"primitive_index\"),\n\tsampleIndex: defineBuiltin(u32, \"sample_index\"),\n\tsampleMask: defineBuiltin(u32, \"sample_mask\"),\n\tlocalInvocationId: defineBuiltin(vec3u, \"local_invocation_id\"),\n\tlocalInvocationIndex: defineBuiltin(u32, \"local_invocation_index\"),\n\tglobalInvocationId: defineBuiltin(vec3u, \"global_invocation_id\"),\n\tworkgroupId: defineBuiltin(vec3u, \"workgroup_id\"),\n\tnumWorkgroups: defineBuiltin(vec3u, \"num_workgroups\"),\n\tsubgroupInvocationId: defineBuiltin(u32, \"subgroup_invocation_id\"),\n\tsubgroupSize: defineBuiltin(u32, \"subgroup_size\"),\n\tsubgroupId: defineBuiltin(u32, \"subgroup_id\"),\n\tnumSubgroups: defineBuiltin(u32, \"num_subgroups\")\n};\n\n//#endregion\nexport { builtin };","import { $internal } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\n\n//#region src/core/querySet/querySet.ts\nfunction INTERNAL_createQuerySet(group, type, count, rawQuerySet) {\n\treturn new TgpuQuerySetImpl(group, type, count, rawQuerySet);\n}\nfunction isQuerySet(value) {\n\tconst maybe = value;\n\treturn maybe?.resourceType === \"query-set\" && !!maybe[$internal];\n}\nvar TgpuQuerySetImpl = class {\n\tresourceType = \"query-set\";\n\t#device;\n\t_querySet = null;\n\t_ownQuerySet;\n\t_destroyed = false;\n\t_available = true;\n\t_readBuffer = null;\n\t_resolveBuffer = null;\n\tconstructor(root, type, count, rawQuerySet) {\n\t\tthis.type = type;\n\t\tthis.count = count;\n\t\tthis.rawQuerySet = rawQuerySet;\n\t\tthis.#device = root.device;\n\t\tthis._ownQuerySet = !rawQuerySet;\n\t\tthis._querySet = rawQuerySet || null;\n\t}\n\tget querySet() {\n\t\tif (this._destroyed) throw new Error(\"This QuerySet has been destroyed.\");\n\t\tif (this.rawQuerySet) return this.rawQuerySet;\n\t\tif (this._querySet) return this._querySet;\n\t\tthis._querySet = this.#device.createQuerySet({\n\t\t\ttype: this.type,\n\t\t\tcount: this.count\n\t\t});\n\t\treturn this._querySet;\n\t}\n\tget destroyed() {\n\t\treturn this._destroyed;\n\t}\n\tget available() {\n\t\treturn this._available;\n\t}\n\tget [$internal]() {\n\t\tconst self = this;\n\t\treturn {\n\t\t\tget readBuffer() {\n\t\t\t\tif (!self._readBuffer) self._readBuffer = self.#device.createBuffer({\n\t\t\t\t\tsize: self.count * BigUint64Array.BYTES_PER_ELEMENT,\n\t\t\t\t\tusage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ\n\t\t\t\t});\n\t\t\t\treturn self._readBuffer;\n\t\t\t},\n\t\t\tget resolveBuffer() {\n\t\t\t\tif (!self._resolveBuffer) self._resolveBuffer = self.#device.createBuffer({\n\t\t\t\t\tsize: self.count * BigUint64Array.BYTES_PER_ELEMENT,\n\t\t\t\t\tusage: GPUBufferUsage.QUERY_RESOLVE | GPUBufferUsage.COPY_SRC\n\t\t\t\t});\n\t\t\t\treturn self._resolveBuffer;\n\t\t\t}\n\t\t};\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\tif (this._querySet) this._querySet.label = label;\n\t\treturn this;\n\t}\n\tresolve() {\n\t\tif (this._destroyed) throw new Error(\"This QuerySet has been destroyed.\");\n\t\tif (!this._available) throw new Error(\"This QuerySet is busy resolving or reading.\");\n\t\tconst commandEncoder = this.#device.createCommandEncoder();\n\t\tcommandEncoder.resolveQuerySet(this.querySet, 0, this.count, this[$internal].resolveBuffer, 0);\n\t\tthis.#device.queue.submit([commandEncoder.finish()]);\n\t}\n\tasync read() {\n\t\tif (!this._resolveBuffer) throw new Error(\"QuerySet must be resolved before reading.\");\n\t\tthis._available = false;\n\t\ttry {\n\t\t\tconst commandEncoder = this.#device.createCommandEncoder();\n\t\t\tcommandEncoder.copyBufferToBuffer(this[$internal].resolveBuffer, 0, this[$internal].readBuffer, 0, this.count * BigUint64Array.BYTES_PER_ELEMENT);\n\t\t\tthis.#device.queue.submit([commandEncoder.finish()]);\n\t\t\tconst readBuffer = this[$internal].readBuffer;\n\t\t\tawait readBuffer.mapAsync(GPUMapMode.READ);\n\t\t\tconst data = new BigUint64Array(readBuffer.getMappedRange().slice());\n\t\t\treadBuffer.unmap();\n\t\t\treturn Array.from(data);\n\t\t} finally {\n\t\t\tthis._available = true;\n\t\t}\n\t}\n\tdestroy() {\n\t\tif (this._destroyed) return;\n\t\tthis._destroyed = true;\n\t\tif (this._querySet && this._ownQuerySet) this._querySet.destroy();\n\t\tthis._readBuffer?.destroy();\n\t\tthis._resolveBuffer?.destroy();\n\t\tthis._readBuffer = this._resolveBuffer = null;\n\t}\n};\n\n//#endregion\nexport { INTERNAL_createQuerySet, isQuerySet };","//#region src/memo.ts\n/**\n* Caches results of the function passed in as\n* the argument to the constructor.\n*\n* If the key can be garbage collected, it will be.\n*/\nvar WeakMemo = class {\n\t_map = /* @__PURE__ */ new WeakMap();\n\tconstructor(_make) {\n\t\tthis._make = _make;\n\t}\n\tgetOrMake(key, ...args) {\n\t\tif (this._map.has(key)) return this._map.get(key);\n\t\tconst value = this._make(key, ...args);\n\t\tthis._map.set(key, value);\n\t\treturn value;\n\t}\n};\n\n//#endregion\nexport { WeakMemo };","//#region src/core/pipeline/limitsOverflow.ts\nfunction warnIfOverflow(layouts, limits) {\n\tconst entries = Object.values(layouts).flatMap((layout) => Object.values(layout.entries)).filter((entry) => entry !== null);\n\tconst uniform = entries.filter((entry) => \"uniform\" in entry).length;\n\tconst storage = entries.filter((entry) => \"storage\" in entry).length;\n\tif (uniform > limits.maxUniformBuffersPerShaderStage) console.warn(`Total number of uniform buffers (${uniform}) exceeds maxUniformBuffersPerShaderStage (${limits.maxUniformBuffersPerShaderStage}). Consider:\n1. Grouping some of the uniforms into one using 'd.struct',\n2. Increasing the limit when requesting a device or creating a root.`);\n\tif (storage > limits.maxStorageBuffersPerShaderStage) console.warn(`Total number of storage buffers (${storage}) exceeds maxStorageBuffersPerShaderStage (${limits.maxStorageBuffersPerShaderStage}).`);\n}\n\n//#endregion\nexport { warnIfOverflow };","import { MissingBindGroupsError, MissingVertexBuffersError } from \"../../errors.js\";\nimport { isBuffer } from \"../buffer/buffer.js\";\nimport { isBindGroup } from \"../../tgpuBindGroupLayout.js\";\nimport { warnIfOverflow } from \"./limitsOverflow.js\";\n\n//#region src/core/pipeline/applyPipelineState.ts\nfunction applyBindGroups(encoder, root, usedBindGroupLayouts, catchall, resolveBindGroup) {\n\tconst missingBindGroups = new Set(usedBindGroupLayouts);\n\twarnIfOverflow(usedBindGroupLayouts, root.device.limits);\n\tusedBindGroupLayouts.forEach((layout, idx) => {\n\t\tif (catchall && idx === catchall[0]) {\n\t\t\tencoder.setBindGroup(idx, root.unwrap(catchall[1]));\n\t\t\tmissingBindGroups.delete(layout);\n\t\t} else {\n\t\t\tconst bindGroup = resolveBindGroup(layout);\n\t\t\tif (bindGroup !== void 0) {\n\t\t\t\tmissingBindGroups.delete(layout);\n\t\t\t\tif (isBindGroup(bindGroup)) encoder.setBindGroup(idx, root.unwrap(bindGroup));\n\t\t\t\telse encoder.setBindGroup(idx, bindGroup);\n\t\t\t}\n\t\t}\n\t});\n\tif (missingBindGroups.size > 0) throw new MissingBindGroupsError(missingBindGroups);\n}\nfunction applyVertexBuffers(encoder, root, usedVertexLayouts, resolveVertexBuffer) {\n\tconst missingVertexLayouts = /* @__PURE__ */ new Set();\n\tusedVertexLayouts.forEach((vertexLayout, idx) => {\n\t\tconst entry = resolveVertexBuffer(vertexLayout);\n\t\tif (!entry || !entry.buffer) missingVertexLayouts.add(vertexLayout);\n\t\telse if (isBuffer(entry.buffer)) encoder.setVertexBuffer(idx, root.unwrap(entry.buffer), entry.offset, entry.size);\n\t\telse encoder.setVertexBuffer(idx, entry.buffer, entry.offset, entry.size);\n\t});\n\tif (missingVertexLayouts.size > 0) throw new MissingVertexBuffersError(missingVertexLayouts);\n}\n\n//#endregion\nexport { applyBindGroups, applyVertexBuffers };","import { isVec } from \"../data/wgslTypes.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { unify } from \"../tgsl/conversion.js\";\nimport { f32, i32, u32 } from \"../data/numeric.js\";\nimport { vec2f, vec2i, vec3f, vec3i, vec4f, vec4i } from \"../data/vector.js\";\nimport { dualImpl } from \"../core/function/dualImpl.js\";\nimport { bitcastU32toF32Impl, bitcastU32toI32Impl } from \"../data/numberOps.js\";\nimport { VectorOps } from \"../data/vectorOps.js\";\n\n//#region src/std/bitcast.ts\nconst bitcastU32toF32 = dualImpl({\n\tname: \"bitcastU32toF32\",\n\tnormalImpl: ((value) => {\n\t\tif (typeof value === \"number\") return bitcastU32toF32Impl(value);\n\t\treturn VectorOps.bitcastU32toF32[value.kind](value);\n\t}),\n\tcodegenImpl: (_ctx, [n]) => stitch`bitcast<f32>(${n})`,\n\tsignature: (...arg) => {\n\t\tconst uargs = unify(arg, [u32]) ?? arg;\n\t\treturn {\n\t\t\targTypes: uargs,\n\t\t\treturnType: isVec(uargs[0]) ? uargs[0].type === \"vec2u\" ? vec2f : uargs[0].type === \"vec3u\" ? vec3f : vec4f : f32\n\t\t};\n\t}\n});\nconst bitcastU32toI32 = dualImpl({\n\tname: \"bitcastU32toI32\",\n\tnormalImpl: ((value) => {\n\t\tif (typeof value === \"number\") return bitcastU32toI32Impl(value);\n\t\treturn VectorOps.bitcastU32toI32[value.kind](value);\n\t}),\n\tcodegenImpl: (_ctx, [n]) => stitch`bitcast<i32>(${n})`,\n\tsignature: (...arg) => {\n\t\tconst uargs = unify(arg, [u32]) ?? arg;\n\t\treturn {\n\t\t\targTypes: uargs,\n\t\t\treturnType: isVec(uargs[0]) ? uargs[0].type === \"vec2u\" ? vec2i : uargs[0].type === \"vec3u\" ? vec3i : vec4i : i32\n\t\t};\n\t}\n});\n\n//#endregion\nexport { bitcastU32toF32, bitcastU32toI32 };","import { stitch } from \"../core/resolve/stitch.js\";\nimport { u32 } from \"../data/numeric.js\";\nimport { vec2f, vec4f } from \"../data/vector.js\";\nimport { dualImpl } from \"../core/function/dualImpl.js\";\nimport * as TB from \"typed-binary\";\n\n//#region src/std/packing.ts\n/**\n* @privateRemarks\n* https://gpuweb.github.io/gpuweb/wgsl/#unpack2x16float-builtin\n*/\nconst unpack2x16float = dualImpl({\n\tname: \"unpack2x16float\",\n\tnormalImpl: (e) => {\n\t\tconst buffer = /* @__PURE__ */ new ArrayBuffer(4);\n\t\tnew TB.BufferWriter(buffer).writeUint32(e);\n\t\tconst reader = new TB.BufferReader(buffer);\n\t\treturn vec2f(reader.readFloat16(), reader.readFloat16());\n\t},\n\tsignature: {\n\t\targTypes: [u32],\n\t\treturnType: vec2f\n\t},\n\tcodegenImpl: (_ctx, [e]) => stitch`unpack2x16float(${e})`\n});\n/**\n* @privateRemarks\n* https://gpuweb.github.io/gpuweb/wgsl/#pack2x16float-builtin\n*/\nconst pack2x16float = dualImpl({\n\tname: \"pack2x16float\",\n\tnormalImpl: (e) => {\n\t\tconst buffer = /* @__PURE__ */ new ArrayBuffer(4);\n\t\tconst writer = new TB.BufferWriter(buffer);\n\t\twriter.writeFloat16(e.x);\n\t\twriter.writeFloat16(e.y);\n\t\treturn u32(new TB.BufferReader(buffer).readUint32());\n\t},\n\tsignature: {\n\t\targTypes: [vec2f],\n\t\treturnType: u32\n\t},\n\tcodegenImpl: (_ctx, [e]) => stitch`pack2x16float(${e})`\n});\n/**\n* @privateRemarks\n* https://gpuweb.github.io/gpuweb/wgsl/#unpack4x8unorm-builtin\n*/\nconst unpack4x8unorm = dualImpl({\n\tname: \"unpack4x8unorm\",\n\tnormalImpl: (e) => {\n\t\tconst buffer = /* @__PURE__ */ new ArrayBuffer(4);\n\t\tnew TB.BufferWriter(buffer).writeUint32(e);\n\t\tconst reader = new TB.BufferReader(buffer);\n\t\treturn vec4f(reader.readUint8() / 255, reader.readUint8() / 255, reader.readUint8() / 255, reader.readUint8() / 255);\n\t},\n\tsignature: {\n\t\targTypes: [u32],\n\t\treturnType: vec4f\n\t},\n\tcodegenImpl: (_ctx, [e]) => stitch`unpack4x8unorm(${e})`\n});\n/**\n* @privateRemarks\n* https://gpuweb.github.io/gpuweb/wgsl/#pack4x8unorm-builtin\n*/\nconst pack4x8unorm = dualImpl({\n\tname: \"pack4x8unorm\",\n\tnormalImpl: (e) => {\n\t\tconst buffer = /* @__PURE__ */ new ArrayBuffer(4);\n\t\tconst writer = new TB.BufferWriter(buffer);\n\t\twriter.writeUint8(e.x * 255);\n\t\twriter.writeUint8(e.y * 255);\n\t\twriter.writeUint8(e.z * 255);\n\t\twriter.writeUint8(e.w * 255);\n\t\treturn u32(new TB.BufferReader(buffer).readUint32());\n\t},\n\tsignature: {\n\t\targTypes: [vec4f],\n\t\treturnType: u32\n\t},\n\tcodegenImpl: (_ctx, [e]) => stitch`pack4x8unorm(${e})`\n});\n\n//#endregion\nexport { pack2x16float, pack4x8unorm, unpack2x16float, unpack4x8unorm };","import { isWgslArray, isWgslData, isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { niceStringify } from \"../../shared/stringify.js\";\nimport { vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u } from \"../../data/vector.js\";\nimport { sizeOf } from \"../../data/sizeOf.js\";\nimport { mat2x2f, mat3x3f, mat4x4f } from \"../../data/matrix.js\";\nimport { bitcastU32toF32, bitcastU32toI32 } from \"../../std/bitcast.js\";\nimport { unpack2x16float } from \"../../std/packing.js\";\n\n//#region src/tgsl/consoleLog/deserializers.ts\nconst toF = (n) => bitcastU32toF32(n ?? 0);\nconst toI = (n) => bitcastU32toI32(n ?? 0);\nconst unpack = (n) => unpack2x16float(n ?? 0);\nconst deserializerMap = {\n\tf32: (d) => toF(d[0]),\n\tf16: (d) => unpack(d[0]).x,\n\ti32: (d) => toI(d[0]),\n\tu32: (d) => d[0] ?? 0,\n\tbool: (d) => !!d[0],\n\tvec2f: (d) => vec2f(toF(d[0]), toF(d[1])),\n\tvec3f: (d) => vec3f(toF(d[0]), toF(d[1]), toF(d[2])),\n\tvec4f: (d) => vec4f(toF(d[0]), toF(d[1]), toF(d[2]), toF(d[3])),\n\tvec2h(d) {\n\t\tconst xyVec = unpack(d[0]);\n\t\treturn vec2h(xyVec.x, xyVec.y);\n\t},\n\tvec3h(d) {\n\t\tconst xyVec = unpack(d[0]);\n\t\tconst zVec = unpack(d[1]);\n\t\treturn vec3h(xyVec.x, xyVec.y, zVec.x);\n\t},\n\tvec4h(d) {\n\t\tconst xyVec = unpack(d[0]);\n\t\tconst zwVec = unpack(d[1]);\n\t\treturn vec4h(xyVec.x, xyVec.y, zwVec.x, zwVec.y);\n\t},\n\tvec2i: (d) => vec2i(toI(d[0]), toI(d[1])),\n\tvec3i: (d) => vec3i(toI(d[0]), toI(d[1]), toI(d[2])),\n\tvec4i: (d) => vec4i(toI(d[0]), toI(d[1]), toI(d[2]), toI(d[3])),\n\tvec2u: (d) => vec2u(d[0] ?? 0, d[1] ?? 0),\n\tvec3u: (d) => vec3u(d[0] ?? 0, d[1] ?? 0, d[2] ?? 0),\n\tvec4u: (d) => vec4u(d[0] ?? 0, d[1] ?? 0, d[2] ?? 0, d[3] ?? 0),\n\t\"vec2<bool>\": (d) => vec2b(!!d[0], !!d[1]),\n\t\"vec3<bool>\": (d) => vec3b(!!d[0], !!d[1], !!d[2]),\n\t\"vec4<bool>\": (d) => vec4b(!!d[0], !!d[1], !!d[2], !!d[3]),\n\tmat2x2f: (d) => mat2x2f(toF(d[0]), toF(d[1]), toF(d[2]), toF(d[3])),\n\tmat3x3f: (d) => mat3x3f(toF(d[0]), toF(d[1]), toF(d[2]), toF(d[4]), toF(d[5]), toF(d[6]), toF(d[8]), toF(d[9]), toF(d[10])),\n\tmat4x4f: (d) => mat4x4f(toF(d[0]), toF(d[1]), toF(d[2]), toF(d[3]), toF(d[4]), toF(d[5]), toF(d[6]), toF(d[7]), toF(d[8]), toF(d[9]), toF(d[10]), toF(d[11]), toF(d[12]), toF(d[13]), toF(d[14]), toF(d[15]))\n};\n/**\n* Deserializes binary data from a Uint32Array into a JavaScript value based on the provided WGSL data type.\n*\n* @param data - The binary data as a Uint32Array to be deserialized\n* @param dataType - The WGSL data type specification that determines how to interpret the binary data\n*/\nfunction deserialize(data, dataType) {\n\tconst maybeDeserializer = deserializerMap[dataType.type];\n\tif (maybeDeserializer) return maybeDeserializer(data);\n\tif (isWgslStruct(dataType)) {\n\t\tconst props = Object.keys(dataType.propTypes);\n\t\tconst decodedProps = deserializeCompound(data, Object.values(dataType.propTypes));\n\t\treturn Object.fromEntries(props.map((key, index) => [key, decodedProps[index]]));\n\t}\n\tif (isWgslArray(dataType)) {\n\t\tconst elementType = dataType.elementType;\n\t\tconst length = dataType.elementCount;\n\t\treturn deserializeCompound(data, Array.from({ length }, () => elementType));\n\t}\n\tthrow new Error(`Cannot deserialize data of type ${dataType.type}`);\n}\n/**\n* Deserializes a list of elements from a Uint32Array buffer using provided type information.\n* If there is a string value among the type information, it is returned as is.\n*\n* @param data - The Uint32Array buffer containing the serialized data\n* @param dataTypes - The WGSL data type specification that determines how to interpret the binary data, or string literals\n*/\nfunction deserializeCompound(data, dataTypes) {\n\tlet index = 0;\n\treturn dataTypes.map((info) => {\n\t\tif (!isWgslData(info)) return info;\n\t\tconst size = Math.ceil(sizeOf(info) / 4);\n\t\tconst value = deserialize(data.subarray(index, index + size), info);\n\t\tindex += size;\n\t\treturn value;\n\t});\n}\nfunction deserializeAndStringify(serializedData, argTypes) {\n\treturn deserializeCompound(serializedData, argTypes).map(niceStringify);\n}\n/**\n* Reads and deserializes log data from GPU buffers, logging results to the console.\n*\n* @remarks\n* - Log entries with IDs equal to 0 are filtered out.\n* - Console messages are prepended with options.messagePrefix styled with purple background and white text.\n* - A warning is displayed if the log count exceeds the limit passed in options.\n* - After processing, the index buffer and the data buffer are cleared.\n*/\nfunction logDataFromGPU(resources) {\n\tconst { indexBuffer, dataBuffer, logIdToMeta, options } = resources;\n\tdataBuffer.read().then((data) => {\n\t\tdata.filter((e) => e.id).forEach(({ id, serializedData }) => {\n\t\t\tconst { argTypes, op } = logIdToMeta.get(id);\n\t\t\tconst results = deserializeAndStringify(new Uint32Array(serializedData), argTypes);\n\t\t\tif (results.length === 0) results.push(\"\");\n\t\t\tconsole[op](`%c${options.messagePrefix}%c ${results[0]}`, \"background: #936ff5; color: white;\", \"color: inherit; background: none\", ...results.slice(1));\n\t\t});\n\t});\n\tindexBuffer.read().then((totalCalls) => {\n\t\tif (totalCalls > options.logCountLimit) console.warn(`Log count limit per dispatch (${options.logCountLimit}) exceeded by ${totalCalls - options.logCountLimit} calls. Consider increasing the limit by passing appropriate options to tgpu.init().`);\n\t});\n\tdataBuffer.buffer.clear();\n\tindexBuffer.buffer.clear();\n}\n\n//#endregion\nexport { logDataFromGPU };","//#region src/wgslExtensions.ts\nconst wgslExtensions = [\n\t\"f16\",\n\t\"clip_distances\",\n\t\"dual_source_blending\",\n\t\"subgroups\",\n\t\"primitive_index\"\n];\nconst wgslExtensionToFeatureName = {\n\tf16: \"shader-f16\",\n\tclip_distances: \"clip-distances\",\n\tdual_source_blending: \"dual-source-blending\",\n\tsubgroups: \"subgroups\",\n\tprimitive_index: \"primitive-index\"\n};\n\n//#endregion\nexport { wgslExtensionToFeatureName, wgslExtensions };","import { getLayoutInfo } from \"./schemaMemoryLayout.js\";\n\n//#region src/data/isContiguous.ts\nfunction isContiguous(schema) {\n\treturn getLayoutInfo(schema, \"isContiguous\");\n}\n/**\n* Returns `true` if data represented by the `schema` doesn't have padding.\n*/\nfunction PUBLIC_isContiguous(schema) {\n\treturn isContiguous(schema);\n}\n\n//#endregion\nexport { PUBLIC_isContiguous, isContiguous };","import { getLayoutInfo } from \"./schemaMemoryLayout.js\";\n\n//#region src/data/getLongestContiguousPrefix.ts\nfunction getLongestContiguousPrefix(schema) {\n\treturn getLayoutInfo(schema, \"longestContiguousPrefix\");\n}\n/**\n* Returns the size (in bytes) of the longest contiguous memory prefix of data represented by the `schema`.\n*/\nfunction PUBLIC_getLongestContiguousPrefix(schema) {\n\treturn getLongestContiguousPrefix(schema);\n}\n\n//#endregion\nexport { PUBLIC_getLongestContiguousPrefix, getLongestContiguousPrefix };","import { isVec, isWgslArray, isWgslStruct } from \"./wgslTypes.js\";\nimport { undecorate } from \"./dataTypes.js\";\nimport { alignmentOf } from \"./alignmentOf.js\";\nimport { roundUp } from \"../mathUtils.js\";\nimport { sizeOf } from \"./sizeOf.js\";\nimport { offsetsForProps } from \"./offsets.js\";\nimport { isContiguous } from \"./isContiguous.js\";\nimport { getLongestContiguousPrefix } from \"./getLongestContiguousPrefix.js\";\n\n//#region src/data/offsetUtils.ts\nconst OFFSET_MARKER = Symbol(\"indirectOffset\");\nconst CONTIGUOUS_MARKER = Symbol(\"indirectContiguous\");\nfunction isOffsetProxy(value) {\n\treturn typeof value === \"object\" && value !== null && OFFSET_MARKER in value && CONTIGUOUS_MARKER in value;\n}\nfunction scalarNode(offset, contiguous) {\n\treturn {\n\t\t[OFFSET_MARKER]: offset,\n\t\t[CONTIGUOUS_MARKER]: contiguous\n\t};\n}\nfunction getMarker(target, prop) {\n\tif (prop === OFFSET_MARKER) return target[OFFSET_MARKER];\n\tif (prop === CONTIGUOUS_MARKER) return target[CONTIGUOUS_MARKER];\n}\nfunction makeProxy(schema, baseOffset, contiguous = sizeOf(schema)) {\n\tconst unwrapped = undecorate(schema);\n\tconst vecComponentCount = isVec(unwrapped) ? unwrapped.componentCount : void 0;\n\tif (vecComponentCount !== void 0) {\n\t\tconst componentSize = sizeOf(unwrapped.primitive);\n\t\treturn makeVecProxy(scalarNode(baseOffset, contiguous), componentSize, vecComponentCount);\n\t}\n\tif (isWgslStruct(unwrapped)) return makeStructProxy(unwrapped, scalarNode(baseOffset, contiguous));\n\tif (isWgslArray(unwrapped)) return makeArrayProxy(unwrapped, scalarNode(baseOffset, contiguous));\n\treturn scalarNode(baseOffset, contiguous);\n}\nfunction createOffsetProxy(schema, baseOffset = 0) {\n\treturn makeProxy(schema, baseOffset, sizeOf(schema));\n}\nfunction makeVecProxy(target, componentSize, componentCount) {\n\tconst baseOffset = target[OFFSET_MARKER];\n\treturn new Proxy(target, { get(t, prop) {\n\t\tconst marker = getMarker(t, prop);\n\t\tif (marker !== void 0) return marker;\n\t\tconst idx = prop === \"x\" || prop === \"0\" ? 0 : prop === \"y\" || prop === \"1\" ? 1 : prop === \"z\" || prop === \"2\" ? 2 : prop === \"w\" || prop === \"3\" ? 3 : -1;\n\t\tif (idx < 0 || idx >= componentCount) return;\n\t\tconst byteOffset = idx * componentSize;\n\t\tconst contiguous = Math.max(0, t[CONTIGUOUS_MARKER] - byteOffset);\n\t\treturn scalarNode(baseOffset + byteOffset, contiguous);\n\t} });\n}\nfunction makeArrayProxy(array, target) {\n\tconst elementType = array.elementType;\n\tconst elementSize = sizeOf(elementType);\n\tconst stride = roundUp(elementSize, alignmentOf(elementType));\n\tconst hasPadding = stride > elementSize;\n\treturn new Proxy(target, { get(t, prop) {\n\t\tconst marker = getMarker(t, prop);\n\t\tif (marker !== void 0) return marker;\n\t\tif (prop === \"length\") return array.elementCount;\n\t\tif (typeof prop !== \"string\") return;\n\t\tconst index = Number(prop);\n\t\tif (!Number.isInteger(index) || index < 0 || index >= array.elementCount) return;\n\t\tconst elementOffset = index * stride;\n\t\tconst remainingFromHere = !isContiguous(elementType) ? elementSize + getLongestContiguousPrefix(elementType) : Math.max(0, t[CONTIGUOUS_MARKER] - elementOffset);\n\t\tconst childContiguous = hasPadding ? Math.min(remainingFromHere, elementSize) : remainingFromHere;\n\t\treturn makeProxy(elementType, t[OFFSET_MARKER] + elementOffset, childContiguous);\n\t} });\n}\nfunction makeStructProxy(struct, target) {\n\tconst offsets = offsetsForProps(struct);\n\tconst propTypes = struct.propTypes;\n\tconst propNames = Object.keys(propTypes);\n\tconst meta = /* @__PURE__ */ new Map();\n\tlet runStart = 0;\n\tfor (let i = 0; i < propNames.length; i++) {\n\t\tconst name = propNames[i];\n\t\tif (!name) continue;\n\t\tconst type = propTypes[name];\n\t\tif (!type) continue;\n\t\tconst info = offsets[name];\n\t\tconst padding = info.padding ?? 0;\n\t\tconst typeContiguous = isContiguous(type);\n\t\tif (!(i === propNames.length - 1 || padding > 0 || !typeContiguous)) continue;\n\t\tconst runEnd = info.offset + (typeContiguous ? info.size : getLongestContiguousPrefix(type));\n\t\tfor (let j = runStart; j <= i; j++) {\n\t\t\tconst runName = propNames[j];\n\t\t\tif (!runName) continue;\n\t\t\tconst runInfo = offsets[runName];\n\t\t\tmeta.set(runName, {\n\t\t\t\toffset: runInfo.offset,\n\t\t\t\trunEnd\n\t\t\t});\n\t\t}\n\t\trunStart = i + 1;\n\t}\n\treturn new Proxy(target, { get(t, prop) {\n\t\tconst marker = getMarker(t, prop);\n\t\tif (marker !== void 0) return marker;\n\t\tif (typeof prop !== \"string\") return;\n\t\tconst m = meta.get(prop);\n\t\tif (!m) return;\n\t\tconst remainingFromHere = Math.max(0, t[CONTIGUOUS_MARKER] - m.offset);\n\t\tconst localLimit = Math.max(0, m.runEnd - m.offset);\n\t\tconst propSchema = propTypes[prop];\n\t\tif (!propSchema) return;\n\t\treturn makeProxy(propSchema, t[OFFSET_MARKER] + m.offset, sizeOf(struct) === m.runEnd ? remainingFromHere : localLimit);\n\t} });\n}\nfunction getRootContiguous(schema) {\n\tconst unwrapped = undecorate(schema);\n\tif (isWgslStruct(unwrapped)) {\n\t\tconst offsets = offsetsForProps(unwrapped);\n\t\tconst propTypes = unwrapped.propTypes;\n\t\tconst propNames = Object.keys(propTypes);\n\t\tfor (let i = 0; i < propNames.length; i++) {\n\t\t\tconst name = propNames[i];\n\t\t\tif (!name) continue;\n\t\t\tconst info = offsets[name];\n\t\t\tconst padding = info.padding ?? 0;\n\t\t\tconst runEnd = info.offset + info.size;\n\t\t\tif (i === propNames.length - 1 || padding > 0) return runEnd;\n\t\t}\n\t\treturn 0;\n\t}\n\tif (isWgslArray(unwrapped)) {\n\t\tconst elementType = unwrapped.elementType;\n\t\tconst elementSize = sizeOf(elementType);\n\t\tconst stride = roundUp(elementSize, alignmentOf(elementType));\n\t\tconst totalSize = sizeOf(schema);\n\t\tif (!Number.isFinite(totalSize)) return elementSize;\n\t\treturn stride > elementSize ? elementSize : totalSize;\n\t}\n\treturn sizeOf(schema);\n}\n/**\n* A function that retrieves offset and information for a specific primitive within a data schema.\n* Example usage:\n* ```ts\n* const Boid = d.struct({\n* position: d.vec3f,\n* velocity: d.vec3f,\n* });\n* const memLayout = d.memoryLayoutOf(Boid, (b) => b.velocity.y);\n* console.log(memLayout.offset); // Byte offset of velocity.y within Boid (here 20 bytes)\n* console.log(memLayout.contiguous); // Contiguous bytes available from that offset (here 8 bytes)\n* ```\n*\n* @param schema - The data schema to analyze.\n* @param accessor - Optional function that accesses a specific primitive within the schema. If omitted, uses the root offset (0).\n* @returns An object containing the offset and contiguous byte information.\n*/\nfunction memoryLayoutOf(schema, accessor) {\n\tif (!accessor) return {\n\t\toffset: 0,\n\t\tcontiguous: getRootContiguous(schema)\n\t};\n\tconst result = accessor(createOffsetProxy(schema));\n\tif (isOffsetProxy(result)) return {\n\t\toffset: result[OFFSET_MARKER],\n\t\tcontiguous: result[CONTIGUOUS_MARKER]\n\t};\n\tthrow new Error(\"Invalid accessor result. Expected an offset proxy with markers.\");\n}\n\n//#endregion\nexport { memoryLayoutOf };","import { $internal } from \"../../shared/symbols.js\";\nimport { isQuerySet } from \"../querySet/querySet.js\";\n\n//#region src/core/pipeline/timeable.ts\nfunction createWithPerformanceCallback(currentPriors, callback, root) {\n\tif (!root.enabledFeatures.has(\"timestamp-query\")) throw new Error(\"Performance callback requires the \\\"timestamp-query\\\" feature to be enabled on GPU device.\");\n\tif (!currentPriors.timestampWrites) return {\n\t\t...currentPriors,\n\t\tperformanceCallback: callback,\n\t\thasAutoQuerySet: true,\n\t\ttimestampWrites: {\n\t\t\tquerySet: root.createQuerySet(\"timestamp\", 2),\n\t\t\tbeginningOfPassWriteIndex: 0,\n\t\t\tendOfPassWriteIndex: 1\n\t\t}\n\t};\n\treturn {\n\t\t...currentPriors,\n\t\tperformanceCallback: callback\n\t};\n}\nfunction createWithTimestampWrites(currentPriors, options, root) {\n\tif (!root.enabledFeatures.has(\"timestamp-query\")) throw new Error(\"Timestamp writes require the \\\"timestamp-query\\\" feature to be enabled on GPU device.\");\n\tif (currentPriors.hasAutoQuerySet && currentPriors.timestampWrites) currentPriors.timestampWrites.querySet.destroy();\n\tconst timestampWrites = { querySet: options.querySet };\n\tif (options.beginningOfPassWriteIndex !== void 0) timestampWrites.beginningOfPassWriteIndex = options.beginningOfPassWriteIndex;\n\tif (options.endOfPassWriteIndex !== void 0) timestampWrites.endOfPassWriteIndex = options.endOfPassWriteIndex;\n\treturn {\n\t\t...currentPriors,\n\t\thasAutoQuerySet: false,\n\t\ttimestampWrites\n\t};\n}\nfunction setupTimestampWrites(priors, root) {\n\tif (!priors.timestampWrites) return {};\n\tconst { querySet, beginningOfPassWriteIndex, endOfPassWriteIndex } = priors.timestampWrites;\n\tconst timestampWrites = { querySet: isQuerySet(querySet) ? root.unwrap(querySet) : querySet };\n\tif (beginningOfPassWriteIndex !== void 0) timestampWrites.beginningOfPassWriteIndex = beginningOfPassWriteIndex;\n\tif (endOfPassWriteIndex !== void 0) timestampWrites.endOfPassWriteIndex = endOfPassWriteIndex;\n\treturn { timestampWrites };\n}\nfunction triggerPerformanceCallback({ root, priors }) {\n\tconst querySet = priors.timestampWrites?.querySet;\n\tconst callback = priors.performanceCallback;\n\tif (!querySet) throw new Error(\"Cannot dispatch workgroups with performance callback without a query set.\");\n\tif (!isQuerySet(querySet)) throw new Error(\"Performance callback with raw GPUQuerySet is not supported. Use TgpuQuerySet instead.\");\n\tconst commandEncoder = root.device.createCommandEncoder();\n\tcommandEncoder.resolveQuerySet(root.unwrap(querySet), 0, querySet.count, querySet[$internal].resolveBuffer, 0);\n\troot.device.queue.submit([commandEncoder.finish()]);\n\troot.device.queue.onSubmittedWorkDone().then(async () => {\n\t\tif (!querySet.available) return;\n\t\tconst result = await querySet.read();\n\t\tconst start = result[priors.timestampWrites?.beginningOfPassWriteIndex ?? 0];\n\t\tconst end = result[priors.timestampWrites?.endOfPassWriteIndex ?? 1];\n\t\tif (start === void 0 || end === void 0) throw new Error(\"QuerySet did not return valid timestamps.\");\n\t\tawait callback(start, end);\n\t});\n}\n\n//#endregion\nexport { createWithPerformanceCallback, createWithTimestampWrites, setupTimestampWrites, triggerPerformanceCallback };","import { $getNameForward, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { PERF, getName, setName } from \"../../shared/meta.js\";\nimport { Void } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { sizeOf } from \"../../data/sizeOf.js\";\nimport { namespace } from \"../resolve/namespace.js\";\nimport { isBindGroup } from \"../../tgpuBindGroupLayout.js\";\nimport { resolve } from \"../../resolutionCtx.js\";\nimport { isGPUCommandEncoder, isGPUComputePassEncoder } from \"./typeGuards.js\";\nimport { applyBindGroups } from \"./applyPipelineState.js\";\nimport { logDataFromGPU } from \"../../tgsl/consoleLog/deserializers.js\";\nimport { wgslExtensionToFeatureName, wgslExtensions } from \"../../wgslExtensions.js\";\nimport { memoryLayoutOf } from \"../../data/offsetUtils.js\";\nimport { createWithPerformanceCallback, createWithTimestampWrites, setupTimestampWrites, triggerPerformanceCallback } from \"./timeable.js\";\n\n//#region src/core/pipeline/computePipeline.ts\nfunction INTERNAL_createComputePipeline(branch, slotBindings, descriptor) {\n\treturn new TgpuComputePipelineImpl(new ComputePipelineCore(branch, slotBindings, descriptor), {});\n}\nfunction validateIndirectBufferSize(bufferSize, offset, requiredBytes, operation) {\n\tif (offset + requiredBytes > bufferSize) throw new Error(`Buffer too small for ${operation}. Required: ${requiredBytes} bytes at offset ${offset}, but buffer is only ${bufferSize} bytes.`);\n\tif (offset % 4 !== 0) throw new Error(`Indirect buffer offset must be a multiple of 4. Got: ${offset}`);\n}\nconst _lastAppliedCompute = /* @__PURE__ */ new WeakMap();\nvar TgpuComputePipelineImpl = class TgpuComputePipelineImpl {\n\t[$internal];\n\tresourceType = \"compute-pipeline\";\n\t[$getNameForward];\n\tconstructor(_core, _priors) {\n\t\tthis._core = _core;\n\t\tthis._priors = _priors;\n\t\tthis[$internal] = {\n\t\t\tget rawPipeline() {\n\t\t\t\treturn _core.unwrap().pipeline;\n\t\t\t},\n\t\t\tget priors() {\n\t\t\t\treturn _priors;\n\t\t\t},\n\t\t\tget root() {\n\t\t\t\treturn _core.root;\n\t\t\t}\n\t\t};\n\t\tthis[$getNameForward] = _core;\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.resolve(this._core);\n\t}\n\ttoString() {\n\t\treturn `computePipeline:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget rawPipeline() {\n\t\treturn this._core.unwrap().pipeline;\n\t}\n\twith(first, bindGroup) {\n\t\tif (isGPUComputePassEncoder(first)) return new TgpuComputePipelineImpl(this._core, {\n\t\t\t...this._priors,\n\t\t\texternalPass: first,\n\t\t\texternalEncoder: void 0\n\t\t});\n\t\tif (isGPUCommandEncoder(first)) return new TgpuComputePipelineImpl(this._core, {\n\t\t\t...this._priors,\n\t\t\texternalEncoder: first,\n\t\t\texternalPass: void 0\n\t\t});\n\t\tif (isBindGroup(first)) return new TgpuComputePipelineImpl(this._core, {\n\t\t\t...this._priors,\n\t\t\tbindGroupLayoutMap: new Map([...this._priors.bindGroupLayoutMap ?? [], [first.layout, first]])\n\t\t});\n\t\treturn new TgpuComputePipelineImpl(this._core, {\n\t\t\t...this._priors,\n\t\t\tbindGroupLayoutMap: new Map([...this._priors.bindGroupLayoutMap ?? [], [first, bindGroup]])\n\t\t});\n\t}\n\twithPerformanceCallback(callback) {\n\t\tconst newPriors = createWithPerformanceCallback(this._priors, callback, this._core.root);\n\t\treturn new TgpuComputePipelineImpl(this._core, newPriors);\n\t}\n\twithTimestampWrites(options) {\n\t\tconst newPriors = createWithTimestampWrites(this._priors, options, this._core.root);\n\t\treturn new TgpuComputePipelineImpl(this._core, newPriors);\n\t}\n\tdispatchWorkgroups(x, y, z) {\n\t\tthis._executeComputePass((pass) => pass.dispatchWorkgroups(x, y, z));\n\t}\n\tdispatchWorkgroupsIndirect(indirectBuffer, start) {\n\t\tconst DISPATCH_SIZE = 12;\n\t\tlet offsetInfo = start ?? memoryLayoutOf(indirectBuffer.dataType);\n\t\tif (typeof offsetInfo === \"number\") if (offsetInfo === 0) offsetInfo = memoryLayoutOf(indirectBuffer.dataType);\n\t\telse {\n\t\t\tconsole.warn(`dispatchWorkgroupsIndirect: Provided start offset ${offsetInfo} as a raw number. Use d.memoryLayoutOf(...) to include contiguous padding info for safer validation.`);\n\t\t\toffsetInfo = {\n\t\t\t\toffset: offsetInfo,\n\t\t\t\tcontiguous: DISPATCH_SIZE\n\t\t\t};\n\t\t}\n\t\tconst { offset, contiguous } = offsetInfo;\n\t\tvalidateIndirectBufferSize(sizeOf(indirectBuffer.dataType), offset, DISPATCH_SIZE, \"dispatchWorkgroupsIndirect\");\n\t\tif (contiguous < DISPATCH_SIZE) console.warn(`dispatchWorkgroupsIndirect: Starting at offset ${offset}, only ${contiguous} contiguous bytes are available before padding. Dispatch requires ${DISPATCH_SIZE} bytes (3 x u32). Reading across padding may result in undefined behavior.`);\n\t\tthis._executeComputePass((pass) => pass.dispatchWorkgroupsIndirect(indirectBuffer.buffer, offset));\n\t}\n\t_applyComputeState(pass) {\n\t\tconst memo = this._core.unwrap();\n\t\tconst { root } = this._core;\n\t\tpass.setPipeline(memo.pipeline);\n\t\tapplyBindGroups(pass, root, memo.usedBindGroupLayouts, memo.catchall, (layout) => this._priors.bindGroupLayoutMap?.get(layout));\n\t}\n\t_executeComputePass(dispatch) {\n\t\tconst { root } = this._core;\n\t\tif (this._priors.externalPass) {\n\t\t\tif (_lastAppliedCompute.get(this._priors.externalPass) !== this) {\n\t\t\t\tthis._applyComputeState(this._priors.externalPass);\n\t\t\t\t_lastAppliedCompute.set(this._priors.externalPass, this);\n\t\t\t}\n\t\t\tdispatch(this._priors.externalPass);\n\t\t\treturn;\n\t\t}\n\t\tif (this._priors.externalEncoder) {\n\t\t\tconst passDescriptor = {\n\t\t\t\tlabel: getName(this._core) ?? \"<unnamed>\",\n\t\t\t\t...setupTimestampWrites(this._priors, root)\n\t\t\t};\n\t\t\tconst pass = this._priors.externalEncoder.beginComputePass(passDescriptor);\n\t\t\tthis._applyComputeState(pass);\n\t\t\tdispatch(pass);\n\t\t\tpass.end();\n\t\t\treturn;\n\t\t}\n\t\tconst memo = this._core.unwrap();\n\t\tconst passDescriptor = {\n\t\t\tlabel: getName(this._core) ?? \"<unnamed>\",\n\t\t\t...setupTimestampWrites(this._priors, root)\n\t\t};\n\t\tconst commandEncoder = root.device.createCommandEncoder();\n\t\tconst pass = commandEncoder.beginComputePass(passDescriptor);\n\t\tthis._applyComputeState(pass);\n\t\tdispatch(pass);\n\t\tpass.end();\n\t\troot.device.queue.submit([commandEncoder.finish()]);\n\t\tif (memo.logResources) logDataFromGPU(memo.logResources);\n\t\tif (this._priors.performanceCallback) triggerPerformanceCallback({\n\t\t\troot,\n\t\t\tpriors: this._priors\n\t\t});\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n};\nvar ComputePipelineCore = class {\n\t[$internal] = true;\n\t_memo;\n\t#slotBindings;\n\t#descriptor;\n\tconstructor(root, slotBindings, descriptor) {\n\t\tthis.root = root;\n\t\tthis.#slotBindings = slotBindings;\n\t\tthis.#descriptor = descriptor;\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.withSlots(this.#slotBindings, () => {\n\t\t\tctx.resolve(this.#descriptor.compute);\n\t\t\treturn snip(\"\", Void, \"runtime\");\n\t\t});\n\t}\n\ttoString() {\n\t\treturn \"computePipelineCore\";\n\t}\n\tunwrap() {\n\t\tif (this._memo === void 0) {\n\t\t\tconst device = this.root.device;\n\t\t\tconst enableExtensions = wgslExtensions.filter((extension) => this.root.enabledFeatures.has(wgslExtensionToFeatureName[extension]));\n\t\t\tlet resolutionResult;\n\t\t\tlet resolveMeasure;\n\t\t\tconst ns = namespace({ names: this.root.nameRegistrySetting });\n\t\t\tif (PERF?.enabled) {\n\t\t\t\tconst resolveStart = performance.mark(\"typegpu:resolution:start\");\n\t\t\t\tresolutionResult = resolve(this, {\n\t\t\t\t\tnamespace: ns,\n\t\t\t\t\tenableExtensions,\n\t\t\t\t\tshaderGenerator: this.root.shaderGenerator,\n\t\t\t\t\troot: this.root\n\t\t\t\t});\n\t\t\t\tresolveMeasure = performance.measure(\"typegpu:resolution\", { start: resolveStart.name });\n\t\t\t} else resolutionResult = resolve(this, {\n\t\t\t\tnamespace: ns,\n\t\t\t\tenableExtensions,\n\t\t\t\tshaderGenerator: this.root.shaderGenerator,\n\t\t\t\troot: this.root\n\t\t\t});\n\t\t\tconst { code, usedBindGroupLayouts, catchall, logResources } = resolutionResult;\n\t\t\tif (catchall !== void 0) usedBindGroupLayouts[catchall[0]]?.$name(`${getName(this) ?? \"<unnamed>\"} - Automatic Bind Group & Layout`);\n\t\t\tconst module = device.createShaderModule({\n\t\t\t\tlabel: `${getName(this) ?? \"<unnamed>\"} - Shader`,\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis._memo = {\n\t\t\t\tpipeline: device.createComputePipeline({\n\t\t\t\t\tlabel: getName(this) ?? \"<unnamed>\",\n\t\t\t\t\tlayout: device.createPipelineLayout({\n\t\t\t\t\t\tlabel: `${getName(this) ?? \"<unnamed>\"} - Pipeline Layout`,\n\t\t\t\t\t\tbindGroupLayouts: usedBindGroupLayouts.map((l) => this.root.unwrap(l))\n\t\t\t\t\t}),\n\t\t\t\t\tcompute: { module }\n\t\t\t\t}),\n\t\t\t\tusedBindGroupLayouts,\n\t\t\t\tcatchall,\n\t\t\t\tlogResources\n\t\t\t};\n\t\t\tif (PERF?.enabled) (async () => {\n\t\t\t\tconst start = performance.mark(\"typegpu:compile-start\");\n\t\t\t\tawait device.queue.onSubmittedWorkDone();\n\t\t\t\tconst compileMeasure = performance.measure(\"typegpu:compiled\", { start: start.name });\n\t\t\t\tPERF?.record(\"resolution\", {\n\t\t\t\t\tresolveDuration: resolveMeasure?.duration,\n\t\t\t\t\tcompileDuration: compileMeasure.duration,\n\t\t\t\t\twgslSize: code.length\n\t\t\t\t});\n\t\t\t})();\n\t\t}\n\t\treturn this._memo;\n\t}\n};\n\n//#endregion\nexport { INTERNAL_createComputePipeline };","import { $internal, $resolve } from \"../../shared/symbols.js\";\nimport { getName, setName } from \"../../shared/meta.js\";\nimport { vec4f } from \"../../data/vector.js\";\nimport { AutoStruct } from \"../../data/autoStruct.js\";\nimport { createFnCore } from \"./fnCore.js\";\nimport { shaderStageSlot } from \"../slot/internalSlots.js\";\nimport { builtin } from \"../../builtin.js\";\n\n//#region src/core/function/autoIO.ts\nconst builtinVertexIn = {\n\t$vertexIndex: builtin.vertexIndex,\n\t$instanceIndex: builtin.instanceIndex\n};\nconst builtinVertexOut = {\n\t$clipDistances: builtin.clipDistances,\n\t$position: builtin.position\n};\nconst builtinFragmentIn = {\n\t$position: builtin.position,\n\t$frontFacing: builtin.frontFacing,\n\t$primitiveIndex: builtin.primitiveIndex,\n\t$sampleIndex: builtin.sampleIndex,\n\t$sampleMask: builtin.sampleMask,\n\t$subgroupInvocationId: builtin.subgroupInvocationId,\n\t$subgroupSize: builtin.subgroupSize\n};\nconst builtinFragmentOut = {\n\t$fragDepth: builtin.fragDepth,\n\t$sampleMask: builtin.sampleMask\n};\n/**\n* Only used internally. Meant to be recreated on every resolution.\n*/\nvar AutoFragmentFn = class {\n\t#core;\n\tautoIn;\n\tautoOut;\n\tconstructor(impl, varyings, locations) {\n\t\tif (!getName(impl)) setName(impl, \"fragmentFn\");\n\t\tthis.#core = createFnCore(impl, \"@fragment \");\n\t\tthis.autoIn = new AutoStruct({\n\t\t\t...builtinFragmentIn,\n\t\t\t...varyings\n\t\t}, void 0, locations);\n\t\tsetName(this.autoIn, \"FragmentIn\");\n\t\tthis.autoOut = new AutoStruct(builtinFragmentOut, vec4f);\n\t\tsetName(this.autoOut, \"FragmentOut\");\n\t}\n\ttoString() {\n\t\treturn \"autoFragmentFn\";\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.withSlots([[shaderStageSlot, \"fragment\"]], () => this.#core.resolve(ctx, [this.autoIn], this.autoOut));\n\t}\n};\nAutoFragmentFn.prototype[$internal] = true;\nAutoFragmentFn.prototype.resourceType = \"auto-fragment-fn\";\n/**\n* Only used internally. Meant to be recreated on every resolution.\n*/\nvar AutoVertexFn = class {\n\t#core;\n\tautoIn;\n\tautoOut;\n\tconstructor(impl, attribs, locations) {\n\t\tif (!getName(impl)) setName(impl, \"vertexFn\");\n\t\tthis.#core = createFnCore(impl, \"@vertex \");\n\t\tthis.autoIn = new AutoStruct({\n\t\t\t...builtinVertexIn,\n\t\t\t...attribs\n\t\t}, void 0, locations);\n\t\tsetName(this.autoIn, \"VertexIn\");\n\t\tthis.autoOut = new AutoStruct(builtinVertexOut, void 0);\n\t\tsetName(this.autoOut, \"VertexOut\");\n\t}\n\ttoString() {\n\t\treturn \"autoVertexFn\";\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.withSlots([[shaderStageSlot, \"vertex\"]], () => this.#core.resolve(ctx, [this.autoIn], this.autoOut));\n\t}\n};\nAutoVertexFn.prototype[$internal] = true;\nAutoVertexFn.prototype.resourceType = \"auto-vertex-fn\";\n\n//#endregion\nexport { AutoFragmentFn, AutoVertexFn };","import { isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { isBuiltin } from \"../../data/attributes.js\";\n\n//#region src/core/pipeline/connectAttachmentToShader.ts\nfunction isColorAttachment(value) {\n\treturn !!value?.view;\n}\nfunction connectAttachmentToShader(fragmentOut, attachment) {\n\tif (isBuiltin(fragmentOut)) return [];\n\tif (isWgslStruct(fragmentOut)) {\n\t\tconst result = [];\n\t\tfor (const key of Object.keys(fragmentOut.propTypes)) {\n\t\t\tconst outputValue = fragmentOut.propTypes[key];\n\t\t\tif (isBuiltin(outputValue)) continue;\n\t\t\tconst matching = attachment[key];\n\t\t\tif (!matching) throw new Error(`A color attachment by the name of '${key}' was not provided to the shader.`);\n\t\t\tresult.push(matching);\n\t\t}\n\t\treturn result;\n\t}\n\tif (!isColorAttachment(attachment)) throw new Error(\"Expected a single color attachment, not a record.\");\n\treturn [attachment];\n}\n\n//#endregion\nexport { connectAttachmentToShader };","import { isVoid, isWgslStruct } from \"../../data/wgslTypes.js\";\nimport { isBuiltin } from \"../../data/attributes.js\";\n\n//#region src/core/pipeline/connectTargetsToShader.ts\nfunction connectTargetsToShader(fragmentOut, targets) {\n\tlet presentationFormat;\n\tif (isVoid(fragmentOut) || isBuiltin(fragmentOut)) return [null];\n\tif (isWgslStruct(fragmentOut)) {\n\t\tconst result = [];\n\t\tfor (const key of Object.keys(fragmentOut.propTypes)) {\n\t\t\tconst outputValue = fragmentOut.propTypes[key];\n\t\t\tif (isBuiltin(outputValue)) continue;\n\t\t\tconst matchingTarget = targets[key];\n\t\t\tresult.push({\n\t\t\t\t...matchingTarget,\n\t\t\t\tformat: matchingTarget?.format ?? (presentationFormat ??= navigator.gpu.getPreferredCanvasFormat())\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tconst singleTarget = targets;\n\treturn [{\n\t\t...singleTarget,\n\t\tformat: singleTarget?.format ?? (presentationFormat ??= navigator.gpu.getPreferredCanvasFormat())\n\t}];\n}\n\n//#endregion\nexport { connectTargetsToShader };","import { $getNameForward, $internal, $resolve } from \"../../shared/symbols.js\";\nimport { PERF, getName, setName } from \"../../shared/meta.js\";\nimport { Void, isWgslData } from \"../../data/wgslTypes.js\";\nimport { getCustomLocation } from \"../../data/dataTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { isGPUBuffer } from \"../../types.js\";\nimport { formatToWGSLType } from \"../../data/vertexFormatData.js\";\nimport { sizeOf } from \"../../data/sizeOf.js\";\nimport { isBuiltin } from \"../../data/attributes.js\";\nimport { namespace } from \"../resolve/namespace.js\";\nimport { connectAttributesToShader } from \"../vertexLayout/connectAttributesToShader.js\";\nimport { isTexture, isTextureView } from \"../texture/texture.js\";\nimport { isBindGroup, isBindGroupLayout } from \"../../tgpuBindGroupLayout.js\";\nimport { resolve } from \"../../resolutionCtx.js\";\nimport { isGPUCommandEncoder, isGPURenderBundleEncoder, isGPURenderPassEncoder } from \"./typeGuards.js\";\nimport { applyBindGroups, applyVertexBuffers } from \"./applyPipelineState.js\";\nimport { logDataFromGPU } from \"../../tgsl/consoleLog/deserializers.js\";\nimport { wgslExtensionToFeatureName, wgslExtensions } from \"../../wgslExtensions.js\";\nimport { createWithPerformanceCallback, createWithTimestampWrites, setupTimestampWrites, triggerPerformanceCallback } from \"./timeable.js\";\nimport { AutoFragmentFn, AutoVertexFn } from \"../function/autoIO.js\";\nimport { isVertexLayout } from \"../vertexLayout/vertexLayout.js\";\nimport { connectAttachmentToShader } from \"./connectAttachmentToShader.js\";\nimport { connectTargetsToShader } from \"./connectTargetsToShader.js\";\n\n//#region src/core/pipeline/renderPipeline.ts\nfunction INTERNAL_createRenderPipeline(options) {\n\treturn new TgpuRenderPipelineImpl(new RenderPipelineCore(options), {});\n}\nconst _lastAppliedRender = /* @__PURE__ */ new WeakMap();\nvar TgpuRenderPipelineImpl = class TgpuRenderPipelineImpl {\n\t[$internal];\n\tresourceType = \"render-pipeline\";\n\t[$getNameForward];\n\thasIndexBuffer = false;\n\tconstructor(core, priors) {\n\t\tthis[$internal] = {\n\t\t\tcore,\n\t\t\tpriors,\n\t\t\troot: core.options.root\n\t\t};\n\t\tthis[$getNameForward] = core;\n\t}\n\t[$resolve](ctx) {\n\t\treturn ctx.resolve(this[$internal].core);\n\t}\n\ttoString() {\n\t\treturn `renderPipeline:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n\twith(first, resource) {\n\t\tconst internals = this[$internal];\n\t\tif (isGPURenderPassEncoder(first) || isGPURenderBundleEncoder(first)) return new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\texternalRenderEncoder: first,\n\t\t\texternalEncoder: void 0\n\t\t});\n\t\tif (isGPUCommandEncoder(first)) return new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\texternalEncoder: first,\n\t\t\texternalRenderEncoder: void 0\n\t\t});\n\t\tif (isBindGroup(first)) return new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tbindGroupLayoutMap: new Map([...internals.priors.bindGroupLayoutMap ?? [], [first.layout, first]])\n\t\t});\n\t\tif (isBindGroupLayout(first)) return new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tbindGroupLayoutMap: new Map([...internals.priors.bindGroupLayoutMap ?? [], [first, resource]])\n\t\t});\n\t\tif (isVertexLayout(first)) return new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tvertexLayoutMap: new Map([...internals.priors.vertexLayoutMap ?? [], [first, resource]])\n\t\t});\n\t\tthrow new Error(\"Unsupported value passed into .with()\");\n\t}\n\twithPerformanceCallback(callback) {\n\t\tconst internals = this[$internal];\n\t\tconst newPriors = createWithPerformanceCallback(internals.priors, callback, internals.core.options.root);\n\t\treturn new TgpuRenderPipelineImpl(internals.core, newPriors);\n\t}\n\twithTimestampWrites(options) {\n\t\tconst internals = this[$internal];\n\t\tconst newPriors = createWithTimestampWrites(internals.priors, options, internals.core.options.root);\n\t\treturn new TgpuRenderPipelineImpl(internals.core, newPriors);\n\t}\n\twithColorAttachment(attachment) {\n\t\tconst internals = this[$internal];\n\t\treturn new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tcolorAttachment: attachment\n\t\t});\n\t}\n\twithDepthStencilAttachment(attachment) {\n\t\tconst internals = this[$internal];\n\t\treturn new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tdepthStencilAttachment: attachment\n\t\t});\n\t}\n\twithStencilReference(reference) {\n\t\tconst internals = this[$internal];\n\t\treturn new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tstencilReference: reference\n\t\t});\n\t}\n\twithIndexBuffer(buffer, indexFormatOrOffset, offsetElementsOrSizeBytes, sizeElementsOrUndefined) {\n\t\tconst internals = this[$internal];\n\t\tif (isGPUBuffer(buffer)) {\n\t\t\tif (typeof indexFormatOrOffset !== \"string\") throw new Error(\"If a GPUBuffer is passed, indexFormat must be provided.\");\n\t\t\treturn new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t\t...internals.priors,\n\t\t\t\tindexBuffer: {\n\t\t\t\t\tbuffer,\n\t\t\t\t\tindexFormat: indexFormatOrOffset,\n\t\t\t\t\toffsetBytes: offsetElementsOrSizeBytes,\n\t\t\t\t\tsizeBytes: sizeElementsOrUndefined\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst dataTypeToIndexFormat = {\n\t\t\tu32: \"uint32\",\n\t\t\tu16: \"uint16\"\n\t\t};\n\t\tconst elementType = buffer.dataType.elementType;\n\t\treturn new TgpuRenderPipelineImpl(internals.core, {\n\t\t\t...internals.priors,\n\t\t\tindexBuffer: {\n\t\t\t\tbuffer,\n\t\t\t\tindexFormat: dataTypeToIndexFormat[elementType.type],\n\t\t\t\toffsetBytes: indexFormatOrOffset !== void 0 ? indexFormatOrOffset * sizeOf(elementType) : void 0,\n\t\t\t\tsizeBytes: sizeElementsOrUndefined !== void 0 ? sizeElementsOrUndefined * sizeOf(elementType) : void 0\n\t\t\t}\n\t\t});\n\t}\n\t_createRenderPass(encoder) {\n\t\tconst internals = this[$internal];\n\t\tconst { root, descriptor } = internals.core.options;\n\t\tconst memo = internals.core.unwrap();\n\t\tconst colorAttachments = descriptor.fragment ? connectAttachmentToShader(descriptor.fragment?.shell?.returnType ?? memo.fragmentOut, internals.priors.colorAttachment ?? {}).map((_attachment) => {\n\t\t\tconst attachment = {\n\t\t\t\tloadOp: \"clear\",\n\t\t\t\tstoreOp: \"store\",\n\t\t\t\t..._attachment\n\t\t\t};\n\t\t\tif (isTexture(attachment.view)) attachment.view = root.unwrap(attachment.view).createView();\n\t\t\telse if (isTextureView(attachment.view)) attachment.view = root.unwrap(attachment.view);\n\t\t\telse if (isGPUCanvasContext(attachment.view)) attachment.view = attachment.view.getCurrentTexture().createView();\n\t\t\tif (isTexture(attachment.resolveTarget)) attachment.resolveTarget = root.unwrap(attachment.resolveTarget).createView();\n\t\t\telse if (isTextureView(attachment.resolveTarget)) attachment.resolveTarget = root.unwrap(attachment.resolveTarget);\n\t\t\telse if (isGPUCanvasContext(attachment.resolveTarget)) attachment.resolveTarget = attachment.resolveTarget.getCurrentTexture().createView();\n\t\t\treturn attachment;\n\t\t}) : [];\n\t\tconst renderPassDescriptor = {\n\t\t\tlabel: getName(internals.core) ?? \"<unnamed>\",\n\t\t\tcolorAttachments,\n\t\t\t...setupTimestampWrites(internals.priors, root)\n\t\t};\n\t\tconst depthStencil = internals.priors.depthStencilAttachment;\n\t\tif (depthStencil !== void 0) {\n\t\t\tconst view = isTexture(depthStencil.view) ? root.unwrap(depthStencil.view).createView() : isTextureView(depthStencil.view) ? root.unwrap(depthStencil.view) : depthStencil.view;\n\t\t\trenderPassDescriptor.depthStencilAttachment = {\n\t\t\t\t...depthStencil,\n\t\t\t\tview\n\t\t\t};\n\t\t}\n\t\treturn encoder.beginRenderPass(renderPassDescriptor);\n\t}\n\t_applyRenderState(encoder) {\n\t\tconst internals = this[$internal];\n\t\tconst memo = internals.core.unwrap();\n\t\tconst { root } = internals.core.options;\n\t\tencoder.setPipeline(memo.pipeline);\n\t\tapplyBindGroups(encoder, root, memo.usedBindGroupLayouts, memo.catchall, (layout) => internals.priors.bindGroupLayoutMap?.get(layout));\n\t\tapplyVertexBuffers(encoder, root, memo.usedVertexLayouts, (layout) => {\n\t\t\tconst buffer = internals.priors.vertexLayoutMap?.get(layout);\n\t\t\treturn buffer ? { buffer } : void 0;\n\t\t});\n\t\tif (internals.priors.stencilReference !== void 0 && \"setStencilReference\" in encoder) encoder.setStencilReference(internals.priors.stencilReference);\n\t}\n\t_setIndexBuffer(encoder) {\n\t\tconst internals = this[$internal];\n\t\tconst { root } = internals.core.options;\n\t\tif (!internals.priors.indexBuffer) throw new Error(\"No index buffer set for this render pipeline.\");\n\t\tconst { buffer, indexFormat, offsetBytes, sizeBytes } = internals.priors.indexBuffer;\n\t\tif (isGPUBuffer(buffer)) encoder.setIndexBuffer(buffer, indexFormat, offsetBytes, sizeBytes);\n\t\telse encoder.setIndexBuffer(root.unwrap(buffer), indexFormat, offsetBytes, sizeBytes);\n\t}\n\tdraw(vertexCount, instanceCount, firstVertex, firstInstance) {\n\t\tconst internals = this[$internal];\n\t\tconst { root } = internals.core.options;\n\t\tif (internals.priors.externalRenderEncoder) {\n\t\t\tif (_lastAppliedRender.get(internals.priors.externalRenderEncoder) !== this) {\n\t\t\t\tthis._applyRenderState(internals.priors.externalRenderEncoder);\n\t\t\t\t_lastAppliedRender.set(internals.priors.externalRenderEncoder, this);\n\t\t\t}\n\t\t\tinternals.priors.externalRenderEncoder.draw(vertexCount, instanceCount, firstVertex, firstInstance);\n\t\t\treturn;\n\t\t}\n\t\tif (internals.priors.externalEncoder) {\n\t\t\tconst pass = this._createRenderPass(internals.priors.externalEncoder);\n\t\t\tthis._applyRenderState(pass);\n\t\t\tpass.draw(vertexCount, instanceCount, firstVertex, firstInstance);\n\t\t\tpass.end();\n\t\t\treturn;\n\t\t}\n\t\tconst { logResources } = internals.core.unwrap();\n\t\tconst commandEncoder = root.device.createCommandEncoder();\n\t\tconst pass = this._createRenderPass(commandEncoder);\n\t\tthis._applyRenderState(pass);\n\t\tpass.draw(vertexCount, instanceCount, firstVertex, firstInstance);\n\t\tpass.end();\n\t\troot.device.queue.submit([commandEncoder.finish()]);\n\t\tif (logResources) logDataFromGPU(logResources);\n\t\tif (internals.priors.performanceCallback) triggerPerformanceCallback({\n\t\t\troot,\n\t\t\tpriors: internals.priors\n\t\t});\n\t}\n\tdrawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance) {\n\t\tconst internals = this[$internal];\n\t\tconst { root } = internals.core.options;\n\t\tif (internals.priors.externalRenderEncoder) {\n\t\t\tif (_lastAppliedRender.get(internals.priors.externalRenderEncoder) !== this) {\n\t\t\t\tthis._applyRenderState(internals.priors.externalRenderEncoder);\n\t\t\t\tthis._setIndexBuffer(internals.priors.externalRenderEncoder);\n\t\t\t\t_lastAppliedRender.set(internals.priors.externalRenderEncoder, this);\n\t\t\t}\n\t\t\tinternals.priors.externalRenderEncoder.drawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance);\n\t\t\treturn;\n\t\t}\n\t\tif (internals.priors.externalEncoder) {\n\t\t\tconst pass = this._createRenderPass(internals.priors.externalEncoder);\n\t\t\tthis._applyRenderState(pass);\n\t\t\tthis._setIndexBuffer(pass);\n\t\t\tpass.drawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance);\n\t\t\tpass.end();\n\t\t\treturn;\n\t\t}\n\t\tconst { logResources } = internals.core.unwrap();\n\t\tconst commandEncoder = root.device.createCommandEncoder();\n\t\tconst pass = this._createRenderPass(commandEncoder);\n\t\tthis._applyRenderState(pass);\n\t\tthis._setIndexBuffer(pass);\n\t\tpass.drawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance);\n\t\tpass.end();\n\t\troot.device.queue.submit([commandEncoder.finish()]);\n\t\tif (logResources) logDataFromGPU(logResources);\n\t\tif (internals.priors.performanceCallback) triggerPerformanceCallback({\n\t\t\troot,\n\t\t\tpriors: internals.priors\n\t\t});\n\t}\n\tdrawIndirect(indirectBuffer, indirectOffset = 0) {\n\t\tconst internals = this[$internal];\n\t\tconst { root } = internals.core.options;\n\t\tconst rawBuffer = isGPUBuffer(indirectBuffer) ? indirectBuffer : root.unwrap(indirectBuffer);\n\t\tif (internals.priors.externalRenderEncoder) {\n\t\t\tif (_lastAppliedRender.get(internals.priors.externalRenderEncoder) !== this) {\n\t\t\t\tthis._applyRenderState(internals.priors.externalRenderEncoder);\n\t\t\t\t_lastAppliedRender.set(internals.priors.externalRenderEncoder, this);\n\t\t\t}\n\t\t\tinternals.priors.externalRenderEncoder.drawIndirect(rawBuffer, indirectOffset);\n\t\t\treturn;\n\t\t}\n\t\tif (internals.priors.externalEncoder) {\n\t\t\tconst pass = this._createRenderPass(internals.priors.externalEncoder);\n\t\t\tthis._applyRenderState(pass);\n\t\t\tpass.drawIndirect(rawBuffer, indirectOffset);\n\t\t\tpass.end();\n\t\t\treturn;\n\t\t}\n\t\tconst { logResources } = internals.core.unwrap();\n\t\tconst commandEncoder = root.device.createCommandEncoder();\n\t\tconst pass = this._createRenderPass(commandEncoder);\n\t\tthis._applyRenderState(pass);\n\t\tpass.drawIndirect(rawBuffer, indirectOffset);\n\t\tpass.end();\n\t\troot.device.queue.submit([commandEncoder.finish()]);\n\t\tif (logResources) logDataFromGPU(logResources);\n\t\tif (internals.priors.performanceCallback) triggerPerformanceCallback({\n\t\t\troot,\n\t\t\tpriors: internals.priors\n\t\t});\n\t}\n\tdrawIndexedIndirect(indirectBuffer, indirectOffset = 0) {\n\t\tconst internals = this[$internal];\n\t\tconst { root } = internals.core.options;\n\t\tconst rawBuffer = isGPUBuffer(indirectBuffer) ? indirectBuffer : root.unwrap(indirectBuffer);\n\t\tif (internals.priors.externalRenderEncoder) {\n\t\t\tif (_lastAppliedRender.get(internals.priors.externalRenderEncoder) !== this) {\n\t\t\t\tthis._applyRenderState(internals.priors.externalRenderEncoder);\n\t\t\t\tthis._setIndexBuffer(internals.priors.externalRenderEncoder);\n\t\t\t\t_lastAppliedRender.set(internals.priors.externalRenderEncoder, this);\n\t\t\t}\n\t\t\tinternals.priors.externalRenderEncoder.drawIndexedIndirect(rawBuffer, indirectOffset);\n\t\t\treturn;\n\t\t}\n\t\tif (internals.priors.externalEncoder) {\n\t\t\tconst pass = this._createRenderPass(internals.priors.externalEncoder);\n\t\t\tthis._applyRenderState(pass);\n\t\t\tthis._setIndexBuffer(pass);\n\t\t\tpass.drawIndexedIndirect(rawBuffer, indirectOffset);\n\t\t\tpass.end();\n\t\t\treturn;\n\t\t}\n\t\tconst { logResources } = internals.core.unwrap();\n\t\tconst commandEncoder = root.device.createCommandEncoder();\n\t\tconst pass = this._createRenderPass(commandEncoder);\n\t\tthis._applyRenderState(pass);\n\t\tthis._setIndexBuffer(pass);\n\t\tpass.drawIndexedIndirect(rawBuffer, indirectOffset);\n\t\tpass.end();\n\t\troot.device.queue.submit([commandEncoder.finish()]);\n\t\tif (logResources) logDataFromGPU(logResources);\n\t\tif (internals.priors.performanceCallback) triggerPerformanceCallback({\n\t\t\troot,\n\t\t\tpriors: internals.priors\n\t\t});\n\t}\n};\nvar RenderPipelineCore = class {\n\t[$internal] = true;\n\t_memo;\n\t#latestAutoVertexIn;\n\t#latestAutoFragmentOut;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t}\n\t[$resolve](ctx) {\n\t\tconst { slotBindings } = this.options;\n\t\tconst { vertex, fragment, attribs = {} } = this.options.descriptor;\n\t\tthis.#latestAutoVertexIn = void 0;\n\t\tthis.#latestAutoFragmentOut = void 0;\n\t\tconst locations = matchUpVaryingLocations(vertex?.shell?.out, fragment?.shell?.in, getName(vertex) ?? \"<unnamed>\", getName(fragment) ?? \"<unnamed>\");\n\t\treturn ctx.withVaryingLocations(locations, () => ctx.withSlots(slotBindings, () => {\n\t\t\tlet vertexOut;\n\t\t\tif (typeof vertex === \"function\") {\n\t\t\t\tconst autoFn = new AutoVertexFn(vertex, Object.fromEntries(Object.entries(attribs).map(([key, value]) => [key, formatToWGSLType[value.format]])), locations);\n\t\t\t\tctx.resolve(autoFn);\n\t\t\t\tthis.#latestAutoVertexIn = autoFn.autoIn.completeStruct.propTypes;\n\t\t\t\tvertexOut = autoFn.autoOut.completeStruct;\n\t\t\t} else vertexOut = ctx.resolve(vertex).dataType;\n\t\t\tif (fragment) if (typeof fragment === \"function\") {\n\t\t\t\tconst varyings = Object.fromEntries(Object.entries(vertexOut.propTypes).filter(([, dataType]) => !isBuiltin(dataType)));\n\t\t\t\tthis.#latestAutoFragmentOut = ctx.resolve(new AutoFragmentFn(fragment, varyings, locations)).dataType;\n\t\t\t} else ctx.resolve(fragment);\n\t\t\treturn snip(\"\", Void, \"runtime\");\n\t\t}));\n\t}\n\ttoString() {\n\t\treturn \"renderPipelineCore\";\n\t}\n\tunwrap() {\n\t\tif (this._memo !== void 0) return this._memo;\n\t\tconst { root, descriptor: tgpuDescriptor } = this.options;\n\t\tconst device = root.device;\n\t\tconst enableExtensions = wgslExtensions.filter((extension) => root.enabledFeatures.has(wgslExtensionToFeatureName[extension]));\n\t\tlet resolutionResult;\n\t\tlet resolveMeasure;\n\t\tconst ns = namespace({ names: root.nameRegistrySetting });\n\t\tif (PERF?.enabled) {\n\t\t\tconst resolveStart = performance.mark(\"typegpu:resolution:start\");\n\t\t\tresolutionResult = resolve(this, {\n\t\t\t\tnamespace: ns,\n\t\t\t\tenableExtensions,\n\t\t\t\tshaderGenerator: root.shaderGenerator,\n\t\t\t\troot\n\t\t\t});\n\t\t\tresolveMeasure = performance.measure(\"typegpu:resolution\", { start: resolveStart.name });\n\t\t} else resolutionResult = resolve(this, {\n\t\t\tnamespace: ns,\n\t\t\tenableExtensions,\n\t\t\tshaderGenerator: root.shaderGenerator,\n\t\t\troot\n\t\t});\n\t\tconst { code, usedBindGroupLayouts, catchall, logResources } = resolutionResult;\n\t\tif (catchall !== void 0) usedBindGroupLayouts[catchall[0]]?.$name(`${getName(this) ?? \"<unnamed>\"} - Automatic Bind Group & Layout`);\n\t\tconst module = device.createShaderModule({\n\t\t\tlabel: `${getName(this) ?? \"<unnamed>\"} - Shader`,\n\t\t\tcode\n\t\t});\n\t\tconst { vertex, fragment, attribs = {}, targets } = this.options.descriptor;\n\t\tconst connectedAttribs = connectAttributesToShader(vertex?.shell?.in ?? this.#latestAutoVertexIn ?? {}, attribs);\n\t\tconst fragmentOut = fragment?.shell?.returnType ?? this.#latestAutoFragmentOut;\n\t\tconst connectedTargets = fragmentOut ? connectTargetsToShader(fragmentOut, targets) : [null];\n\t\tconst descriptor = {\n\t\t\tlayout: device.createPipelineLayout({\n\t\t\t\tlabel: `${getName(this) ?? \"<unnamed>\"} - Pipeline Layout`,\n\t\t\t\tbindGroupLayouts: usedBindGroupLayouts.map((l) => root.unwrap(l))\n\t\t\t}),\n\t\t\tvertex: {\n\t\t\t\tmodule,\n\t\t\t\tbuffers: connectedAttribs.bufferDefinitions\n\t\t\t}\n\t\t};\n\t\tconst label = getName(this);\n\t\tif (label !== void 0) descriptor.label = label;\n\t\tif (tgpuDescriptor.fragment) descriptor.fragment = {\n\t\t\tmodule,\n\t\t\ttargets: connectedTargets\n\t\t};\n\t\tif (tgpuDescriptor.primitive) if (isWgslData(tgpuDescriptor.primitive.stripIndexFormat)) descriptor.primitive = {\n\t\t\t...tgpuDescriptor.primitive,\n\t\t\tstripIndexFormat: {\n\t\t\t\tu32: \"uint32\",\n\t\t\t\tu16: \"uint16\"\n\t\t\t}[tgpuDescriptor.primitive.stripIndexFormat.type]\n\t\t};\n\t\telse descriptor.primitive = tgpuDescriptor.primitive;\n\t\tif (tgpuDescriptor.depthStencil) descriptor.depthStencil = tgpuDescriptor.depthStencil;\n\t\tif (tgpuDescriptor.multisample) descriptor.multisample = tgpuDescriptor.multisample;\n\t\tthis._memo = {\n\t\t\tpipeline: device.createRenderPipeline(descriptor),\n\t\t\tusedBindGroupLayouts,\n\t\t\tcatchall,\n\t\t\tlogResources,\n\t\t\tusedVertexLayouts: connectedAttribs.usedVertexLayouts,\n\t\t\tfragmentOut: this.#latestAutoFragmentOut\n\t\t};\n\t\tif (PERF?.enabled) (async () => {\n\t\t\tconst start = performance.mark(\"typegpu:compile-start\");\n\t\t\tawait device.queue.onSubmittedWorkDone();\n\t\t\tconst compileMeasure = performance.measure(\"typegpu:compiled\", { start: start.name });\n\t\t\tPERF?.record(\"resolution\", {\n\t\t\t\tresolveDuration: resolveMeasure?.duration,\n\t\t\t\tcompileDuration: compileMeasure.duration,\n\t\t\t\twgslSize: code.length\n\t\t\t});\n\t\t})();\n\t\treturn this._memo;\n\t}\n};\n/**\n* Assumes vertexOut and fragmentIn are matching when it comes to the keys, that is fragmentIn's keyset is a subset of vertexOut's\n* Logs a warning, when they don't match in terms of custom locations\n*/\nfunction matchUpVaryingLocations(vertexOut = {}, fragmentIn = {}, vertexFnName, fragmentFnName) {\n\tconst locations = {};\n\tconst usedLocations = /* @__PURE__ */ new Set();\n\tfunction saveLocation(key, location) {\n\t\tlocations[key] = location;\n\t\tusedLocations.add(location);\n\t}\n\tfor (const [key, value] of Object.entries(vertexOut)) {\n\t\tconst customLocation = getCustomLocation(value);\n\t\tif (customLocation !== void 0) saveLocation(key, customLocation);\n\t}\n\tfor (const [key, value] of Object.entries(fragmentIn)) {\n\t\tconst customLocation = getCustomLocation(value);\n\t\tif (customLocation === void 0) continue;\n\t\tif (locations[key] === void 0) saveLocation(key, customLocation);\n\t\telse if (locations[key] !== customLocation) console.warn(`Mismatched location between vertexFn (${vertexFnName}) output (${locations[key]}) and fragmentFn (${fragmentFnName}) input (${customLocation}) for the key \"${key}\", using the location set on vertex output.`);\n\t}\n\tlet nextLocation = 0;\n\tfor (const key of Object.keys(vertexOut ?? {})) {\n\t\tif (isBuiltin(vertexOut[key]) || locations[key] !== void 0) continue;\n\t\twhile (usedLocations.has(nextLocation)) nextLocation++;\n\t\tsaveLocation(key, nextLocation);\n\t}\n\treturn locations;\n}\nfunction isGPUCanvasContext(value) {\n\treturn typeof value?.getCurrentTexture === \"function\";\n}\n\n//#endregion\nexport { INTERNAL_createRenderPipeline };","import { isVecInstance } from \"../data/wgslTypes.js\";\nimport { isSnippetNumeric, snip } from \"../data/snippet.js\";\nimport { stitch } from \"../core/resolve/stitch.js\";\nimport { unify } from \"../tgsl/conversion.js\";\nimport { bool, f32 } from \"../data/numeric.js\";\nimport { vec2b, vec3b, vec4b } from \"../data/vector.js\";\nimport { dualImpl } from \"../core/function/dualImpl.js\";\nimport { VectorOps } from \"../data/vectorOps.js\";\nimport { sub } from \"./operators.js\";\n\n//#region src/std/boolean.ts\nfunction correspondingBooleanVectorSchema(dataType) {\n\tif (dataType.type.includes(\"2\")) return vec2b;\n\tif (dataType.type.includes(\"3\")) return vec3b;\n\treturn vec4b;\n}\n/**\n* Checks whether `lhs == rhs` on all components.\n* Equivalent to `all(eq(lhs, rhs))`.\n* @example\n* allEq(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns false\n* allEq(vec3u(0, 1, 2), vec3u(0, 1, 2)) // returns true\n*/\nconst allEq = dualImpl({\n\tname: \"allEq\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: bool\n\t}),\n\tnormalImpl: (lhs, rhs) => cpuAll(cpuEq(lhs, rhs)),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`all(${lhs} == ${rhs})`\n});\nconst cpuEq = (lhs, rhs) => VectorOps.eq[lhs.kind](lhs, rhs);\n/**\n* Checks **component-wise** whether `lhs == rhs`.\n* This function does **not** return `bool`, for that use-case, wrap the result in `all`, or use `allEq`.\n* @example\n* eq(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns vec2b(true, false)\n* eq(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, true, false)\n* all(eq(vec4i(4, 3, 2, 1), vec4i(4, 3, 2, 1))) // returns true\n* allEq(vec4i(4, 3, 2, 1), vec4i(4, 3, 2, 1)) // returns true\n*/\nconst eq = dualImpl({\n\tname: \"eq\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: correspondingBooleanVectorSchema(argTypes[0])\n\t}),\n\tnormalImpl: cpuEq,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} == ${rhs})`\n});\n/**\n* Checks **component-wise** whether `lhs != rhs`.\n* This function does **not** return `bool`, for that use-case, wrap the result in `any`.\n* @example\n* ne(vec2f(0.0, 1.0), vec2f(0.0, 2.0)) // returns vec2b(false, true)\n* ne(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, false, true)\n* any(ne(vec4i(4, 3, 2, 1), vec4i(4, 2, 2, 1))) // returns true\n*/\nconst ne = dualImpl({\n\tname: \"ne\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: correspondingBooleanVectorSchema(argTypes[0])\n\t}),\n\tnormalImpl: (lhs, rhs) => cpuNot(cpuEq(lhs, rhs)),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} != ${rhs})`\n});\nconst cpuLt = (lhs, rhs) => VectorOps.lt[lhs.kind](lhs, rhs);\n/**\n* Checks **component-wise** whether `lhs < rhs`.\n* This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n* @example\n* lt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, true)\n* lt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, false, false)\n* all(lt(vec4i(1, 2, 3, 4), vec4i(2, 3, 4, 5))) // returns true\n*/\nconst lt = dualImpl({\n\tname: \"lt\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: correspondingBooleanVectorSchema(argTypes[0])\n\t}),\n\tnormalImpl: cpuLt,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} < ${rhs})`\n});\n/**\n* Checks **component-wise** whether `lhs <= rhs`.\n* This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n* @example\n* le(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(true, true)\n* le(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(true, true, false)\n* all(le(vec4i(1, 2, 3, 4), vec4i(2, 3, 3, 5))) // returns true\n*/\nconst le = dualImpl({\n\tname: \"le\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: correspondingBooleanVectorSchema(argTypes[0])\n\t}),\n\tnormalImpl: (lhs, rhs) => cpuOr(cpuLt(lhs, rhs), cpuEq(lhs, rhs)),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} <= ${rhs})`\n});\n/**\n* Checks **component-wise** whether `lhs > rhs`.\n* This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n* @example\n* gt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, false)\n* gt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, false, true)\n* all(gt(vec4i(2, 3, 4, 5), vec4i(1, 2, 3, 4))) // returns true\n*/\nconst gt = dualImpl({\n\tname: \"gt\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: correspondingBooleanVectorSchema(argTypes[0])\n\t}),\n\tnormalImpl: (lhs, rhs) => cpuAnd(cpuNot(cpuLt(lhs, rhs)), cpuNot(cpuEq(lhs, rhs))),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} > ${rhs})`\n});\n/**\n* Checks **component-wise** whether `lhs >= rhs`.\n* This function does **not** return `bool`, for that use-case, wrap the result in `all`.\n* @example\n* ge(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(true, false)\n* ge(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, true, true)\n* all(ge(vec4i(2, 2, 4, 5), vec4i(1, 2, 3, 4))) // returns true\n*/\nconst ge = dualImpl({\n\tname: \"ge\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: correspondingBooleanVectorSchema(argTypes[0])\n\t}),\n\tnormalImpl: (lhs, rhs) => cpuNot(cpuLt(lhs, rhs)),\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} >= ${rhs})`\n});\nconst cpuNot = (value) => VectorOps.neg[value.kind](value);\n/**\n* Returns **component-wise** `!value`.\n* @example\n* not(vec2b(false, true)) // returns vec2b(true, false)\n* not(vec3b(true, true, false)) // returns vec3b(false, false, true)\n*/\nconst not = dualImpl({\n\tname: \"not\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: argTypes[0]\n\t}),\n\tnormalImpl: cpuNot,\n\tcodegenImpl: (_ctx, [arg]) => stitch`!(${arg})`\n});\nconst cpuOr = (lhs, rhs) => VectorOps.or[lhs.kind](lhs, rhs);\n/**\n* Returns **component-wise** logical `or` result.\n* @example\n* or(vec2b(false, true), vec2b(false, false)) // returns vec2b(false, true)\n* or(vec3b(true, true, false), vec3b(false, true, false)) // returns vec3b(true, true, false)\n*/\nconst or = dualImpl({\n\tname: \"or\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: argTypes[0]\n\t}),\n\tnormalImpl: cpuOr,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} | ${rhs})`\n});\nconst cpuAnd = (lhs, rhs) => cpuNot(cpuOr(cpuNot(lhs), cpuNot(rhs)));\n/**\n* Returns **component-wise** logical `and` result.\n* @example\n* and(vec2b(false, true), vec2b(true, true)) // returns vec2b(false, true)\n* and(vec3b(true, true, false), vec3b(false, true, false)) // returns vec3b(false, true, false)\n*/\nconst and = dualImpl({\n\tname: \"and\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: argTypes[0]\n\t}),\n\tnormalImpl: cpuAnd,\n\tcodegenImpl: (_ctx, [lhs, rhs]) => stitch`(${lhs} & ${rhs})`\n});\nconst cpuAll = (value) => VectorOps.all[value.kind](value);\n/**\n* Returns `true` if each component of `value` is true.\n* @example\n* all(vec2b(false, true)) // returns false\n* all(vec3b(true, true, true)) // returns true\n*/\nconst all = dualImpl({\n\tname: \"all\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: bool\n\t}),\n\tnormalImpl: cpuAll,\n\tcodegenImpl: (_ctx, [value]) => stitch`all(${value})`\n});\n/**\n* Returns `true` if any component of `value` is true.\n* @example\n* any(vec2b(false, true)) // returns true\n* any(vec3b(false, false, false)) // returns false\n*/\nconst any = dualImpl({\n\tname: \"any\",\n\tsignature: (...argTypes) => ({\n\t\targTypes,\n\t\treturnType: bool\n\t}),\n\tnormalImpl: (value) => !cpuAll(cpuNot(value)),\n\tcodegenImpl: (_ctx, [arg]) => stitch`any(${arg})`\n});\n/**\n* Checks whether the given elements differ by at most the `precision` value.\n* Checks all elements of `lhs` and `rhs` if arguments are vectors.\n* @example\n* isCloseTo(0, 0.1) // returns false\n* isCloseTo(vec3f(0, 0, 0), vec3f(0.002, -0.009, 0)) // returns true\n*\n* @param {number} precision argument that specifies the maximum allowed difference, 0.01 by default.\n*/\nconst isCloseTo = dualImpl({\n\tname: \"isCloseTo\",\n\tsignature: (...args) => ({\n\t\targTypes: args,\n\t\treturnType: bool\n\t}),\n\tnormalImpl: (lhs, rhs, precision = .01) => {\n\t\tif (typeof lhs === \"number\" && typeof rhs === \"number\") return Math.abs(lhs - rhs) < precision;\n\t\tif (isVecInstance(lhs) && isVecInstance(rhs)) return VectorOps.isCloseToZero[lhs.kind](sub(lhs, rhs), precision);\n\t\treturn false;\n\t},\n\tcodegenImpl: (_ctx, [lhs, rhs, precision = snip(.01, f32, \"constant\")]) => {\n\t\tif (isSnippetNumeric(lhs) && isSnippetNumeric(rhs)) return stitch`(abs(f32(${lhs}) - f32(${rhs})) <= ${precision})`;\n\t\tif (!isSnippetNumeric(lhs) && !isSnippetNumeric(rhs)) return stitch`all(abs(${lhs} - ${rhs}) <= (${lhs} - ${lhs}) + ${precision})`;\n\t\treturn \"false\";\n\t}\n});\nfunction cpuSelect(f, t, cond) {\n\tif (typeof cond === \"boolean\") return cond ? t : f;\n\treturn VectorOps.select[f.kind](f, t, cond);\n}\n/**\n* Returns `t` if `cond` is `true`, and `f` otherwise.\n* Component-wise if `cond` is a vector.\n* @example\n* select(1, 2, false) // returns 1\n* select(1, 2, true) // returns 2\n* select(vec2i(1, 2), vec2i(3, 4), true) // returns vec2i(3, 4)\n* select(vec2i(1, 2), vec2i(3, 4), vec2b(false, true)) // returns vec2i(1, 4)\n*/\nconst select = dualImpl({\n\tname: \"select\",\n\tsignature: (f, t, cond) => {\n\t\tconst [uf, ut] = unify([f, t]) ?? [f, t];\n\t\treturn {\n\t\t\targTypes: [\n\t\t\t\tuf,\n\t\t\t\tut,\n\t\t\t\tcond\n\t\t\t],\n\t\t\treturnType: uf\n\t\t};\n\t},\n\tnormalImpl: cpuSelect,\n\tcodegenImpl: (_ctx, [f, t, cond]) => stitch`select(${f}, ${t}, ${cond})`\n});\n\n//#endregion\nexport { all, allEq, and, any, eq, ge, gt, isCloseTo, le, lt, ne, not, or, select };","import { $getNameForward, $internal } from \"../../shared/symbols.js\";\nimport { setName } from \"../../shared/meta.js\";\nimport { invariant } from \"../../errors.js\";\nimport { isAccessor, isMutableAccessor } from \"../slot/slotTypes.js\";\nimport { u32 } from \"../../data/numeric.js\";\nimport { vec3f, vec3u } from \"../../data/vector.js\";\nimport { fn } from \"../function/tgpuFn.js\";\nimport { ConfigurableImpl } from \"./configurableImpl.js\";\nimport { INTERNAL_createBuffer, isBuffer } from \"../buffer/buffer.js\";\nimport { INTERNAL_createComparisonSampler, INTERNAL_createSampler, isComparisonSampler, isSampler } from \"../sampler/sampler.js\";\nimport { clearTextureUtilsCache } from \"../texture/textureUtils.js\";\nimport { INTERNAL_createTexture, isTexture, isTextureView } from \"../texture/texture.js\";\nimport { TgpuBindGroupImpl, isBindGroup, isBindGroupLayout } from \"../../tgpuBindGroupLayout.js\";\nimport { ceil } from \"../../std/numeric.js\";\nimport { isComputePipeline, isRenderPipeline } from \"../pipeline/typeGuards.js\";\nimport { builtin } from \"../../builtin.js\";\nimport { INTERNAL_createQuerySet, isQuerySet } from \"../querySet/querySet.js\";\nimport { WeakMemo } from \"../../memo.js\";\nimport { TgpuBufferShorthandImpl } from \"../buffer/bufferShorthand.js\";\nimport { computeFn } from \"../function/tgpuComputeFn.js\";\nimport { applyBindGroups, applyVertexBuffers } from \"../pipeline/applyPipelineState.js\";\nimport { INTERNAL_createComputePipeline } from \"../pipeline/computePipeline.js\";\nimport { isVertexLayout } from \"../vertexLayout/vertexLayout.js\";\nimport { INTERNAL_createRenderPipeline } from \"../pipeline/renderPipeline.js\";\nimport { allEq } from \"../../std/boolean.js\";\n\n//#region src/core/root/init.ts\n/**\n* Changes the given array to a vec of 3 numbers, filling missing values with 1.\n*/\nfunction toVec3(arr) {\n\tif (arr.includes(0)) throw new Error(\"Size and workgroupSize cannot contain zeroes.\");\n\treturn vec3u(arr[0] ?? 1, arr[1] ?? 1, arr[2] ?? 1);\n}\nconst workgroupSizeConfigs = [\n\tvec3u(1, 1, 1),\n\tvec3u(256, 1, 1),\n\tvec3u(16, 16, 1),\n\tvec3u(8, 8, 4)\n];\nvar TgpuGuardedComputePipelineImpl = class TgpuGuardedComputePipelineImpl {\n\t#root;\n\t#pipeline;\n\t#sizeUniform;\n\t#workgroupSize;\n\t#lastSize;\n\tconstructor(root, pipeline, sizeUniform, workgroupSize) {\n\t\tthis.#root = root;\n\t\tthis.#pipeline = pipeline;\n\t\tthis.#sizeUniform = sizeUniform;\n\t\tthis.#workgroupSize = workgroupSize;\n\t\tthis.#lastSize = vec3u();\n\t}\n\twith(bindGroup) {\n\t\treturn new TgpuGuardedComputePipelineImpl(this.#root, this.#pipeline.with(bindGroup), this.#sizeUniform, this.#workgroupSize);\n\t}\n\tdispatchThreads(...threads) {\n\t\tconst sanitizedSize = toVec3(threads);\n\t\tconst workgroupCount = ceil(vec3f(sanitizedSize).div(vec3f(this.#workgroupSize)));\n\t\tif (!allEq(sanitizedSize, this.#lastSize)) {\n\t\t\tthis.#lastSize = sanitizedSize;\n\t\t\tthis.#sizeUniform.write(sanitizedSize);\n\t\t}\n\t\tthis.#pipeline.dispatchWorkgroups(workgroupCount.x, workgroupCount.y, workgroupCount.z);\n\t}\n\tget pipeline() {\n\t\treturn this.#pipeline;\n\t}\n\tget sizeUniform() {\n\t\treturn this.#sizeUniform;\n\t}\n\t[$internal] = true;\n\tget [$getNameForward]() {\n\t\treturn this.#pipeline;\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t}\n};\nvar WithBindingImpl = class WithBindingImpl {\n\tconstructor(_getRoot, _slotBindings) {\n\t\tthis._getRoot = _getRoot;\n\t\tthis._slotBindings = _slotBindings;\n\t}\n\twith(slot, value) {\n\t\treturn new WithBindingImpl(this._getRoot, [...this._slotBindings, [isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot, value]]);\n\t}\n\twithCompute(entryFn) {\n\t\treturn new WithComputeImpl(this._getRoot(), this._slotBindings, entryFn);\n\t}\n\tcreateComputePipeline(descriptor) {\n\t\treturn INTERNAL_createComputePipeline(this._getRoot(), this._slotBindings, descriptor);\n\t}\n\tcreateRenderPipeline(descriptor) {\n\t\treturn INTERNAL_createRenderPipeline({\n\t\t\troot: this._getRoot(),\n\t\t\tslotBindings: this._slotBindings,\n\t\t\tdescriptor\n\t\t});\n\t}\n\tcreateGuardedComputePipeline(callback) {\n\t\tconst root = this._getRoot();\n\t\tif (callback.length >= 4) throw new Error(\"Guarded compute callback only supports up to three dimensions.\");\n\t\tconst workgroupSize = workgroupSizeConfigs[callback.length];\n\t\tconst wrappedCallback = fn([\n\t\t\tu32,\n\t\t\tu32,\n\t\t\tu32\n\t\t])(callback);\n\t\tconst sizeUniform = root.createUniform(vec3u);\n\t\tconst mainCompute = computeFn({\n\t\t\tworkgroupSize,\n\t\t\tin: { id: builtin.globalInvocationId }\n\t\t})`{\n if (any(in.id >= sizeUniform)) {\n return;\n }\n wrappedCallback(in.id.x, in.id.y, in.id.z);\n}`.$uses({\n\t\t\tsizeUniform,\n\t\t\twrappedCallback\n\t\t});\n\t\treturn new TgpuGuardedComputePipelineImpl(root, this.createComputePipeline({ compute: mainCompute }), sizeUniform, workgroupSize);\n\t}\n\twithVertex(entryFn, attribs) {\n\t\treturn new WithVertexImpl(this._getRoot(), this._slotBindings, {\n\t\t\tvertex: entryFn,\n\t\t\tattribs\n\t\t});\n\t}\n\tpipe(transform) {\n\t\tconst newCfg = transform(new ConfigurableImpl([]));\n\t\treturn new WithBindingImpl(this._getRoot, [...this._slotBindings, ...newCfg.bindings]);\n\t}\n};\nvar WithComputeImpl = class {\n\tconstructor(_root, _slotBindings, _entryFn) {\n\t\tthis._root = _root;\n\t\tthis._slotBindings = _slotBindings;\n\t\tthis._entryFn = _entryFn;\n\t}\n\tcreatePipeline() {\n\t\treturn INTERNAL_createComputePipeline(this._root, this._slotBindings, { compute: this._entryFn });\n\t}\n};\nvar WithVertexImpl = class WithVertexImpl {\n\t#root;\n\t#slotBindings;\n\t#partialDescriptor;\n\tconstructor(root, slotBindings, partialDescriptor) {\n\t\tthis.#root = root;\n\t\tthis.#slotBindings = slotBindings;\n\t\tthis.#partialDescriptor = partialDescriptor;\n\t}\n\twithFragment(fragmentFn, targets, _mismatch) {\n\t\tinvariant(typeof fragmentFn !== \"string\", \"Just type mismatch validation\");\n\t\tinvariant(targets === void 0 || typeof targets !== \"string\", \"Just type mismatch validation\");\n\t\treturn new WithFragmentImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#partialDescriptor,\n\t\t\tfragment: fragmentFn,\n\t\t\ttargets\n\t\t});\n\t}\n\twithPrimitive(primitive) {\n\t\treturn new WithVertexImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#partialDescriptor,\n\t\t\tprimitive\n\t\t});\n\t}\n\twithDepthStencil(depthStencil) {\n\t\treturn new WithVertexImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#partialDescriptor,\n\t\t\tdepthStencil\n\t\t});\n\t}\n\twithMultisample(multisample) {\n\t\treturn new WithVertexImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#partialDescriptor,\n\t\t\tmultisample\n\t\t});\n\t}\n\tcreatePipeline() {\n\t\treturn INTERNAL_createRenderPipeline({\n\t\t\troot: this.#root,\n\t\t\tslotBindings: this.#slotBindings,\n\t\t\tdescriptor: this.#partialDescriptor\n\t\t});\n\t}\n};\nvar WithFragmentImpl = class WithFragmentImpl {\n\t#root;\n\t#slotBindings;\n\t#descriptor;\n\tconstructor(root, slotBindings, descriptor) {\n\t\tthis.#root = root;\n\t\tthis.#slotBindings = slotBindings;\n\t\tthis.#descriptor = descriptor;\n\t}\n\twithPrimitive(primitive) {\n\t\treturn new WithFragmentImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#descriptor,\n\t\t\tprimitive\n\t\t});\n\t}\n\twithDepthStencil(depthStencil) {\n\t\treturn new WithFragmentImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#descriptor,\n\t\t\tdepthStencil\n\t\t});\n\t}\n\twithMultisample(multisample) {\n\t\treturn new WithFragmentImpl(this.#root, this.#slotBindings, {\n\t\t\t...this.#descriptor,\n\t\t\tmultisample\n\t\t});\n\t}\n\tcreatePipeline() {\n\t\treturn INTERNAL_createRenderPipeline({\n\t\t\troot: this.#root,\n\t\t\tslotBindings: this.#slotBindings,\n\t\t\tdescriptor: this.#descriptor\n\t\t});\n\t}\n};\n/**\n* Holds all data that is necessary to facilitate CPU and GPU communication.\n* Programs that share a root can interact via GPU buffers.\n*/\nvar TgpuRootImpl = class extends WithBindingImpl {\n\t\"~unstable\";\n\t_unwrappedBindGroupLayouts = new WeakMemo((key) => key.unwrap(this));\n\t_unwrappedBindGroups = new WeakMemo((key) => key.unwrap(this));\n\t[$internal];\n\tconstructor(device, nameRegistrySetting, _ownDevice, logOptions, shaderGenerator) {\n\t\tsuper(() => this, []);\n\t\tthis.device = device;\n\t\tthis.nameRegistrySetting = nameRegistrySetting;\n\t\tthis._ownDevice = _ownDevice;\n\t\tthis.shaderGenerator = shaderGenerator;\n\t\tthis[\"~unstable\"] = this;\n\t\tthis[$internal] = { logOptions };\n\t}\n\tconfigureContext(options) {\n\t\tconst context = options.canvas.getContext(\"webgpu\");\n\t\tif (!context) throw new Error(\"Unable to initialize 'webgpu' context on the provided canvas.\");\n\t\tcontext.configure({\n\t\t\t...options,\n\t\t\tdevice: this.device,\n\t\t\tformat: options.format ?? navigator.gpu.getPreferredCanvasFormat()\n\t\t});\n\t\treturn context;\n\t}\n\tget enabledFeatures() {\n\t\treturn new Set(this.device.features);\n\t}\n\tcreateBuffer(typeSchema, initialOrBuffer) {\n\t\treturn INTERNAL_createBuffer(this, typeSchema, initialOrBuffer);\n\t}\n\tcreateUniform(typeSchema, initialOrBuffer) {\n\t\treturn new TgpuBufferShorthandImpl(\"uniform\", INTERNAL_createBuffer(this, typeSchema, initialOrBuffer).$usage(\"uniform\"));\n\t}\n\tcreateMutable(typeSchema, initialOrBuffer) {\n\t\treturn new TgpuBufferShorthandImpl(\"mutable\", INTERNAL_createBuffer(this, typeSchema, initialOrBuffer).$usage(\"storage\"));\n\t}\n\tcreateReadonly(typeSchema, initialOrBuffer) {\n\t\treturn new TgpuBufferShorthandImpl(\"readonly\", INTERNAL_createBuffer(this, typeSchema, initialOrBuffer).$usage(\"storage\"));\n\t}\n\tcreateQuerySet(type, count, rawQuerySet) {\n\t\treturn INTERNAL_createQuerySet(this, type, count, rawQuerySet);\n\t}\n\tcreateBindGroup(layout, entries) {\n\t\treturn new TgpuBindGroupImpl(layout, entries);\n\t}\n\tdestroy() {\n\t\tclearTextureUtilsCache(this.device);\n\t\tif (this._ownDevice) this.device.destroy();\n\t}\n\tcreateTexture(props) {\n\t\treturn INTERNAL_createTexture(props, this);\n\t}\n\tcreateSampler(props) {\n\t\treturn INTERNAL_createSampler(props, this);\n\t}\n\tcreateComparisonSampler(props) {\n\t\treturn INTERNAL_createComparisonSampler(props, this);\n\t}\n\tunwrap(resource) {\n\t\tif (isComputePipeline(resource)) return resource[$internal].rawPipeline;\n\t\tif (isRenderPipeline(resource)) return resource[$internal].core.unwrap().pipeline;\n\t\tif (isBindGroupLayout(resource)) return this._unwrappedBindGroupLayouts.getOrMake(resource);\n\t\tif (isBindGroup(resource)) return this._unwrappedBindGroups.getOrMake(resource);\n\t\tif (isBuffer(resource)) return resource.buffer;\n\t\tif (isTexture(resource)) return resource[$internal].unwrap();\n\t\tif (isTextureView(resource)) {\n\t\t\tif (!resource[$internal].unwrap) throw new Error(\"Cannot unwrap laid-out texture view as it has no underlying resource.\");\n\t\t\treturn resource[$internal].unwrap();\n\t\t}\n\t\tif (isVertexLayout(resource)) return resource.vertexLayout;\n\t\tif (isSampler(resource) || isComparisonSampler(resource)) {\n\t\t\tif (resource[$internal].unwrap) return resource[$internal].unwrap();\n\t\t\tthrow new Error(\"Cannot unwrap laid-out sampler.\");\n\t\t}\n\t\tif (isQuerySet(resource)) return resource.querySet;\n\t\tthrow new Error(`Unknown resource type: ${resource}`);\n\t}\n\tcreateDrawablePassProxy(encoder) {\n\t\tconst bindGroups = /* @__PURE__ */ new Map();\n\t\tconst vertexBuffers = /* @__PURE__ */ new Map();\n\t\tlet currentPipeline;\n\t\tlet dirty = true;\n\t\tconst applyPipelineState = () => {\n\t\t\tif (!currentPipeline) throw new Error(\"Cannot draw without a call to pass.setPipeline\");\n\t\t\tif (!dirty) return;\n\t\t\tdirty = false;\n\t\t\tconst { core, priors } = currentPipeline[$internal];\n\t\t\tconst memo = core.unwrap();\n\t\t\tencoder.setPipeline(memo.pipeline);\n\t\t\tapplyBindGroups(encoder, this, memo.usedBindGroupLayouts, memo.catchall, (layout) => priors.bindGroupLayoutMap?.get(layout) ?? bindGroups.get(layout));\n\t\t\tapplyVertexBuffers(encoder, this, memo.usedVertexLayouts, (vertexLayout) => {\n\t\t\t\tconst priorBuffer = priors.vertexLayoutMap?.get(vertexLayout);\n\t\t\t\treturn priorBuffer ? {\n\t\t\t\t\tbuffer: priorBuffer,\n\t\t\t\t\toffset: void 0,\n\t\t\t\t\tsize: void 0\n\t\t\t\t} : vertexBuffers.get(vertexLayout);\n\t\t\t});\n\t\t};\n\t\treturn {\n\t\t\tsetPipeline(pipeline) {\n\t\t\t\tcurrentPipeline = pipeline;\n\t\t\t\tdirty = true;\n\t\t\t},\n\t\t\tsetIndexBuffer: (buffer, indexFormat, offset, size) => {\n\t\t\t\tif (isBuffer(buffer)) encoder.setIndexBuffer(this.unwrap(buffer), indexFormat, offset, size);\n\t\t\t\telse encoder.setIndexBuffer(buffer, indexFormat, offset, size);\n\t\t\t},\n\t\t\tsetVertexBuffer(vertexLayout, buffer, offset, size) {\n\t\t\t\tvertexBuffers.set(vertexLayout, {\n\t\t\t\t\tbuffer,\n\t\t\t\t\toffset,\n\t\t\t\t\tsize\n\t\t\t\t});\n\t\t\t\tdirty = true;\n\t\t\t},\n\t\t\tsetBindGroup(bindGroupLayout, bindGroup) {\n\t\t\t\tbindGroups.set(bindGroupLayout, bindGroup);\n\t\t\t\tdirty = true;\n\t\t\t},\n\t\t\tdraw(vertexCount, instanceCount, firstVertex, firstInstance) {\n\t\t\t\tapplyPipelineState();\n\t\t\t\tencoder.draw(vertexCount, instanceCount, firstVertex, firstInstance);\n\t\t\t},\n\t\t\tdrawIndexed(...args) {\n\t\t\t\tapplyPipelineState();\n\t\t\t\tencoder.drawIndexed(...args);\n\t\t\t},\n\t\t\tdrawIndirect(...args) {\n\t\t\t\tapplyPipelineState();\n\t\t\t\tencoder.drawIndirect(...args);\n\t\t\t},\n\t\t\tdrawIndexedIndirect(...args) {\n\t\t\t\tapplyPipelineState();\n\t\t\t\tencoder.drawIndexedIndirect(...args);\n\t\t\t}\n\t\t};\n\t}\n\tbeginRenderPass(descriptor, callback) {\n\t\tconst commandEncoder = this.device.createCommandEncoder();\n\t\tconst pass = commandEncoder.beginRenderPass(descriptor);\n\t\tcallback({\n\t\t\tsetViewport(...args) {\n\t\t\t\tpass.setViewport(...args);\n\t\t\t},\n\t\t\tsetScissorRect(...args) {\n\t\t\t\tpass.setScissorRect(...args);\n\t\t\t},\n\t\t\tsetBlendConstant(...args) {\n\t\t\t\tpass.setBlendConstant(...args);\n\t\t\t},\n\t\t\tsetStencilReference(...args) {\n\t\t\t\tpass.setStencilReference(...args);\n\t\t\t},\n\t\t\tbeginOcclusionQuery(...args) {\n\t\t\t\tpass.beginOcclusionQuery(...args);\n\t\t\t},\n\t\t\tendOcclusionQuery(...args) {\n\t\t\t\tpass.endOcclusionQuery(...args);\n\t\t\t},\n\t\t\texecuteBundles(...args) {\n\t\t\t\tpass.executeBundles(...args);\n\t\t\t},\n\t\t\t...this.createDrawablePassProxy(pass)\n\t\t});\n\t\tpass.end();\n\t\tthis.device.queue.submit([commandEncoder.finish()]);\n\t}\n\tbeginRenderBundleEncoder(descriptor, callback) {\n\t\tconst bundleEncoder = this.device.createRenderBundleEncoder(descriptor);\n\t\tcallback(this.createDrawablePassProxy(bundleEncoder));\n\t\treturn bundleEncoder.finish();\n\t}\n\tflush() {\n\t\tconsole.warn(\"flush() has been deprecated, and has no effect.\");\n\t}\n};\n/**\n* Requests a new GPU device and creates a root around it.\n* If a specific device should be used instead, use @see initFromDevice.\n*\n* @example\n* When given no options, the function will ask the browser for a suitable GPU device.\n* ```ts\n* const root = await tgpu.init();\n* ```\n*\n* @example\n* If there are specific options that should be used when requesting a device, you can pass those in.\n* ```ts\n* const adapterOptions: GPURequestAdapterOptions = ...;\n* const deviceDescriptor: GPUDeviceDescriptor = ...;\n* const root = await tgpu.init({ adapter: adapterOptions, device: deviceDescriptor });\n* ```\n*/\nasync function init(options) {\n\tconst { adapter: adapterOpt, device: deviceOpt, unstable_names: names = \"strict\", unstable_logOptions } = options ?? {};\n\tif (!navigator.gpu) throw new Error(\"WebGPU is not supported by this browser.\");\n\tconst adapter = await navigator.gpu.requestAdapter(adapterOpt);\n\tif (!adapter) throw new Error(\"Could not find a compatible GPU\");\n\tconst availableFeatures = [];\n\tfor (const feature of deviceOpt?.requiredFeatures ?? []) {\n\t\tif (!adapter.features.has(feature)) throw new Error(`Requested feature \"${feature}\" is not supported by the adapter.`);\n\t\tavailableFeatures.push(feature);\n\t}\n\tfor (const feature of deviceOpt?.optionalFeatures ?? []) if (adapter.features.has(feature)) availableFeatures.push(feature);\n\telse console.warn(`Optional feature \"${feature}\" is not supported by the adapter.`);\n\treturn new TgpuRootImpl(await adapter.requestDevice({\n\t\t...deviceOpt,\n\t\trequiredFeatures: availableFeatures\n\t}), names, true, unstable_logOptions ?? {}, options?.shaderGenerator);\n}\n/**\n* Creates a root from the given device, instead of requesting it like @see init.\n*\n* @example\n* ```ts\n* const device: GPUDevice = ...;\n* const root = tgpu.initFromDevice({ device });\n* ```\n*/\nfunction initFromDevice(options) {\n\tconst { device, unstable_names: names = \"strict\", unstable_logOptions } = options ?? {};\n\treturn new TgpuRootImpl(device, names, false, unstable_logOptions ?? {}, options?.shaderGenerator);\n}\n\n//#endregion\nexport { init, initFromDevice };","import { $gpuValueOf, $internal, $providing } from \"../../shared/symbols.js\";\nimport { isAccessor, isMutableAccessor } from \"./slotTypes.js\";\nimport { getResolutionCtx } from \"../../execMode.js\";\nimport { getGpuValueRecursively } from \"../valueProxyUtils.js\";\n\n//#region src/core/slot/lazy.ts\nfunction lazy(compute) {\n\tif (getResolutionCtx()) throw new Error(\"Cannot create tgpu.lazy objects during shader resolution.\");\n\treturn new TgpuLazyImpl(compute, void 0);\n}\nvar TgpuLazyImpl = class TgpuLazyImpl {\n\t[$internal];\n\t[$providing];\n\tconstructor(compute, providing) {\n\t\tthis[$internal] = { compute };\n\t\tthis[$providing] = providing;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst ctx = getResolutionCtx();\n\t\tif (!ctx) throw new Error(`Cannot access tgpu.lazy's value outside of resolution.`);\n\t\treturn getGpuValueRecursively(ctx.unwrap(this));\n\t}\n\tget value() {\n\t\treturn this[$gpuValueOf];\n\t}\n\tget $() {\n\t\treturn this[$gpuValueOf];\n\t}\n\ttoString() {\n\t\treturn \"lazy\";\n\t}\n\twith(slot, value) {\n\t\treturn new TgpuLazyImpl(this[$internal].compute.bind(this), {\n\t\t\tinner: this[$providing]?.inner ?? this,\n\t\t\tpairs: [...this[$providing]?.pairs ?? [], [isAccessor(slot) || isMutableAccessor(slot) ? slot.slot : slot, value]]\n\t\t});\n\t}\n};\nTgpuLazyImpl.prototype.resourceType = \"lazy\";\n\n//#endregion\nexport { lazy };","import { $getNameForward, $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { getName, hasTinyestMetadata, setName } from \"../../shared/meta.js\";\nimport { isData } from \"../../data/dataTypes.js\";\nimport { isSnippet, snip } from \"../../data/snippet.js\";\nimport { NormalState, getOwnSnippet } from \"../../types.js\";\nimport { getResolutionCtx, inCodegenMode } from \"../../execMode.js\";\nimport { schemaCallWrapper } from \"../../data/schemaCallWrapper.js\";\nimport { getGpuValueRecursively, valueProxyHandler } from \"../valueProxyUtils.js\";\nimport { isTgpuFn } from \"../function/tgpuFn.js\";\nimport { slot } from \"./slot.js\";\n\n//#region src/core/slot/accessor.ts\nfunction accessor(schemaOrConstructor, defaultValue) {\n\treturn new TgpuAccessorImpl(schemaOrConstructor, defaultValue);\n}\nfunction mutableAccessor(schemaOrConstructor, defaultValue) {\n\treturn new TgpuMutableAccessorImpl(schemaOrConstructor, defaultValue);\n}\nvar AccessorBase = class {\n\t[$internal] = true;\n\t[$getNameForward];\n\tslot;\n\tschema;\n\tdefaultValue;\n\tconstructor(schemaOrConstructor, defaultValue = void 0) {\n\t\tthis.schema = isData(schemaOrConstructor) ? schemaOrConstructor : schemaOrConstructor(0);\n\t\tthis.defaultValue = defaultValue;\n\t\tthis.slot = slot(defaultValue);\n\t\tthis[$getNameForward] = this.slot;\n\t}\n\tget [$gpuValueOf]() {\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\t[$ownSnippet]: this.#createSnippet(),\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `${this.resourceType}:${getName(this) ?? \"<unnamed>\"}.$`\n\t\t}, valueProxyHandler);\n\t}\n\t/**\n\t* @returns A snippet representing the accessor.\n\t*/\n\t#createSnippet() {\n\t\tconst ctx = getResolutionCtx();\n\t\tlet value = getGpuValueRecursively(ctx.unwrap(this.slot));\n\t\twhile (typeof value === \"function\" && !isTgpuFn(value) && !hasTinyestMetadata(value)) {\n\t\t\tvalue = value();\n\t\t\tif (isSnippet(value)) value = value.value;\n\t\t}\n\t\tconst ownSnippet = getOwnSnippet(value);\n\t\tif (ownSnippet) return ownSnippet;\n\t\tif (isTgpuFn(value) || hasTinyestMetadata(value)) return ctx.withResetIndentLevel(() => snip(`${ctx.resolve(value).value}()`, this.schema, \"runtime\"));\n\t\tctx.pushMode(new NormalState());\n\t\ttry {\n\t\t\treturn snip(schemaCallWrapper(this.schema, value), this.schema, \"constant\");\n\t\t} finally {\n\t\t\tctx.popMode(\"normal\");\n\t\t}\n\t}\n\t$name(label) {\n\t\tsetName(this, label);\n\t\tif (this.defaultValue && typeof this.defaultValue === \"function\" && !getName(this.defaultValue)) setName(this.defaultValue, label);\n\t\treturn this;\n\t}\n\ttoString() {\n\t\treturn `${this.resourceType}:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n\t[$resolve](ctx) {\n\t\tconst snippet = this.#createSnippet();\n\t\treturn snip(ctx.resolve(snippet.value, snippet.dataType).value, snippet.dataType, snippet.origin);\n\t}\n};\nvar TgpuAccessorImpl = class extends AccessorBase {\n\tresourceType = \"accessor\";\n\tconstructor(schemaOrConstructor, defaultValue = void 0) {\n\t\tsuper(schemaOrConstructor, defaultValue);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"`tgpu.accessor` relies on GPU resources and cannot be accessed outside of a compute dispatch or draw call\");\n\t}\n};\nvar TgpuMutableAccessorImpl = class extends AccessorBase {\n\tresourceType = \"mutable-accessor\";\n\tconstructor(schemaOrConstructor, defaultValue = void 0) {\n\t\tsuper(schemaOrConstructor, defaultValue);\n\t}\n\tget $() {\n\t\tif (inCodegenMode()) return this[$gpuValueOf];\n\t\tthrow new Error(\"`tgpu.mutableAccessor` relies on GPU resources and cannot be accessed outside of a compute dispatch or draw call\");\n\t}\n};\n\n//#endregion\nexport { accessor, mutableAccessor };","import { $internal, $resolve } from \"../../shared/symbols.js\";\nimport { Void } from \"../../data/wgslTypes.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { applyExternals, replaceExternalsInWgsl } from \"../resolve/externals.js\";\n\n//#region src/core/declare/tgpuDeclare.ts\n/**\n* Allows defining extra declarations that shall be included in the final WGSL code,\n* when resolving objects that use them.\n*\n* Using this API is generally discouraged, as it shouldn't be necessary in any common scenario.\n* It was developed to ensure full compatibility of TypeGPU programs with current and future versions of WGSL.\n*/\nfunction declare(declaration) {\n\treturn new TgpuDeclareImpl(declaration);\n}\nvar TgpuDeclareImpl = class {\n\t[$internal] = true;\n\texternalsToApply = [];\n\tconstructor(declaration) {\n\t\tthis.declaration = declaration;\n\t}\n\t$uses(dependencyMap) {\n\t\tthis.externalsToApply.push(dependencyMap);\n\t\treturn this;\n\t}\n\t[$resolve](ctx) {\n\t\tconst externalMap = {};\n\t\tfor (const externals of this.externalsToApply) applyExternals(externalMap, externals);\n\t\tconst replacedDeclaration = replaceExternalsInWgsl(ctx, externalMap, this.declaration);\n\t\tctx.addDeclaration(replacedDeclaration);\n\t\treturn snip(\"\", Void, \"constant\");\n\t}\n\ttoString() {\n\t\treturn `declare: ${this.declaration}`;\n\t}\n};\n\n//#endregion\nexport { declare };","import { $gpuValueOf, $internal, $ownSnippet, $resolve } from \"../../shared/symbols.js\";\nimport { snip } from \"../../data/snippet.js\";\nimport { inCodegenMode } from \"../../execMode.js\";\nimport { valueProxyHandler } from \"../valueProxyUtils.js\";\nimport { applyExternals, replaceExternalsInWgsl } from \"../resolve/externals.js\";\n\n//#region src/core/rawCodeSnippet/tgpuRawCodeSnippet.ts\n/**\n* An advanced API that creates a typed shader expression which\n* can be injected into the final shader bundle upon use.\n*\n* @param expression The code snippet that will be injected in place of `foo.$`\n* @param type The type of the expression\n* @param [origin='runtime'] Where the value originates from.\n*\n* **-- Which origin to choose?**\n*\n* Usually 'runtime' (the default) is a safe bet, but if you're sure that the expression or\n* computation is constant (either a reference to a constant, a numeric literal,\n* or an operation on constants), then pass 'constant' as it might lead to better\n* optimizations.\n*\n* If what the expression is a direct reference to an existing value (e.g. a uniform, a\n* storage binding, ...), then choose from 'uniform', 'mutable', 'readonly', 'workgroup',\n* 'private' or 'handle' depending on the address space of the referred value.\n*\n* @example\n* ```ts\n* // An identifier that we know will be in the\n* // final shader bundle, but we cannot\n* // refer to it in any other way.\n* const existingGlobal = tgpu['~unstable']\n* .rawCodeSnippet('EXISTING_GLOBAL', d.f32, 'constant');\n*\n* const foo = () => {\n* 'use gpu';\n* return existingGlobal.$ * 2;\n* };\n*\n* const wgsl = tgpu.resolve([foo]);\n* // fn foo() -> f32 {\n* // return EXISTING_GLOBAL * 2;\n* // }\n* ```\n*/\nfunction rawCodeSnippet(expression, type, origin = \"runtime\") {\n\treturn new TgpuRawCodeSnippetImpl(expression, type, origin);\n}\nvar TgpuRawCodeSnippetImpl = class {\n\t[$internal];\n\tdataType;\n\torigin;\n\t#expression;\n\t#externalsToApply;\n\tconstructor(expression, type, origin) {\n\t\tthis[$internal] = true;\n\t\tthis.dataType = type;\n\t\tthis.origin = origin;\n\t\tthis.#expression = expression;\n\t\tthis.#externalsToApply = [];\n\t}\n\t$uses(dependencyMap) {\n\t\tthis.#externalsToApply.push(dependencyMap);\n\t\treturn this;\n\t}\n\t[$resolve](ctx) {\n\t\tconst externalMap = {};\n\t\tfor (const externals of this.#externalsToApply) applyExternals(externalMap, externals);\n\t\treturn snip(replaceExternalsInWgsl(ctx, externalMap, this.#expression), this.dataType, this.origin);\n\t}\n\ttoString() {\n\t\treturn `raw(${String(this.dataType)}): \"${this.#expression}\"`;\n\t}\n\tget [$gpuValueOf]() {\n\t\tconst dataType = this.dataType;\n\t\tconst origin = this.origin;\n\t\treturn new Proxy({\n\t\t\t[$internal]: true,\n\t\t\tget [$ownSnippet]() {\n\t\t\t\treturn snip(this, dataType, origin);\n\t\t\t},\n\t\t\t[$resolve]: (ctx) => ctx.resolve(this),\n\t\t\ttoString: () => `raw(${String(this.dataType)}): \"${this.#expression}\".$`\n\t\t}, valueProxyHandler);\n\t}\n\tget $() {\n\t\tif (!inCodegenMode()) throw new Error(\"Raw code snippets can only be used on the GPU.\");\n\t\treturn this[$gpuValueOf];\n\t}\n\tget value() {\n\t\treturn this.$;\n\t}\n};\n\n//#endregion\nexport { rawCodeSnippet };","import { SimulationState } from \"../../types.js\";\nimport { getResolutionCtx, provideCtx } from \"../../execMode.js\";\nimport { namespace } from \"../resolve/namespace.js\";\nimport wgslGenerator from \"../../tgsl/wgslGenerator.js\";\nimport { ResolutionCtxImpl } from \"../../resolutionCtx.js\";\n\n//#region src/core/simulate/tgpuSimulate.ts\n/**\n* Runs the provided callback in a simulated environment, giving\n* it access to buffers and variables as if it were running on the GPU.\n*\n* The result of the simulation is returned, and does not affect the actual GPU state,\n* nor does it carry over to other simulations.\n*\n* @param callback The callback to run in the simulated environment.\n* @returns An object containing the result of the simulation, and\n* the final state of the environment.\n*\n* @example\n* const counter = tgpu.privateVar(d.u32);\n*\n* const result = tgpu.simulate(() => {\n* counter.$ += 1;\n* counter.$ += 2;\n* return counter.$;\n* });\n*\n* console.log(result.value); // 3\n*/\nfunction simulate(callback) {\n\tconst ctx = getResolutionCtx() ?? new ResolutionCtxImpl({\n\t\tnamespace: namespace(),\n\t\tshaderGenerator: wgslGenerator\n\t});\n\tconst workgroups = [\n\t\t1,\n\t\t1,\n\t\t1\n\t];\n\tconst workgroupSize = [\n\t\t1,\n\t\t1,\n\t\t1\n\t];\n\tconst threads = [\n\t\tworkgroups[0] * workgroupSize[0],\n\t\tworkgroups[1] * workgroupSize[1],\n\t\tworkgroups[2] * workgroupSize[2]\n\t];\n\tconst buffers = /* @__PURE__ */ new Map();\n\tconst workgroupVars = Array.from({ length: workgroups[0] }, () => Array.from({ length: workgroups[1] }, () => Array.from({ length: workgroups[2] }, () => /* @__PURE__ */ new Map())));\n\tconst privateVars = Array.from({ length: threads[0] }, () => Array.from({ length: threads[1] }, () => Array.from({ length: threads[2] }, () => /* @__PURE__ */ new Map())));\n\tconst simStates = Array.from({ length: threads[0] }, (_, i) => Array.from({ length: threads[1] }, (_, j) => Array.from({ length: threads[2] }, (_, k) => {\n\t\tconst wi = Math.floor(i / workgroupSize[0]);\n\t\tconst wj = Math.floor(j / workgroupSize[1]);\n\t\tconst wk = Math.floor(k / workgroupSize[2]);\n\t\treturn new SimulationState(buffers, {\n\t\t\tprivate: privateVars[i][j][k],\n\t\t\tworkgroup: workgroupVars[wi][wj][wk]\n\t\t});\n\t})));\n\tctx.pushMode(simStates[0][0][0]);\n\ttry {\n\t\treturn {\n\t\t\tvalue: provideCtx(ctx, callback),\n\t\t\tbuffers,\n\t\t\tprivateVars,\n\t\t\tworkgroupVars\n\t\t};\n\t} finally {\n\t\tctx.popMode(\"simulate\");\n\t}\n}\n\n//#endregion\nexport { simulate };","import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { comptime } from \"./core/function/comptime.js\";\nimport { constant } from \"./core/constant/tgpuConstant.js\";\nimport { fn } from \"./core/function/tgpuFn.js\";\nimport { namespace } from \"./core/resolve/namespace.js\";\nimport { slot } from \"./core/slot/slot.js\";\nimport { privateVar, workgroupVar } from \"./core/variable/tgpuVariable.js\";\nimport { computeFn } from \"./core/function/tgpuComputeFn.js\";\nimport { vertexLayout } from \"./core/vertexLayout/vertexLayout.js\";\nimport { lazy } from \"./core/slot/lazy.js\";\nimport { accessor, mutableAccessor } from \"./core/slot/accessor.js\";\nimport { fragmentFn } from \"./core/function/tgpuFragmentFn.js\";\nimport { vertexFn } from \"./core/function/tgpuVertexFn.js\";\nimport { declare } from \"./core/declare/tgpuDeclare.js\";\nimport { rawCodeSnippet } from \"./core/rawCodeSnippet/tgpuRawCodeSnippet.js\";\nimport { simulate } from \"./core/simulate/tgpuSimulate.js\";\n\n//#region src/tgpuUnstable.ts\nvar tgpuUnstable_exports = /* @__PURE__ */ __exportAll({\n\taccessor: () => _accessor,\n\tcomptime: () => _comptime,\n\tcomputeFn: () => _computeFn,\n\tconst: () => _constant,\n\tdeclare: () => declare,\n\tderived: () => _lazy,\n\tfn: () => _fn,\n\tfragmentFn: () => _fragmentFn,\n\tmutableAccessor: () => _mutableAccessor,\n\tnamespace: () => namespace,\n\tprivateVar: () => _privateVar,\n\trawCodeSnippet: () => rawCodeSnippet,\n\tsimulate: () => simulate,\n\tslot: () => _slot,\n\tvertexFn: () => _vertexFn,\n\tvertexLayout: () => _vertexLayout,\n\tworkgroupVar: () => _workgroupVar\n});\n/** @deprecated This feature is now stable, use tgpu.const. */\nconst _constant = constant;\n/** @deprecated This feature is now stable, use tgpu.comptime. */\nconst _comptime = comptime;\n/** @deprecated This feature is now stable, use tgpu.computeFn. */\nconst _computeFn = computeFn;\n/** @deprecated This feature is now stable, use tgpu.fn. */\nconst _fn = fn;\n/** @deprecated This feature is now stable, use tgpu.fragmentFn. */\nconst _fragmentFn = fragmentFn;\n/** @deprecated This feature is now stable, use tgpu.vertexFn. */\nconst _vertexFn = vertexFn;\n/** @deprecated This feature is now stable, use tgpu.accessor. */\nconst _accessor = accessor;\n/** @deprecated This feature is now stable, use tgpu.mutableAccessor. */\nconst _mutableAccessor = mutableAccessor;\n/** @deprecated This feature is now stable, use tgpu.lazy. */\nconst _lazy = lazy;\n/** @deprecated This feature is now stable, use tgpu.slot. */\nconst _slot = slot;\n/** @deprecated This feature is now stable, use tgpu.privateVar. */\nconst _privateVar = privateVar;\n/** @deprecated This feature is now stable, use tgpu.workgroupVar. */\nconst _workgroupVar = workgroupVar;\n/** @deprecated This feature is now stable, use tgpu.vertexLayout. */\nconst _vertexLayout = vertexLayout;\n\n//#endregion\nexport { tgpuUnstable_exports };","import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { comptime } from \"./core/function/comptime.js\";\nimport { constant } from \"./core/constant/tgpuConstant.js\";\nimport { fn } from \"./core/function/tgpuFn.js\";\nimport { bindGroupLayout } from \"./tgpuBindGroupLayout.js\";\nimport { slot } from \"./core/slot/slot.js\";\nimport { privateVar, workgroupVar } from \"./core/variable/tgpuVariable.js\";\nimport { unroll } from \"./core/unroll/tgpuUnroll.js\";\nimport { resolve, resolveWithContext } from \"./core/resolve/tgpuResolve.js\";\nimport { computeFn } from \"./core/function/tgpuComputeFn.js\";\nimport { vertexLayout } from \"./core/vertexLayout/vertexLayout.js\";\nimport { init, initFromDevice } from \"./core/root/init.js\";\nimport { lazy } from \"./core/slot/lazy.js\";\nimport { accessor, mutableAccessor } from \"./core/slot/accessor.js\";\nimport { fragmentFn } from \"./core/function/tgpuFragmentFn.js\";\nimport { vertexFn } from \"./core/function/tgpuVertexFn.js\";\nimport { tgpuUnstable_exports } from \"./tgpuUnstable.js\";\n\n//#region src/tgpu.ts\nvar tgpu_exports = /* @__PURE__ */ __exportAll({\n\taccessor: () => accessor,\n\tbindGroupLayout: () => bindGroupLayout,\n\tcomptime: () => comptime,\n\tcomputeFn: () => computeFn,\n\tconst: () => constant,\n\tfn: () => fn,\n\tfragmentFn: () => fragmentFn,\n\tinit: () => init,\n\tinitFromDevice: () => initFromDevice,\n\tlazy: () => lazy,\n\tmutableAccessor: () => mutableAccessor,\n\tprivateVar: () => privateVar,\n\tresolve: () => resolve,\n\tresolveWithContext: () => resolveWithContext,\n\tslot: () => slot,\n\tunroll: () => unroll,\n\tvertexFn: () => vertexFn,\n\tvertexLayout: () => vertexLayout,\n\tworkgroupVar: () => workgroupVar,\n\t\"~unstable\": () => tgpuUnstable_exports\n});\n\n//#endregion\nexport { tgpu_exports };","import { $internal } from \"../shared/symbols.js\";\nimport { schemaCallWrapper } from \"./schemaCallWrapper.js\";\nimport { comptime } from \"../core/function/comptime.js\";\n\n//#region src/data/disarray.ts\n/**\n* Creates an array schema that can be used to construct vertex buffers.\n* Describes arrays with fixed-size length, storing elements of the same type.\n*\n* Elements in the schema are not aligned in respect to their `byteAlignment`,\n* unless they are explicitly decorated with the custom align attribute\n* via `d.align` function.\n*\n* @example\n* const disarray = d.disarrayOf(d.vec3f, 3); // packed array of vec3f\n*\n* @example\n* const disarray = d.disarrayOf(d.align(16, d.vec3f), 3);\n*\n* If `elementCount` is not specified, a partially applied function is returned.\n* @example\n* const disarray = d.disarrayOf(d.vec3f);\n* // ^? (n: number) => Disarray<d.Vec3f>\n*\n* @param elementType The type of elements in the array.\n* @param elementCount The number of elements in the array.\n*/\nconst disarrayOf = comptime(((elementType, elementCount) => {\n\tif (elementCount === void 0) return (count) => cpu_disarrayOf(elementType, count);\n\treturn cpu_disarrayOf(elementType, elementCount);\n})).$name(\"disarrayOf\");\nfunction cpu_disarrayOf(elementType, elementCount) {\n\tconst disarraySchema = (elements) => {\n\t\tif (elements && elements.length !== elementCount) throw new Error(`Disarray schema of ${elementCount} elements of type ${elementType.type} called with ${elements.length} argument(s).`);\n\t\treturn Array.from({ length: elementCount }, (_, i) => schemaCallWrapper(elementType, elements?.[i]));\n\t};\n\tObject.setPrototypeOf(disarraySchema, DisarrayImpl);\n\tdisarraySchema.elementType = elementType;\n\tif (!Number.isInteger(elementCount) || elementCount < 0) throw new Error(`Cannot create disarray schema with invalid element count: ${elementCount}.`);\n\tdisarraySchema.elementCount = elementCount;\n\treturn disarraySchema;\n}\nconst DisarrayImpl = {\n\t[$internal]: true,\n\ttype: \"disarray\",\n\ttoString() {\n\t\treturn `disarrayOf(${this.elementType}, ${this.elementCount})`;\n\t}\n};\n\n//#endregion\nexport { disarrayOf };","import { $internal } from \"../shared/symbols.js\";\nimport { getName, setName } from \"../shared/meta.js\";\nimport { schemaCallWrapper } from \"./schemaCallWrapper.js\";\n\n//#region src/data/unstruct.ts\n/**\n* Creates a loose struct schema that can be used to construct vertex buffers.\n* Describes structs with members of both loose and non-loose types.\n*\n* The order of members matches the passed in properties object.\n* Members are not aligned in respect to their `byteAlignment`,\n* unless they are explicitly decorated with the custom align attribute\n* via `d.align` function.\n*\n* @example\n* const CircleStruct = d.unstruct({ radius: d.f32, pos: d.vec3f }); // packed struct with no padding\n*\n* @example\n* const CircleStruct = d.unstruct({ radius: d.f32, pos: d.align(16, d.vec3f) });\n*\n* @param properties Record with `string` keys and `TgpuData` or `TgpuLooseData` values,\n* each entry describing one struct member.\n*/\nfunction unstruct(properties) {\n\tconst unstructSchema = (instanceProps) => Object.fromEntries(Object.entries(properties).map(([key, schema]) => [key, schemaCallWrapper(schema, instanceProps?.[key])]));\n\tObject.setPrototypeOf(unstructSchema, UnstructImpl);\n\tunstructSchema.propTypes = properties;\n\treturn unstructSchema;\n}\nconst UnstructImpl = {\n\t[$internal]: true,\n\ttype: \"unstruct\",\n\t$name(label) {\n\t\tsetName(this, label);\n\t\treturn this;\n\t},\n\ttoString() {\n\t\treturn `unstruct:${getName(this) ?? \"<unnamed>\"}`;\n\t}\n};\n\n//#endregion\nexport { unstruct };","import { isAtomic, isDecorated, isPtr, isWgslArray, isWgslStruct } from \"./wgslTypes.js\";\nimport { isDisarray, isLooseDecorated, isUnstruct } from \"./dataTypes.js\";\n\n//#region src/data/deepEqual.ts\n/**\n* Performs a deep comparison of two TypeGPU data schemas.\n*\n* @param a The first data schema to compare.\n* @param b The second data schema to compare.\n* @returns `true` if the schemas are deeply equal, `false` otherwise.\n*\n* @example\n* ```ts\n* import { vec3f, struct, deepEqual } from 'typegpu/data';\n*\n* const schema1 = struct({ a: vec3f });\n* const schema2 = struct({ a: vec3f });\n* const schema3 = struct({ b: vec3f });\n*\n* console.log(deepEqual(schema1, schema2)); // true\n* console.log(deepEqual(schema1, schema3)); // false\n* ```\n*/\nfunction deepEqual(a, b) {\n\tif (a === b) return true;\n\tif (a.type !== b.type) return false;\n\tif (isWgslStruct(a) && isWgslStruct(b) || isUnstruct(a) && isUnstruct(b)) {\n\t\tconst aProps = a.propTypes;\n\t\tconst bProps = b.propTypes;\n\t\tconst aKeys = Object.keys(aProps);\n\t\tconst bKeys = Object.keys(bProps);\n\t\tif (aKeys.length !== bKeys.length) return false;\n\t\tfor (let i = 0; i < aKeys.length; i++) {\n\t\t\tconst keyA = aKeys[i];\n\t\t\tconst keyB = bKeys[i];\n\t\t\tif (keyA !== keyB || !keyA || !keyB || !deepEqual(aProps[keyA], bProps[keyB])) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tif (isWgslArray(a) && isWgslArray(b) || isDisarray(a) && isDisarray(b)) return a.elementCount === b.elementCount && deepEqual(a.elementType, b.elementType);\n\tif (isPtr(a) && isPtr(b)) return a.addressSpace === b.addressSpace && a.access === b.access && deepEqual(a.inner, b.inner);\n\tif (isAtomic(a) && isAtomic(b)) return deepEqual(a.inner, b.inner);\n\tif (isDecorated(a) && isDecorated(b) || isLooseDecorated(a) && isLooseDecorated(b)) {\n\t\tif (!deepEqual(a.inner, b.inner)) return false;\n\t\tif (a.attribs.length !== b.attribs.length) return false;\n\t\tconst getAttrKey = (attr) => {\n\t\t\tconst anyAttr = attr;\n\t\t\treturn `${anyAttr.type}(${(anyAttr.params ?? []).join(\",\")})`;\n\t\t};\n\t\tconst attrsA = a.attribs.map(getAttrKey);\n\t\tconst attrsB = b.attribs.map(getAttrKey);\n\t\tfor (let i = 0; i < attrsA.length; i++) if (attrsA[i] !== attrsB[i]) return false;\n\t}\n\treturn true;\n}\n\n//#endregion\nexport { deepEqual };","import { __exportAll } from \"../_virtual/_rolldown/runtime.js\";\nimport { Void, isAlignAttrib, isAtomic, isBuiltinAttrib, isDecorated, isInterpolateAttrib, isLocationAttrib, isPtr, isSizeAttrib, isWgslArray, isWgslData, isWgslStruct } from \"./wgslTypes.js\";\nimport { isData, isDisarray, isLooseData, isLooseDecorated, isUnstruct } from \"./dataTypes.js\";\nimport { ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup } from \"./ptr.js\";\nimport { _ref } from \"./ref.js\";\nimport { bool, f16, f32, i32, u16, u32 } from \"./numeric.js\";\nimport { VecBase } from \"./vectorImpl.js\";\nimport { vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u } from \"./vector.js\";\nimport { float16, float16x2, float16x4, float32, float32x2, float32x3, float32x4, formatToWGSLType, isPackedData, packedFormats, sint16, sint16x2, sint16x4, sint32, sint32x2, sint32x3, sint32x4, sint8, sint8x2, sint8x4, snorm16, snorm16x2, snorm16x4, snorm8, snorm8x2, snorm8x4, uint16, uint16x2, uint16x4, uint32, uint32x2, uint32x3, uint32x4, uint8, uint8x2, uint8x4, unorm10_10_10_2, unorm16, unorm16x2, unorm16x4, unorm8, unorm8x2, unorm8x4, unorm8x4_bgra } from \"./vertexFormatData.js\";\nimport { PUBLIC_alignmentOf } from \"./alignmentOf.js\";\nimport { PUBLIC_sizeOf } from \"./sizeOf.js\";\nimport { align, interpolate, invariant, isBuiltin, location, size } from \"./attributes.js\";\nimport { struct } from \"./struct.js\";\nimport { MatBase, mat2x2f, mat3x3f, mat4x4f, matToArray } from \"./matrix.js\";\nimport { infixOperators } from \"../tgsl/accessProp.js\";\nimport { comparisonSampler, sampler } from \"./sampler.js\";\nimport { texture1d, texture2d, texture2dArray, texture3d, textureCube, textureCubeArray, textureDepth2d, textureDepth2dArray, textureDepthCube, textureDepthCubeArray, textureDepthMultisampled2d, textureExternal, textureMultisampled2d, textureStorage1d, textureStorage2d, textureStorage2dArray, textureStorage3d } from \"./texture.js\";\nimport { arrayOf } from \"./array.js\";\nimport { atomic } from \"./atomic.js\";\nimport { builtin } from \"../builtin.js\";\nimport { PUBLIC_isContiguous } from \"./isContiguous.js\";\nimport { PUBLIC_getLongestContiguousPrefix } from \"./getLongestContiguousPrefix.js\";\nimport { memoryLayoutOf } from \"./offsetUtils.js\";\nimport { disarrayOf } from \"./disarray.js\";\nimport { unstruct } from \"./unstruct.js\";\nimport { deepEqual } from \"./deepEqual.js\";\nimport { Operator } from \"tsover-runtime\";\n\n//#region src/data/index.ts\n/**\n* @module typegpu/data\n*/\nvar data_exports = /* @__PURE__ */ __exportAll({\n\tVoid: () => Void,\n\talign: () => align,\n\talignmentOf: () => PUBLIC_alignmentOf,\n\tarrayOf: () => arrayOf,\n\tatomic: () => atomic,\n\tbool: () => bool,\n\tbuiltin: () => builtin,\n\tcomparisonSampler: () => comparisonSampler,\n\tdeepEqual: () => deepEqual,\n\tdisarrayOf: () => disarrayOf,\n\tf16: () => f16,\n\tf32: () => f32,\n\tfloat16: () => float16,\n\tfloat16x2: () => float16x2,\n\tfloat16x4: () => float16x4,\n\tfloat32: () => float32,\n\tfloat32x2: () => float32x2,\n\tfloat32x3: () => float32x3,\n\tfloat32x4: () => float32x4,\n\tformatToWGSLType: () => formatToWGSLType,\n\tgetLongestContiguousPrefix: () => PUBLIC_getLongestContiguousPrefix,\n\ti32: () => i32,\n\tinterpolate: () => interpolate,\n\tinvariant: () => invariant,\n\tisAlignAttrib: () => isAlignAttrib,\n\tisAtomic: () => isAtomic,\n\tisBuiltin: () => isBuiltin,\n\tisBuiltinAttrib: () => isBuiltinAttrib,\n\tisContiguous: () => PUBLIC_isContiguous,\n\tisData: () => isData,\n\tisDecorated: () => isDecorated,\n\tisDisarray: () => isDisarray,\n\tisInterpolateAttrib: () => isInterpolateAttrib,\n\tisLocationAttrib: () => isLocationAttrib,\n\tisLooseData: () => isLooseData,\n\tisLooseDecorated: () => isLooseDecorated,\n\tisPackedData: () => isPackedData,\n\tisPtr: () => isPtr,\n\tisSizeAttrib: () => isSizeAttrib,\n\tisUnstruct: () => isUnstruct,\n\tisWgslArray: () => isWgslArray,\n\tisWgslData: () => isWgslData,\n\tisWgslStruct: () => isWgslStruct,\n\tlocation: () => location,\n\tmat2x2f: () => mat2x2f,\n\tmat3x3f: () => mat3x3f,\n\tmat4x4f: () => mat4x4f,\n\tmatToArray: () => matToArray,\n\tmemoryLayoutOf: () => memoryLayoutOf,\n\tpackedFormats: () => packedFormats,\n\tptrFn: () => ptrFn,\n\tptrHandle: () => ptrHandle,\n\tptrPrivate: () => ptrPrivate,\n\tptrStorage: () => ptrStorage,\n\tptrUniform: () => ptrUniform,\n\tptrWorkgroup: () => ptrWorkgroup,\n\tref: () => _ref,\n\tsampler: () => sampler,\n\tsint16: () => sint16,\n\tsint16x2: () => sint16x2,\n\tsint16x4: () => sint16x4,\n\tsint32: () => sint32,\n\tsint32x2: () => sint32x2,\n\tsint32x3: () => sint32x3,\n\tsint32x4: () => sint32x4,\n\tsint8: () => sint8,\n\tsint8x2: () => sint8x2,\n\tsint8x4: () => sint8x4,\n\tsize: () => size,\n\tsizeOf: () => PUBLIC_sizeOf,\n\tsnorm16: () => snorm16,\n\tsnorm16x2: () => snorm16x2,\n\tsnorm16x4: () => snorm16x4,\n\tsnorm8: () => snorm8,\n\tsnorm8x2: () => snorm8x2,\n\tsnorm8x4: () => snorm8x4,\n\tstruct: () => struct,\n\ttexture1d: () => texture1d,\n\ttexture2d: () => texture2d,\n\ttexture2dArray: () => texture2dArray,\n\ttexture3d: () => texture3d,\n\ttextureCube: () => textureCube,\n\ttextureCubeArray: () => textureCubeArray,\n\ttextureDepth2d: () => textureDepth2d,\n\ttextureDepth2dArray: () => textureDepth2dArray,\n\ttextureDepthCube: () => textureDepthCube,\n\ttextureDepthCubeArray: () => textureDepthCubeArray,\n\ttextureDepthMultisampled2d: () => textureDepthMultisampled2d,\n\ttextureExternal: () => textureExternal,\n\ttextureMultisampled2d: () => textureMultisampled2d,\n\ttextureStorage1d: () => textureStorage1d,\n\ttextureStorage2d: () => textureStorage2d,\n\ttextureStorage2dArray: () => textureStorage2dArray,\n\ttextureStorage3d: () => textureStorage3d,\n\tu16: () => u16,\n\tu32: () => u32,\n\tuint16: () => uint16,\n\tuint16x2: () => uint16x2,\n\tuint16x4: () => uint16x4,\n\tuint32: () => uint32,\n\tuint32x2: () => uint32x2,\n\tuint32x3: () => uint32x3,\n\tuint32x4: () => uint32x4,\n\tuint8: () => uint8,\n\tuint8x2: () => uint8x2,\n\tuint8x4: () => uint8x4,\n\tunorm10_10_10_2: () => unorm10_10_10_2,\n\tunorm16: () => unorm16,\n\tunorm16x2: () => unorm16x2,\n\tunorm16x4: () => unorm16x4,\n\tunorm8: () => unorm8,\n\tunorm8x2: () => unorm8x2,\n\tunorm8x4: () => unorm8x4,\n\tunorm8x4_bgra: () => unorm8x4_bgra,\n\tunstruct: () => unstruct,\n\tvec2b: () => vec2b,\n\tvec2f: () => vec2f,\n\tvec2h: () => vec2h,\n\tvec2i: () => vec2i,\n\tvec2u: () => vec2u,\n\tvec3b: () => vec3b,\n\tvec3f: () => vec3f,\n\tvec3h: () => vec3h,\n\tvec3i: () => vec3i,\n\tvec3u: () => vec3u,\n\tvec4b: () => vec4b,\n\tvec4f: () => vec4f,\n\tvec4h: () => vec4h,\n\tvec4i: () => vec4i,\n\tvec4u: () => vec4u\n});\nfunction assignInfixOperator(object, operator, operatorSymbol) {\n\tconst proto = object.prototype;\n\tconst opImpl = infixOperators[operator];\n\tproto[operator] = function(other) {\n\t\treturn opImpl(this, other);\n\t};\n\tproto[operatorSymbol] = (lhs, rhs) => {\n\t\treturn opImpl(lhs, rhs);\n\t};\n}\nassignInfixOperator(VecBase, \"add\", Operator.plus);\nassignInfixOperator(VecBase, \"sub\", Operator.minus);\nassignInfixOperator(VecBase, \"mul\", Operator.star);\nassignInfixOperator(VecBase, \"div\", Operator.slash);\nassignInfixOperator(VecBase, \"mod\", Operator.percent);\nassignInfixOperator(MatBase, \"add\", Operator.plus);\nassignInfixOperator(MatBase, \"sub\", Operator.minus);\nassignInfixOperator(MatBase, \"mul\", Operator.star);\n\n//#endregion\nexport { Void, align, PUBLIC_alignmentOf as alignmentOf, arrayOf, atomic, bool, builtin, comparisonSampler, data_exports, deepEqual, disarrayOf, f16, f32, float16, float16x2, float16x4, float32, float32x2, float32x3, float32x4, formatToWGSLType, PUBLIC_getLongestContiguousPrefix as getLongestContiguousPrefix, i32, interpolate, invariant, isAlignAttrib, isAtomic, isBuiltin, isBuiltinAttrib, PUBLIC_isContiguous as isContiguous, isData, isDecorated, isDisarray, isInterpolateAttrib, isLocationAttrib, isLooseData, isLooseDecorated, isPackedData, isPtr, isSizeAttrib, isUnstruct, isWgslArray, isWgslData, isWgslStruct, location, mat2x2f, mat3x3f, mat4x4f, matToArray, memoryLayoutOf, packedFormats, ptrFn, ptrHandle, ptrPrivate, ptrStorage, ptrUniform, ptrWorkgroup, _ref as ref, sampler, sint16, sint16x2, sint16x4, sint32, sint32x2, sint32x3, sint32x4, sint8, sint8x2, sint8x4, size, PUBLIC_sizeOf as sizeOf, snorm16, snorm16x2, snorm16x4, snorm8, snorm8x2, snorm8x4, struct, texture1d, texture2d, texture2dArray, texture3d, textureCube, textureCubeArray, textureDepth2d, textureDepth2dArray, textureDepthCube, textureDepthCubeArray, textureDepthMultisampled2d, textureExternal, textureMultisampled2d, textureStorage1d, textureStorage2d, textureStorage2dArray, textureStorage3d, u16, u32, uint16, uint16x2, uint16x4, uint32, uint32x2, uint32x3, uint32x4, uint8, uint8x2, uint8x4, unorm10_10_10_2, unorm16, unorm16x2, unorm16x4, unorm8, unorm8x2, unorm8x4, unorm8x4_bgra, unstruct, vec2b, vec2f, vec2h, vec2i, vec2u, vec3b, vec3f, vec3h, vec3i, vec3u, vec4b, vec4f, vec4h, vec4i, vec4u };","import { MissingBindGroupsError, MissingLinksError, MissingSlotValueError, MissingVertexBuffersError, NotUniformError, ResolutionError } from \"./errors.js\";\nimport { isAccessor, isLazy, isMutableAccessor, isSlot } from \"./core/slot/slotTypes.js\";\nimport { isTgpuFn } from \"./core/function/tgpuFn.js\";\nimport { isUsableAsStorage } from \"./extension.js\";\nimport { isUsableAsUniform } from \"./core/buffer/bufferUsage.js\";\nimport { isBuffer, isUsableAsVertex } from \"./core/buffer/buffer.js\";\nimport { isComparisonSampler, isSampler } from \"./core/sampler/sampler.js\";\nimport { isTexture } from \"./core/texture/texture.js\";\nimport { isUsableAsRender, isUsableAsSampled } from \"./core/texture/usageExtension.js\";\nimport { isVariable } from \"./core/variable/tgpuVariable.js\";\nimport { isBufferShorthand } from \"./core/buffer/bufferShorthand.js\";\nimport { isTgpuComputeFn } from \"./core/function/tgpuComputeFn.js\";\nimport { isTgpuFragmentFn } from \"./core/function/tgpuFragmentFn.js\";\nimport { isTgpuVertexFn } from \"./core/function/tgpuVertexFn.js\";\nimport { tgpu_exports } from \"./tgpu.js\";\nimport { data_exports } from \"./data/index.js\";\nimport { std_exports } from \"./std/index.js\";\nimport { common_exports } from \"./common/index.js\";\n\n//#region src/index.js\n/**\n* @module typegpu\n*/\nvar src_default = tgpu_exports;\n\n//#endregion\nexport { MissingBindGroupsError, MissingLinksError, MissingSlotValueError, MissingVertexBuffersError, NotUniformError, ResolutionError, common_exports as common, data_exports as d, src_default as default, isAccessor, isBuffer, isBufferShorthand, isComparisonSampler, isLazy, isMutableAccessor, isSampler, isSlot, isTexture, isTgpuComputeFn, isTgpuFn, isTgpuFragmentFn, isTgpuVertexFn, isUsableAsRender, isUsableAsSampled, isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, isVariable, std_exports as std, tgpu_exports as tgpu };","/**\n * Compressed Sparse Row (CSR) matrix representation for GPU computation.\n *\n * CSR format is memory-efficient for sparse graphs and maps well to\n * GPU parallel operations. The format stores adjacency information\n * in three arrays: row offsets, column indices, and optional values.\n */\n\nimport { d, type StorageFlag, type TgpuBuffer } from \"typegpu\";\nimport type { NodeId, Direction, NodeData, EdgeData } from \"../graph/types\";\nimport type { ReadableGraph } from \"../graph\";\nimport type { GraphwiseGPURoot } from \"./root\";\n\n/**\n * CSR matrix representation of a graph adjacency structure.\n *\n * The rowOffsets array has length nodeCount + 1, where rowOffsets[i]\n * gives the start index in colIndices for node i's neighbours.\n * The neighbours of node i are colIndices[rowOffsets[i] : rowOffsets[i+1]].\n */\nexport interface CSRMatrix {\n\t/** Row offsets array (length: nodeCount + 1) */\n\treadonly rowOffsets: Uint32Array;\n\t/** Column indices array (length: edgeCount for directed, 2*edgeCount for undirected) */\n\treadonly colIndices: Uint32Array;\n\t/** Optional edge weights aligned with colIndices */\n\treadonly values?: Float32Array;\n\t/** Number of nodes in the graph */\n\treadonly nodeCount: number;\n\t/** Number of directed edges (undirected edges counted once) */\n\treadonly edgeCount: number;\n}\n\n/**\n * Mapping from node IDs to CSR indices.\n *\n * Required because CSR uses dense integer indices while graphs\n * may use arbitrary string identifiers.\n */\nexport interface CSRIndexMap {\n\t/** Map from NodeId to CSR row index */\n\treadonly nodeToIndex: ReadonlyMap<NodeId, number>;\n\t/** Map from CSR row index to NodeId */\n\treadonly indexToNode: readonly NodeId[];\n}\n\n/**\n * Combined CSR matrix with index mapping.\n */\nexport interface CSRGraph {\n\treadonly csr: CSRMatrix;\n\treadonly indexMap: CSRIndexMap;\n}\n\n/**\n * Group of TypeGPU typed buffers holding a CSR matrix.\n *\n * Uses TypeGPU's typed buffer API for type-safe GPU computation.\n * Buffers are created with storage usage for compute operations.\n */\nexport interface TypedBufferGroup {\n\t/** Buffer containing rowOffsets data (u32 array) */\n\treadonly rowOffsets: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.u32>>> &\n\t\tStorageFlag;\n\t/** Buffer containing colIndices data (u32 array) */\n\treadonly colIndices: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.u32>>> &\n\t\tStorageFlag;\n\t/** Buffer containing values data (f32 array, optional) */\n\treadonly values?: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.f32>>> &\n\t\tStorageFlag;\n\t/** Number of nodes */\n\treadonly nodeCount: number;\n\t/** Number of edges */\n\treadonly edgeCount: number;\n}\n\n/**\n * Convert a ReadableGraph to CSR format.\n *\n * For undirected graphs, each edge is stored twice (once in each direction).\n * For directed graphs, edges are stored in the out-direction by default.\n *\n * @param graph - The graph to convert\n * @param direction - Edge direction to include (default: 'out' for directed, 'both' for undirected)\n * @returns CSR representation with index mapping\n */\nexport function graphToCSR<N extends NodeData, E extends EdgeData>(\n\tgraph: ReadableGraph<N, E>,\n\tdirection: Direction = graph.directed ? \"out\" : \"both\",\n): CSRGraph {\n\t// Build node index mapping\n\tconst nodeToIndex = new Map<NodeId, number>();\n\tconst indexToNode: NodeId[] = [];\n\n\tfor (const nodeId of graph.nodeIds()) {\n\t\tconst index = indexToNode.length;\n\t\tnodeToIndex.set(nodeId, index);\n\t\tindexToNode.push(nodeId);\n\t}\n\n\tconst nodeCount = indexToNode.length;\n\n\t// Count edges per node to build row offsets\n\tconst degrees = new Uint32Array(nodeCount);\n\n\tfor (const nodeId of graph.nodeIds()) {\n\t\tconst srcIndex = nodeToIndex.get(nodeId);\n\t\tif (srcIndex === undefined) continue;\n\t\tdegrees[srcIndex] = graph.degree(nodeId, direction);\n\t}\n\n\t// Calculate total edge count\n\tlet totalEdges = 0;\n\tfor (let i = 0; i < nodeCount; i++) {\n\t\ttotalEdges += degrees[i] ?? 0;\n\t}\n\n\t// Build rowOffsets array\n\tconst rowOffsets = new Uint32Array(nodeCount + 1);\n\tfor (let i = 0; i < nodeCount; i++) {\n\t\trowOffsets[i + 1] = (rowOffsets[i] ?? 0) + (degrees[i] ?? 0);\n\t}\n\n\t// Build colIndices and values arrays\n\tconst colIndices = new Uint32Array(totalEdges);\n\tconst values = new Float32Array(totalEdges);\n\n\tfor (const nodeId of graph.nodeIds()) {\n\t\tconst srcIndex = nodeToIndex.get(nodeId);\n\t\tif (srcIndex === undefined) continue;\n\n\t\tconst baseOffset = rowOffsets[srcIndex] ?? 0;\n\t\tlet localOffset = 0;\n\n\t\tfor (const neighbourId of graph.neighbours(nodeId, direction)) {\n\t\t\tconst dstIndex = nodeToIndex.get(neighbourId);\n\t\t\tif (dstIndex === undefined) continue;\n\n\t\t\tconst edgeIdx = baseOffset + localOffset;\n\t\t\tcolIndices[edgeIdx] = dstIndex;\n\n\t\t\t// Get edge weight if available\n\t\t\tconst edge = graph.getEdge(nodeId, neighbourId);\n\t\t\tvalues[edgeIdx] = edge?.weight ?? 1.0;\n\n\t\t\tlocalOffset++;\n\t\t}\n\t}\n\n\tconst csr: CSRMatrix = {\n\t\trowOffsets,\n\t\tcolIndices,\n\t\tvalues,\n\t\tnodeCount,\n\t\tedgeCount: graph.directed ? graph.edgeCount : graph.edgeCount * 2,\n\t};\n\n\tconst indexMap: CSRIndexMap = {\n\t\tnodeToIndex,\n\t\tindexToNode,\n\t};\n\n\treturn { csr, indexMap };\n}\n\n/**\n * Create TypeGPU typed buffers from a CSR matrix.\n *\n * Uses TypeGPU's typed buffer API for type-safe GPU computation.\n * Buffers are created with storage usage for compute operations.\n *\n * @param root - TypeGPU root instance\n * @param csr - CSR matrix to upload\n * @returns Typed buffer group\n *\n * @example\n * ```typescript\n * import { initGPU, csrToTypedBuffers, graphToCSR } from \"graphwise/gpu\";\n *\n * const root = await initGPU();\n * const { csr } = graphToCSR(graph);\n * const buffers = csrToTypedBuffers(root, csr);\n *\n * // Read data back to CPU\n * const rowOffsets = await buffers.rowOffsets.read();\n * console.log(rowOffsets); // Uint32Array\n * ```\n */\nexport function csrToTypedBuffers(\n\troot: GraphwiseGPURoot,\n\tcsr: CSRMatrix,\n): TypedBufferGroup {\n\t// Convert typed arrays to regular arrays for TypeGPU\n\tconst rowOffsetsArray = Array.from(csr.rowOffsets);\n\tconst colIndicesArray = Array.from(csr.colIndices);\n\n\t// Row offsets buffer (u32 array)\n\tconst rowOffsetsBuffer = root\n\t\t.createBuffer(d.arrayOf(d.u32, csr.rowOffsets.length), rowOffsetsArray)\n\t\t.$usage(\"storage\");\n\n\t// Column indices buffer (u32 array)\n\tconst colIndicesBuffer = root\n\t\t.createBuffer(d.arrayOf(d.u32, csr.colIndices.length), colIndicesArray)\n\t\t.$usage(\"storage\");\n\n\t// Values buffer (f32 array, optional)\n\tif (csr.values !== undefined) {\n\t\tconst valuesArray = Array.from(csr.values);\n\t\tconst valuesBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.f32, csr.values.length), valuesArray)\n\t\t\t.$usage(\"storage\");\n\n\t\treturn {\n\t\t\trowOffsets: rowOffsetsBuffer,\n\t\t\tcolIndices: colIndicesBuffer,\n\t\t\tvalues: valuesBuffer,\n\t\t\tnodeCount: csr.nodeCount,\n\t\t\tedgeCount: csr.edgeCount,\n\t\t};\n\t}\n\n\treturn {\n\t\trowOffsets: rowOffsetsBuffer,\n\t\tcolIndices: colIndicesBuffer,\n\t\tnodeCount: csr.nodeCount,\n\t\tedgeCount: csr.edgeCount,\n\t};\n}\n","/**\n * WebGPU availability detection for browser and Node.js environments.\n *\n * This module provides runtime detection of WebGPU support without\n * requiring any polyfills or runtime dependencies.\n */\n\nimport type { GPUDetectionResult } from \"./types\";\n\n/**\n * Detect WebGPU availability in the current environment.\n *\n * Checks for:\n * - Browser: navigator.gpu\n * - Node.js: global GPU constructor (Node.js 21+ with --experimental-webgpu)\n * - Deno: global GPU constructor\n *\n * @returns Detection result with availability status and reason\n */\nexport function detectWebGPU(): GPUDetectionResult {\n\t// Check for browser WebGPU API\n\tif (typeof navigator !== \"undefined\" && \"gpu\" in navigator) {\n\t\treturn { available: true };\n\t}\n\n\t// Check for Node.js / Deno global GPU\n\tif (typeof globalThis !== \"undefined\" && \"GPU\" in globalThis) {\n\t\treturn { available: true };\n\t}\n\n\t// WebGPU not available\n\tconst reasons: string[] = [];\n\n\tif (typeof navigator === \"undefined\" && typeof globalThis === \"undefined\") {\n\t\treasons.push(\"no global scope detected\");\n\t} else if (typeof navigator !== \"undefined\" && !(\"gpu\" in navigator)) {\n\t\treasons.push(\"navigator.gpu not present (browser may not support WebGPU)\");\n\t} else if (typeof globalThis !== \"undefined\" && !(\"GPU\" in globalThis)) {\n\t\treasons.push(\n\t\t\t\"global GPU not present (Node.js requires v21+ with --experimental-webgpu flag)\",\n\t\t);\n\t}\n\n\treturn {\n\t\tavailable: false,\n\t\treason: reasons.length > 0 ? reasons.join(\"; \") : \"unknown environment\",\n\t};\n}\n\n/**\n * Check if WebGPU is available (convenience function).\n *\n * @returns true if WebGPU is available, false otherwise\n */\nexport function isWebGPUAvailable(): boolean {\n\treturn detectWebGPU().available;\n}\n\n/**\n * Assert that WebGPU is available, throwing an error if not.\n *\n * @throws Error if WebGPU is not available\n */\nexport function assertWebGPUAvailable(): void {\n\tconst result = detectWebGPU();\n\tif (!result.available) {\n\t\tthrow new Error(\n\t\t\t`WebGPU required but not available: ${result.reason ?? \"unknown reason\"}`,\n\t\t);\n\t}\n}\n","/**\n * TypeGPU root initialisation for graphwise GPU operations.\n *\n * Provides a simplified wrapper around TypeGPU's tgpu.init() for\n * GPU device acquisition and resource management.\n *\n * @module gpu/root\n */\n\nimport { tgpu } from \"typegpu\";\nimport { detectWebGPU } from \"./detect\";\n\n/**\n * Options for initialising the GPU root.\n */\nexport interface InitGPUOptions {\n\t/** Power preference for GPU adapter */\n\treadonly powerPreference?: \"low-power\" | \"high-performance\";\n}\n\n/**\n * The TypeGPU root instance used for GPU operations.\n * Re-exports TgpuRoot from TypeGPU for convenience.\n */\nexport type GraphwiseGPURoot = Awaited<ReturnType<typeof tgpu.init>>;\n\n/**\n * Initialise a TypeGPU root for GPU compute operations.\n *\n * This wraps tgpu.init() with WebGPU availability checking and\n * simplified options.\n *\n * @param options - Initialisation options\n * @returns Promise resolving to a TypeGPU root instance\n * @throws Error if WebGPU is unavailable or device request fails\n *\n * @example\n * ```typescript\n * import { initGPU } from \"graphwise/gpu\";\n *\n * const root = await initGPU();\n * // Use root for GPU operations...\n * root.destroy();\n * ```\n */\nexport async function initGPU(\n\toptions: InitGPUOptions = {},\n): Promise<GraphwiseGPURoot> {\n\tconst detection = detectWebGPU();\n\tif (!detection.available) {\n\t\tthrow new Error(\n\t\t\t`WebGPU unavailable: ${detection.reason ?? \"unknown reason\"}`,\n\t\t);\n\t}\n\n\tconst root = await tgpu.init({\n\t\tadapter: options.powerPreference\n\t\t\t? { powerPreference: options.powerPreference }\n\t\t\t: undefined,\n\t});\n\n\treturn root;\n}\n\n/**\n * Create a TypeGPU root from an existing GPU device.\n *\n * Use this when you already have a GPUDevice and want to wrap it\n * with TypeGPU functionality.\n *\n * @param device - Existing GPU device\n * @returns TypeGPU root instance\n *\n * @example\n * ```typescript\n * import { initGPUFromDevice } from \"graphwise/gpu\";\n *\n * const adapter = await navigator.gpu.requestAdapter();\n * const device = await adapter.requestDevice();\n * const root = initGPUFromDevice(device);\n * ```\n */\nexport function initGPUFromDevice(device: GPUDevice): GraphwiseGPURoot {\n\treturn tgpu.initFromDevice({ device });\n}\n","/**\n * Backend selection and dispatch utilities for GPU compute operations.\n *\n * Provides the `withBackend` function that handles auto/gpu/cpu backend\n * selection with timing and fallback logic.\n *\n * @module gpu/dispatch\n */\n\nimport { detectWebGPU } from \"./detect\";\nimport {\n\tGPUNotAvailableError,\n\ttype ComputeBackend,\n\ttype ComputeResult,\n} from \"./types\";\nimport type { GraphwiseGPURoot } from \"./root\";\n\n/**\n * Options for backend dispatch.\n */\nexport interface DispatchOptions {\n\t/** Backend selection: 'auto', 'gpu', or 'cpu' */\n\treadonly backend?: ComputeBackend | undefined;\n\t/** Optional pre-initialised TypeGPU root */\n\treadonly root?: GraphwiseGPURoot | undefined;\n\t/** Optional abort signal for cancellation */\n\treadonly signal?: AbortSignal | undefined;\n}\n\n/**\n * CPU compute function type.\n */\nexport type CPUFunction<T> = () => T;\n\n/**\n * GPU compute function type.\n */\nexport type GPUFunction<T> = (root: GraphwiseGPURoot) => Promise<T> | T;\n\n/**\n * Execute a compute operation with automatic backend selection.\n *\n * @param options - Backend selection and cancellation options\n * @param cpuFn - CPU fallback implementation\n * @param gpuFn - GPU implementation (receives TypeGPU root)\n * @returns Compute result with backend used and timing\n */\nexport async function withBackend<T>(\n\toptions: DispatchOptions,\n\tcpuFn: CPUFunction<T>,\n\tgpuFn: GPUFunction<T>,\n): Promise<ComputeResult<T>> {\n\tconst backend = options.backend ?? \"auto\";\n\n\t// Check for cancellation\n\tif (options.signal?.aborted === true) {\n\t\tthrow new DOMException(\"Operation aborted\", \"AbortError\");\n\t}\n\n\t// CPU backend - synchronous, always available\n\tif (backend === \"cpu\") {\n\t\tconst start = performance.now();\n\t\tconst value = cpuFn();\n\t\tconst elapsedMs = performance.now() - start;\n\t\treturn { value, backend: \"cpu\", elapsedMs };\n\t}\n\n\t// GPU backend - requires WebGPU\n\tif (backend === \"gpu\") {\n\t\tconst detection = detectWebGPU();\n\t\tif (!detection.available) {\n\t\t\tthrow new GPUNotAvailableError(detection.reason ?? \"Unknown reason\");\n\t\t}\n\n\t\tconst root = options.root;\n\t\tif (root === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"GPU backend requires a GraphwiseGPURoot. Pass one via options.root or use backend: 'auto'.\",\n\t\t\t);\n\t\t}\n\n\t\tconst start = performance.now();\n\t\tconst value = await gpuFn(root);\n\t\tconst elapsedMs = performance.now() - start;\n\t\treturn { value, backend: \"gpu\", elapsedMs };\n\t}\n\n\t// Auto backend - detect WebGPU, fall back to CPU\n\tconst detection = detectWebGPU();\n\n\t// No WebGPU available - use CPU\n\tif (!detection.available) {\n\t\tconst start = performance.now();\n\t\tconst value = cpuFn();\n\t\tconst elapsedMs = performance.now() - start;\n\t\treturn { value, backend: \"cpu\", elapsedMs };\n\t}\n\n\t// WebGPU available but no root provided - use CPU\n\tconst root = options.root;\n\tif (root === undefined) {\n\t\tconst start = performance.now();\n\t\tconst value = cpuFn();\n\t\tconst elapsedMs = performance.now() - start;\n\t\treturn { value, backend: \"cpu\", elapsedMs };\n\t}\n\n\t// WebGPU available with root - use GPU\n\tconst start = performance.now();\n\tconst value = await gpuFn(root);\n\tconst elapsedMs = performance.now() - start;\n\treturn { value, backend: \"gpu\", elapsedMs };\n}\n","/**\n * TypeGPU compute kernel for Sparse Matrix-Vector Multiplication (SpMV).\n *\n * Computes y = A * x where A is a sparse matrix in CSR format.\n * Uses TypeGPU's compute pipeline for parallel GPU execution.\n *\n * @module gpu/kernels/spmv/kernel\n */\n\nimport tgpu, { d, type StorageFlag, type TgpuBuffer } from \"typegpu\";\nimport type { TypedBufferGroup } from \"../../csr\";\nimport type { GraphwiseGPURoot } from \"../../root\";\n\n/**\n * Bind group layout for SpMV kernel.\n */\nconst SpMVLayout = tgpu.bindGroupLayout({\n\trowOffsets: { storage: d.arrayOf(d.u32) },\n\tcolIndices: { storage: d.arrayOf(d.u32) },\n\tvalues: { storage: d.arrayOf(d.f32) },\n\tx: { storage: d.arrayOf(d.f32) },\n\ty: { storage: d.arrayOf(d.f32), access: \"mutable\" },\n\tnodeCount: { uniform: d.u32 },\n\thasValues: { uniform: d.u32 },\n});\n\n/**\n * SpMV compute pipeline: y[row] = sum(A[row,col] * x[col]).\n *\n * Each thread computes one row of the output vector using the CSR format:\n * - rowOffsets: start/end indices for each row\n * - colIndices: column index for each non-zero entry\n * - values: edge weights (optional, defaults to 1.0)\n */\nconst spmvPipeline = (row: number): void => {\n\t\"use gpu\";\n\tconst start = SpMVLayout.$.rowOffsets[row] ?? 0;\n\tconst end = SpMVLayout.$.rowOffsets[row + 1] ?? 0;\n\n\tlet sum = 0.0;\n\tfor (let i = start; i < end; i = i + 1) {\n\t\tconst col = SpMVLayout.$.colIndices[i] ?? 0;\n\t\tconst weight =\n\t\t\tSpMVLayout.$.hasValues !== 0 ? (SpMVLayout.$.values[i] ?? 1.0) : 1.0;\n\t\tsum = sum + weight * (SpMVLayout.$.x[col] ?? 0.0);\n\t}\n\tSpMVLayout.$.y[row] = sum;\n};\n\n/**\n * Dispatch SpMV on GPU.\n *\n * @param root - TypeGPU root instance\n * @param csrBuffers - CSR matrix as typed buffers\n * @param x - Input vector buffer\n * @param y - Output vector buffer (mutable)\n * @param nodeCount - Number of nodes/rows\n * @param hasValues - Whether edge weights are present\n */\nexport function dispatchSpmv(\n\troot: GraphwiseGPURoot,\n\tcsrBuffers: TypedBufferGroup,\n\tx: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.f32>>> & StorageFlag,\n\ty: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.f32>>> & StorageFlag,\n\tnodeCount: number,\n\thasValues: boolean,\n): void {\n\tconst pipeline = root.createGuardedComputePipeline(spmvPipeline);\n\n\t// Create values buffer if not present (unweighted graph)\n\tconst valuesBuffer =\n\t\tcsrBuffers.values ??\n\t\troot\n\t\t\t.createBuffer(\n\t\t\t\td.arrayOf(d.f32, csrBuffers.edgeCount),\n\t\t\t\tnew Array(csrBuffers.edgeCount).fill(1.0),\n\t\t\t)\n\t\t\t.$usage(\"storage\");\n\n\t// Create uniform buffers for scalar values\n\tconst nodeCountBuffer = root.createBuffer(d.u32, nodeCount).$usage(\"uniform\");\n\tconst hasValuesBuffer = root\n\t\t.createBuffer(d.u32, hasValues ? 1 : 0)\n\t\t.$usage(\"uniform\");\n\n\tconst bindGroup = root.createBindGroup(SpMVLayout, {\n\t\trowOffsets: csrBuffers.rowOffsets,\n\t\tcolIndices: csrBuffers.colIndices,\n\t\tvalues: valuesBuffer,\n\t\tx,\n\t\ty,\n\t\tnodeCount: nodeCountBuffer,\n\t\thasValues: hasValuesBuffer,\n\t});\n\n\tpipeline.with(bindGroup).dispatchThreads(nodeCount);\n}\n\nexport { SpMVLayout };\n","/**\n * TypeGPU compute kernel for PageRank power iteration.\n *\n * Computes one iteration of PageRank:\n * r(v) = (1 - d)/N + d * sum(r(u) / deg_out(u)) for u -> v\n *\n * Uses TypeGPU's compute pipeline for parallel GPU execution.\n *\n * @module gpu/kernels/pagerank/kernel\n */\n\nimport tgpu, { d, type StorageFlag, type TgpuBuffer } from \"typegpu\";\nimport type { TypedBufferGroup } from \"../../csr\";\nimport type { GraphwiseGPURoot } from \"../../root\";\n\n/**\n * Bind group layout for PageRank kernel.\n */\nconst PageRankLayout = tgpu.bindGroupLayout({\n\trowOffsets: { storage: d.arrayOf(d.u32) },\n\tcolIndices: { storage: d.arrayOf(d.u32) },\n\tranks: { storage: d.arrayOf(d.f32) },\n\toutDegrees: { storage: d.arrayOf(d.u32) },\n\tnewRanks: { storage: d.arrayOf(d.f32), access: \"mutable\" },\n\tnodeCount: { uniform: d.u32 },\n\tdamping: { uniform: d.f32 },\n});\n\n/**\n * PageRank compute pipeline: one power iteration per dispatch.\n *\n * Each thread computes one node's new rank from incoming neighbours:\n * newRank[v] = (1 - damping) / N + damping * sum(rank[u] / outDegree[u])\n */\nconst pagerankPipeline = (node: number): void => {\n\t\"use gpu\";\n\tconst n = PageRankLayout.$.nodeCount ?? 0;\n\tconst damp = PageRankLayout.$.damping ?? 0.85;\n\n\tconst start = PageRankLayout.$.rowOffsets[node] ?? 0;\n\tconst end = PageRankLayout.$.rowOffsets[node + 1] ?? 0;\n\n\tlet contribution = 0.0;\n\tfor (let i = start; i < end; i = i + 1) {\n\t\tconst source = PageRankLayout.$.colIndices[i] ?? 0;\n\t\tconst deg = PageRankLayout.$.outDegrees[source] ?? 0;\n\t\tif (deg > 0) {\n\t\t\tconst rank = PageRankLayout.$.ranks[source] ?? 0.0;\n\t\t\tcontribution = contribution + rank / deg;\n\t\t}\n\t}\n\n\tconst teleport = (1.0 - damp) / n;\n\tPageRankLayout.$.newRanks[node] = teleport + damp * contribution;\n};\n\n/**\n * Dispatch one PageRank iteration on GPU.\n *\n * @param root - TypeGPU root instance\n * @param csrBuffers - CSR matrix as typed buffers (transpose graph: in-edges)\n * @param ranks - Current rank values buffer\n * @param outDegrees - Out-degree buffer for each node\n * @param newRanks - Output buffer for new rank values (mutable)\n * @param nodeCount - Number of nodes\n * @param damping - Damping factor (typically 0.85)\n */\nexport function dispatchPagerank(\n\troot: GraphwiseGPURoot,\n\tcsrBuffers: TypedBufferGroup,\n\tranks: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.f32>>> & StorageFlag,\n\toutDegrees: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.u32>>> &\n\t\tStorageFlag,\n\tnewRanks: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.f32>>> &\n\t\tStorageFlag,\n\tnodeCount: number,\n\tdamping: number,\n): void {\n\tconst pipeline = root.createGuardedComputePipeline(pagerankPipeline);\n\n\tconst nodeCountBuffer = root.createBuffer(d.u32, nodeCount).$usage(\"uniform\");\n\tconst dampingBuffer = root.createBuffer(d.f32, damping).$usage(\"uniform\");\n\n\tconst bindGroup = root.createBindGroup(PageRankLayout, {\n\t\trowOffsets: csrBuffers.rowOffsets,\n\t\tcolIndices: csrBuffers.colIndices,\n\t\tranks,\n\t\toutDegrees,\n\t\tnewRanks,\n\t\tnodeCount: nodeCountBuffer,\n\t\tdamping: dampingBuffer,\n\t});\n\n\tpipeline.with(bindGroup).dispatchThreads(nodeCount);\n}\n\nexport { PageRankLayout };\n","/**\n * TypeGPU compute kernel for batch Jaccard similarity.\n *\n * Computes Jaccard coefficient for multiple node pairs in parallel:\n * J(u, v) = |N(u) ∩ N(v)| / |N(u) ∪ N(v)|\n *\n * Uses binary search optimisation: iterate smaller neighbourhood, search in larger.\n *\n * @module gpu/kernels/jaccard/kernel\n */\n\nimport tgpu, { d, type StorageFlag, type TgpuBuffer } from \"typegpu\";\nimport type { TypedBufferGroup } from \"../../csr\";\nimport type { GraphwiseGPURoot } from \"../../root\";\n\n/**\n * Bind group layout for Jaccard kernel.\n */\nconst JaccardLayout = tgpu.bindGroupLayout({\n\trowOffsets: { storage: d.arrayOf(d.u32) },\n\tcolIndices: { storage: d.arrayOf(d.u32) },\n\tpairsU: { storage: d.arrayOf(d.u32) },\n\tpairsV: { storage: d.arrayOf(d.u32) },\n\tresults: { storage: d.arrayOf(d.f32), access: \"mutable\" },\n\tpairCount: { uniform: d.u32 },\n});\n\n/**\n * Jaccard compute pipeline: one thread per pair.\n *\n * For each pair (u, v):\n * - Count intersection by iterating smaller neighbourhood\n * - Binary search in larger neighbourhood\n * - Jaccard = intersection / (degU + degV - intersection)\n */\nconst jaccardPipeline = (pairIdx: number): void => {\n\t\"use gpu\";\n\tconst u = JaccardLayout.$.pairsU[pairIdx] ?? 0;\n\tconst v = JaccardLayout.$.pairsV[pairIdx] ?? 0;\n\n\tconst uStart = JaccardLayout.$.rowOffsets[u] ?? 0;\n\tconst uEnd = JaccardLayout.$.rowOffsets[u + 1] ?? 0;\n\tconst vStart = JaccardLayout.$.rowOffsets[v] ?? 0;\n\tconst vEnd = JaccardLayout.$.rowOffsets[v + 1] ?? 0;\n\n\tconst degU = uEnd - uStart;\n\tconst degV = vEnd - vStart;\n\n\t// Empty neighbourhoods → Jaccard = 0\n\tif (degU === 0 || degV === 0) {\n\t\tJaccardLayout.$.results[pairIdx] = 0.0;\n\t\treturn;\n\t}\n\n\t// Count intersection: iterate smaller, binary search in larger\n\tlet intersection = 0;\n\n\tif (degU <= degV) {\n\t\t// Iterate u's neighbours, search in v's\n\t\tfor (let i = uStart; i < uEnd; i = i + 1) {\n\t\t\tconst neighbour = JaccardLayout.$.colIndices[i] ?? 0;\n\t\t\t// Binary search in v's neighbourhood\n\t\t\tlet lo = vStart;\n\t\t\tlet hi = vEnd;\n\t\t\twhile (lo < hi) {\n\t\t\t\tconst mid = lo + (hi - lo) / 2;\n\t\t\t\tconst midVal = JaccardLayout.$.colIndices[mid] ?? 0;\n\t\t\t\tif (midVal === neighbour) {\n\t\t\t\t\tintersection = intersection + 1;\n\t\t\t\t\tlo = hi; // break\n\t\t\t\t} else if (midVal < neighbour) {\n\t\t\t\t\tlo = mid + 1;\n\t\t\t\t} else {\n\t\t\t\t\thi = mid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Iterate v's neighbours, search in u's\n\t\tfor (let i = vStart; i < vEnd; i = i + 1) {\n\t\t\tconst neighbour = JaccardLayout.$.colIndices[i] ?? 0;\n\t\t\t// Binary search in u's neighbourhood\n\t\t\tlet lo = uStart;\n\t\t\tlet hi = uEnd;\n\t\t\twhile (lo < hi) {\n\t\t\t\tconst mid = lo + (hi - lo) / 2;\n\t\t\t\tconst midVal = JaccardLayout.$.colIndices[mid] ?? 0;\n\t\t\t\tif (midVal === neighbour) {\n\t\t\t\t\tintersection = intersection + 1;\n\t\t\t\t\tlo = hi; // break\n\t\t\t\t} else if (midVal < neighbour) {\n\t\t\t\t\tlo = mid + 1;\n\t\t\t\t} else {\n\t\t\t\t\thi = mid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst unionSize = degU + degV - intersection;\n\tJaccardLayout.$.results[pairIdx] = intersection / unionSize;\n};\n\n/**\n * Dispatch batch Jaccard on GPU.\n *\n * @param root - TypeGPU root instance\n * @param csrBuffers - CSR matrix as typed buffers\n * @param pairsU - First node of each pair (u32 array)\n * @param pairsV - Second node of each pair (u32 array)\n * @param results - Output Jaccard coefficients (f32 array, mutable)\n * @param pairCount - Number of pairs to compute\n */\nexport function dispatchJaccard(\n\troot: GraphwiseGPURoot,\n\tcsrBuffers: TypedBufferGroup,\n\tpairsU: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.u32>>> & StorageFlag,\n\tpairsV: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.u32>>> & StorageFlag,\n\tresults: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.f32>>> & StorageFlag,\n\tpairCount: number,\n): void {\n\tconst pipeline = root.createGuardedComputePipeline(jaccardPipeline);\n\n\tconst pairCountBuffer = root.createBuffer(d.u32, pairCount).$usage(\"uniform\");\n\n\tconst bindGroup = root.createBindGroup(JaccardLayout, {\n\t\trowOffsets: csrBuffers.rowOffsets,\n\t\tcolIndices: csrBuffers.colIndices,\n\t\tpairsU,\n\t\tpairsV,\n\t\tresults,\n\t\tpairCount: pairCountBuffer,\n\t});\n\n\tpipeline.with(bindGroup).dispatchThreads(pairCount);\n}\n\nexport { JaccardLayout };\n","/**\n * TypeGPU compute kernel for degree computation.\n *\n * Computes degree per node from CSR row offsets.\n * Note: Histogram aggregation requires atomic operations or CPU reduction.\n *\n * @module gpu/kernels/degree-histogram/kernel\n */\n\nimport tgpu, { d, type StorageFlag, type TgpuBuffer } from \"typegpu\";\nimport type { TypedBufferGroup } from \"../../csr\";\nimport type { GraphwiseGPURoot } from \"../../root\";\n\n/**\n * Bind group layout for degree kernel.\n */\nconst DegreeLayout = tgpu.bindGroupLayout({\n\trowOffsets: { storage: d.arrayOf(d.u32) },\n\tdegrees: { storage: d.arrayOf(d.u32), access: \"mutable\" },\n\tnodeCount: { uniform: d.u32 },\n});\n\n/**\n * Degree compute pipeline: compute degree for each node.\n *\n * Each thread computes one node's degree from CSR row offsets:\n * degree[node] = rowOffsets[node+1] - rowOffsets[node]\n */\nconst degreePipeline = (node: number): void => {\n\t\"use gpu\";\n\tconst n = DegreeLayout.$.nodeCount ?? 0;\n\n\tif (node >= n) {\n\t\treturn;\n\t}\n\n\tconst start = DegreeLayout.$.rowOffsets[node] ?? 0;\n\tconst end = DegreeLayout.$.rowOffsets[node + 1] ?? 0;\n\tconst deg = end - start;\n\n\tDegreeLayout.$.degrees[node] = deg;\n};\n\n/**\n * Dispatch degree computation on GPU.\n *\n * Note: This computes per-node degrees. Histogram aggregation should be\n * done on CPU or with a separate reduction kernel.\n *\n * @param root - TypeGPU root instance\n * @param csrBuffers - CSR matrix as typed buffers\n * @param degrees - Output degree array (u32, mutable)\n * @param nodeCount - Number of nodes\n */\nexport function dispatchDegreeHistogram(\n\troot: GraphwiseGPURoot,\n\tcsrBuffers: TypedBufferGroup,\n\tdegrees: TgpuBuffer<ReturnType<typeof d.arrayOf<typeof d.u32>>> & StorageFlag,\n\tnodeCount: number,\n): void {\n\tconst pipeline = root.createGuardedComputePipeline(degreePipeline);\n\n\tconst nodeCountBuffer = root.createBuffer(d.u32, nodeCount).$usage(\"uniform\");\n\n\tconst bindGroup = root.createBindGroup(DegreeLayout, {\n\t\trowOffsets: csrBuffers.rowOffsets,\n\t\tdegrees,\n\t\tnodeCount: nodeCountBuffer,\n\t});\n\n\tpipeline.with(bindGroup).dispatchThreads(nodeCount);\n}\n\nexport { DegreeLayout };\n","/**\n * High-level GPU operations for graph algorithms.\n *\n * These functions accept ReadableGraph instances and handle CSR conversion\n * internally, providing a simple API for GPU-accelerated graph operations.\n *\n * @module gpu/operations\n */\n\nimport type { NodeData, EdgeData, NodeId, ReadableGraph } from \"../graph\";\nimport type { ComputeResult, GPUComputeOptions } from \"./types\";\nimport { withBackend, type DispatchOptions } from \"./dispatch\";\nimport { graphToCSR, csrToTypedBuffers } from \"./csr\";\nimport { dispatchSpmv } from \"./kernels/spmv/kernel\";\nimport { dispatchPagerank } from \"./kernels/pagerank/kernel\";\nimport { dispatchJaccard } from \"./kernels/jaccard/kernel\";\nimport { dispatchDegreeHistogram } from \"./kernels/degree-histogram/kernel\";\nimport type { GraphwiseGPURoot } from \"./root\";\nimport { d } from \"typegpu\";\n\n/**\n * Degree statistics from histogram computation.\n */\nexport interface DegreeStats {\n\t/** Minimum degree in the graph */\n\treadonly min: number;\n\t/** Maximum degree in the graph */\n\treadonly max: number;\n\t/** Average degree */\n\treadonly mean: number;\n\t/** Histogram of degree frequencies (index = degree, value = count) */\n\treadonly histogram: readonly number[];\n}\n\n/**\n * Sparse matrix-vector multiply on GPU.\n *\n * Computes y = A * x where A is the graph adjacency matrix in CSR format.\n *\n * @param graph - Input graph\n * @param x - Input vector (must have length = graph.nodeCount)\n * @param options - Compute options (backend, root, signal)\n * @returns Result vector y\n */\nexport async function gpuSpmv<N extends NodeData, E extends EdgeData>(\n\tgraph: ReadableGraph<N, E>,\n\tx: Float32Array,\n\toptions?: GPUComputeOptions & { signal?: AbortSignal },\n): Promise<ComputeResult<Float32Array>> {\n\tconst nodeCount = graph.nodeCount;\n\n\tif (x.length !== nodeCount) {\n\t\tthrow new Error(\n\t\t\t`Input vector length (${String(x.length)}) must match node count (${String(nodeCount)})`,\n\t\t);\n\t}\n\n\tconst cpuFn = (): Float32Array => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst y = new Float32Array(nodeCount);\n\n\t\tfor (let row = 0; row < nodeCount; row++) {\n\t\t\tconst start = csr.rowOffsets[row] ?? 0;\n\t\t\tconst end = csr.rowOffsets[row + 1] ?? 0;\n\t\t\tlet sum = 0;\n\n\t\t\tfor (let i = start; i < end; i++) {\n\t\t\t\tconst col = csr.colIndices[i] ?? 0;\n\t\t\t\tconst weight = csr.values?.[i] ?? 1;\n\t\t\t\tsum += weight * (x[col] ?? 0);\n\t\t\t}\n\n\t\t\ty[row] = sum;\n\t\t}\n\n\t\treturn y;\n\t};\n\n\tconst gpuFn = async (root: GraphwiseGPURoot): Promise<Float32Array> => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst csrBuffers = csrToTypedBuffers(root, csr);\n\n\t\tconst xBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.f32, nodeCount), Array.from(x))\n\t\t\t.$usage(\"storage\");\n\n\t\tconst yBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.f32, nodeCount))\n\t\t\t.$usage(\"storage\");\n\n\t\tdispatchSpmv(\n\t\t\troot,\n\t\t\tcsrBuffers,\n\t\t\txBuffer,\n\t\t\tyBuffer,\n\t\t\tnodeCount,\n\t\t\tcsr.values !== undefined,\n\t\t);\n\n\t\tconst result = await yBuffer.read();\n\t\treturn new Float32Array(result);\n\t};\n\n\tconst dispatchOpts: DispatchOptions = {\n\t\tbackend: options?.backend,\n\t\troot: options?.root,\n\t\tsignal: options?.signal,\n\t};\n\n\treturn withBackend(dispatchOpts, cpuFn, gpuFn);\n}\n\n/**\n * PageRank via GPU-accelerated power iteration.\n *\n * @param graph - Input graph (will be converted to transpose CSR for in-edges)\n * @param options - Compute options plus damping factor and iteration count\n * @returns PageRank scores for each node\n */\nexport async function gpuPageRank<N extends NodeData, E extends EdgeData>(\n\tgraph: ReadableGraph<N, E>,\n\toptions?: GPUComputeOptions & {\n\t\tdamping?: number;\n\t\titerations?: number;\n\t\tsignal?: AbortSignal;\n\t},\n): Promise<ComputeResult<Float32Array>> {\n\tconst nodeCount = graph.nodeCount;\n\tconst damping = options?.damping ?? 0.85;\n\tconst iterations = options?.iterations ?? 20;\n\n\tconst cpuFn = (): Float32Array => {\n\t\t// Build transpose CSR (in-edges) for PageRank\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst ranks = new Float32Array(nodeCount).fill(1 / nodeCount);\n\t\tconst outDegrees = new Uint32Array(nodeCount);\n\n\t\t// Compute out-degrees\n\t\tfor (let i = 0; i < nodeCount; i++) {\n\t\t\toutDegrees[i] = (csr.rowOffsets[i + 1] ?? 0) - (csr.rowOffsets[i] ?? 0);\n\t\t}\n\n\t\t// Power iteration\n\t\tfor (let iter = 0; iter < iterations; iter++) {\n\t\t\tconst newRanks = new Float32Array(nodeCount);\n\n\t\t\tfor (let v = 0; v < nodeCount; v++) {\n\t\t\t\tconst start = csr.rowOffsets[v] ?? 0;\n\t\t\t\tconst end = csr.rowOffsets[v + 1] ?? 0;\n\t\t\t\tlet contribution = 0;\n\n\t\t\t\tfor (let i = start; i < end; i++) {\n\t\t\t\t\tconst source = csr.colIndices[i] ?? 0;\n\t\t\t\t\tconst deg = outDegrees[source] ?? 0;\n\t\t\t\t\tif (deg > 0) {\n\t\t\t\t\t\tcontribution += (ranks[source] ?? 0) / deg;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnewRanks[v] = (1 - damping) / nodeCount + damping * contribution;\n\t\t\t}\n\n\t\t\tranks.set(newRanks);\n\t\t}\n\n\t\treturn ranks;\n\t};\n\n\tconst gpuFn = async (root: GraphwiseGPURoot): Promise<Float32Array> => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst csrBuffers = csrToTypedBuffers(root, csr);\n\n\t\t// Compute out-degrees\n\t\tconst outDegrees = new Uint32Array(nodeCount);\n\t\tfor (let i = 0; i < nodeCount; i++) {\n\t\t\toutDegrees[i] = (csr.rowOffsets[i + 1] ?? 0) - (csr.rowOffsets[i] ?? 0);\n\t\t}\n\n\t\tconst outDegreesBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.u32, nodeCount), Array.from(outDegrees))\n\t\t\t.$usage(\"storage\");\n\n\t\tconst ranksBuffer = root\n\t\t\t.createBuffer(\n\t\t\t\td.arrayOf(d.f32, nodeCount),\n\t\t\t\tArray.from(new Float32Array(nodeCount).fill(1 / nodeCount)),\n\t\t\t)\n\t\t\t.$usage(\"storage\");\n\n\t\tconst newRanksBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.f32, nodeCount))\n\t\t\t.$usage(\"storage\");\n\n\t\t// Power iteration\n\t\tfor (let iter = 0; iter < iterations; iter++) {\n\t\t\tdispatchPagerank(\n\t\t\t\troot,\n\t\t\t\tcsrBuffers,\n\t\t\t\tranksBuffer,\n\t\t\t\toutDegreesBuffer,\n\t\t\t\tnewRanksBuffer,\n\t\t\t\tnodeCount,\n\t\t\t\tdamping,\n\t\t\t);\n\n\t\t\t// Swap buffers by copying data back\n\t\t\tconst newRanks = await newRanksBuffer.read();\n\t\t\tranksBuffer.write(Array.from(newRanks));\n\t\t}\n\n\t\tconst result = await ranksBuffer.read();\n\t\treturn new Float32Array(result);\n\t};\n\n\tconst dispatchOpts: DispatchOptions = {\n\t\tbackend: options?.backend,\n\t\troot: options?.root,\n\t\tsignal: options?.signal,\n\t};\n\n\treturn withBackend(dispatchOpts, cpuFn, gpuFn);\n}\n\n/**\n * Batch Jaccard similarity for node pairs on GPU.\n *\n * @param graph - Input graph\n * @param pairs - Array of [u, v] node ID pairs\n * @param options - Compute options\n * @returns Jaccard coefficients for each pair\n */\nexport async function gpuJaccardBatch<N extends NodeData, E extends EdgeData>(\n\tgraph: ReadableGraph<N, E>,\n\tpairs: readonly [NodeId, NodeId][],\n\toptions?: GPUComputeOptions & { signal?: AbortSignal },\n): Promise<ComputeResult<Float32Array>> {\n\tconst pairCount = pairs.length;\n\tconst { indexMap } = graphToCSR(graph);\n\n\tconst cpuFn = (): Float32Array => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst results = new Float32Array(pairCount);\n\n\t\tfor (let p = 0; p < pairCount; p++) {\n\t\t\tconst pair = pairs[p];\n\t\t\tif (pair === undefined) continue;\n\t\t\tconst [u, v] = pair;\n\t\t\tconst uIdx = indexMap.nodeToIndex.get(u);\n\t\t\tconst vIdx = indexMap.nodeToIndex.get(v);\n\n\t\t\tif (uIdx === undefined || vIdx === undefined) {\n\t\t\t\tresults[p] = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst uStart = csr.rowOffsets[uIdx] ?? 0;\n\t\t\tconst uEnd = csr.rowOffsets[uIdx + 1] ?? 0;\n\t\t\tconst vStart = csr.rowOffsets[vIdx] ?? 0;\n\t\t\tconst vEnd = csr.rowOffsets[vIdx + 1] ?? 0;\n\n\t\t\tconst uNeighbours = new Set(\n\t\t\t\tArray.from(csr.colIndices.slice(uStart, uEnd)),\n\t\t\t);\n\t\t\tconst vNeighbours = new Set(\n\t\t\t\tArray.from(csr.colIndices.slice(vStart, vEnd)),\n\t\t\t);\n\n\t\t\tlet intersection = 0;\n\t\t\tfor (const n of uNeighbours) {\n\t\t\t\tif (vNeighbours.has(n)) {\n\t\t\t\t\tintersection++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst union = uNeighbours.size + vNeighbours.size - intersection;\n\t\t\tresults[p] = union > 0 ? intersection / union : 0;\n\t\t}\n\n\t\treturn results;\n\t};\n\n\tconst gpuFn = async (root: GraphwiseGPURoot): Promise<Float32Array> => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst csrBuffers = csrToTypedBuffers(root, csr);\n\n\t\tconst pairsU = new Uint32Array(pairCount);\n\t\tconst pairsV = new Uint32Array(pairCount);\n\n\t\tfor (let i = 0; i < pairCount; i++) {\n\t\t\tconst pair = pairs[i];\n\t\t\tif (pair === undefined) continue;\n\t\t\tconst uIdx = indexMap.nodeToIndex.get(pair[0]);\n\t\t\tconst vIdx = indexMap.nodeToIndex.get(pair[1]);\n\t\t\tpairsU[i] = uIdx ?? 0;\n\t\t\tpairsV[i] = vIdx ?? 0;\n\t\t}\n\n\t\tconst pairsUBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.u32, pairCount), Array.from(pairsU))\n\t\t\t.$usage(\"storage\");\n\n\t\tconst pairsVBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.u32, pairCount), Array.from(pairsV))\n\t\t\t.$usage(\"storage\");\n\n\t\tconst resultsBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.f32, pairCount))\n\t\t\t.$usage(\"storage\");\n\n\t\tdispatchJaccard(\n\t\t\troot,\n\t\t\tcsrBuffers,\n\t\t\tpairsUBuffer,\n\t\t\tpairsVBuffer,\n\t\t\tresultsBuffer,\n\t\t\tpairCount,\n\t\t);\n\n\t\tconst result = await resultsBuffer.read();\n\t\treturn new Float32Array(result);\n\t};\n\n\tconst dispatchOpts: DispatchOptions = {\n\t\tbackend: options?.backend,\n\t\troot: options?.root,\n\t\tsignal: options?.signal,\n\t};\n\n\treturn withBackend(dispatchOpts, cpuFn, gpuFn);\n}\n\n/**\n * BFS level assignment from source node on GPU.\n *\n * Note: Full GPU BFS requires atomics not yet available in TypeGPU.\n * This implementation uses CPU for now but maintains the API.\n *\n * @param graph - Input graph\n * @param source - Source node ID\n * @param options - Compute options\n * @returns BFS level for each node (-1 for unreachable)\n */\nexport async function gpuBfsLevels<N extends NodeData, E extends EdgeData>(\n\tgraph: ReadableGraph<N, E>,\n\tsource: NodeId,\n\toptions?: GPUComputeOptions & { signal?: AbortSignal },\n): Promise<ComputeResult<Int32Array>> {\n\tconst nodeCount = graph.nodeCount;\n\tconst { indexMap } = graphToCSR(graph);\n\n\tconst cpuFn = (): Int32Array => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst levels = new Int32Array(nodeCount).fill(-1);\n\t\tconst visited = new Uint8Array(nodeCount);\n\n\t\t// Find source index\n\t\tconst sourceIndex = indexMap.nodeToIndex.get(source);\n\t\tif (sourceIndex === undefined) {\n\t\t\tthrow new Error(`Source node ${source} not found in graph`);\n\t\t}\n\n\t\tconst queue: number[] = [sourceIndex];\n\t\tlevels[sourceIndex] = 0;\n\t\tvisited[sourceIndex] = 1;\n\n\t\twhile (queue.length > 0) {\n\t\t\tconst current = queue.shift();\n\t\t\tif (current === undefined) break;\n\t\t\tconst currentLevel = levels[current] ?? 0;\n\n\t\t\tconst start = csr.rowOffsets[current] ?? 0;\n\t\t\tconst end = csr.rowOffsets[current + 1] ?? 0;\n\n\t\t\tfor (let i = start; i < end; i++) {\n\t\t\t\tconst neighbour = csr.colIndices[i] ?? 0;\n\t\t\t\tif (visited[neighbour] === 0) {\n\t\t\t\t\tvisited[neighbour] = 1;\n\t\t\t\t\tlevels[neighbour] = currentLevel + 1;\n\t\t\t\t\tqueue.push(neighbour);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn levels;\n\t};\n\n\tconst gpuFn = (_root: GraphwiseGPURoot): Int32Array => {\n\t\t// BFS requires atomics not yet in TypeGPU - use CPU\n\t\t// _root is intentionally unused as we fall back to CPU implementation\n\t\tvoid _root;\n\t\treturn cpuFn();\n\t};\n\n\tconst dispatchOpts: DispatchOptions = {\n\t\tbackend: options?.backend,\n\t\troot: options?.root,\n\t\tsignal: options?.signal,\n\t};\n\n\treturn withBackend(dispatchOpts, cpuFn, gpuFn);\n}\n\n/**\n * Degree histogram and statistics on GPU.\n *\n * @param graph - Input graph\n * @param options - Compute options\n * @returns Degree statistics with histogram\n */\nexport async function gpuDegreeHistogram<\n\tN extends NodeData,\n\tE extends EdgeData,\n>(\n\tgraph: ReadableGraph<N, E>,\n\toptions?: GPUComputeOptions & { signal?: AbortSignal },\n): Promise<ComputeResult<DegreeStats>> {\n\tconst nodeCount = graph.nodeCount;\n\n\tconst cpuFn = (): DegreeStats => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst degrees = new Uint32Array(nodeCount);\n\n\t\tfor (let i = 0; i < nodeCount; i++) {\n\t\t\tdegrees[i] = (csr.rowOffsets[i + 1] ?? 0) - (csr.rowOffsets[i] ?? 0);\n\t\t}\n\n\t\tconst max = degrees.length > 0 ? Math.max(...degrees) : 0;\n\t\tconst histogram: number[] = Array.from({ length: max + 1 }, () => 0);\n\n\t\tlet sum = 0;\n\t\tlet min = Infinity;\n\n\t\tfor (const d of degrees) {\n\t\t\thistogram[d] = (histogram[d] ?? 0) + 1;\n\t\t\tsum += d;\n\t\t\tif (d < min) min = d;\n\t\t}\n\n\t\tif (degrees.length === 0) {\n\t\t\tmin = 0;\n\t\t}\n\n\t\treturn {\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tmean: nodeCount > 0 ? sum / nodeCount : 0,\n\t\t\thistogram,\n\t\t};\n\t};\n\n\tconst gpuFn = async (root: GraphwiseGPURoot): Promise<DegreeStats> => {\n\t\tconst { csr } = graphToCSR(graph);\n\t\tconst csrBuffers = csrToTypedBuffers(root, csr);\n\n\t\tconst degreesBuffer = root\n\t\t\t.createBuffer(d.arrayOf(d.u32, nodeCount))\n\t\t\t.$usage(\"storage\");\n\n\t\tdispatchDegreeHistogram(root, csrBuffers, degreesBuffer, nodeCount);\n\n\t\tconst degrees = await degreesBuffer.read();\n\n\t\t// Build histogram on CPU (atomic reduction not in TypeGPU yet)\n\t\tconst max = degrees.length > 0 ? Math.max(...degrees) : 0;\n\t\tconst histogram: number[] = Array.from({ length: max + 1 }, () => 0);\n\n\t\tlet sum = 0;\n\t\tlet min = Infinity;\n\n\t\tfor (const d of degrees) {\n\t\t\thistogram[d] = (histogram[d] ?? 0) + 1;\n\t\t\tsum += d;\n\t\t\tif (d < min) min = d;\n\t\t}\n\n\t\tif (degrees.length === 0) {\n\t\t\tmin = 0;\n\t\t}\n\n\t\treturn {\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tmean: nodeCount > 0 ? sum / nodeCount : 0,\n\t\t\thistogram,\n\t\t};\n\t};\n\n\tconst dispatchOpts: DispatchOptions = {\n\t\tbackend: options?.backend,\n\t\troot: options?.root,\n\t\tsignal: options?.signal,\n\t};\n\n\treturn withBackend(dispatchOpts, cpuFn, gpuFn);\n}\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],"mappings":";;;;;;;;;;;;;;;;AA+BA,IAAa,uBAAb,cAA0C,MAAM;CAC/C,YAAmB,QAAgB;AAClC,QAAM,yBAAyB,SAAS;AACxC,OAAK,OAAO;;;;;;;;;;;;AC1Bd,IAAM,MAAA,QAAA,IAAA,aAA+B;AACrC,IAAM,OAAA,QAAA,IAAA,aAAgC;;;ACRtC,IAAI,UAAU;;;ACEd,IAAM,YAAY,OAAO,WAAW,QAAQ,YAAY;;;;AAIxD,IAAM,cAAc,OAAO,WAAW,QAAQ,cAAc;;;;;AAK5D,IAAM,kBAAkB,OAAO,WAAW,QAAQ,kBAAkB;;;;AAIpE,IAAM,aAAa,OAAO,WAAW,QAAQ,aAAa;;;;AAI1D,IAAM,cAAc,OAAO,WAAW,QAAQ,cAAc;AAC5D,IAAM,WAAW,OAAO,WAAW,QAAQ,WAAW;;;;;AAKtD,IAAM,QAAQ,OAAO,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KR,SAAS,kBAAkB,OAAO;AACjC,QAAO,CAAC,CAAC,OAAO;;;;;AAKjB,IAAI,kBAAkB,MAAM,wBAAwB,MAAM;CACzD,YAAY,OAAO;AAClB,QAAM,aAAa,QAAQ,MAAM,IAAI,YAAY,qEAAqE;AACtH,SAAO,eAAe,MAAM,gBAAgB,UAAU;;;;;ACTxD,SAAS,YAAY,QAAQ;AAC5B,QAAO,SAAS;;;;ACDjB,IAAM,eAAe,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAC;AACF,IAAM,WAAW,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAC;AACF,SAAS,eAAe,QAAQ;AAC/B,KAAI,OAAQ,QAAO,OAAO,WAAW,OAAO,IAAI,CAAC,WAAW,YAAY,GAAG;AAC3E,QAAO;;;;;;;;;;;;AAYR,SAAS,kBAAkB,OAAO;AACjC,KAAI,UAAU,OAAO,MAAM,WAAW,KAAK,IAAI,KAAK,KAAK,MAAM,CAAE,OAAM,IAAI,MAAM,uBAAuB,MAAM,qEAAqE;CACnL,MAAM,SAAS,MAAM,MAAM,IAAI,CAAC;AAChC,QAAO,CAAC,aAAa,IAAI,OAAO,IAAI,CAAC,SAAS,IAAI,OAAO;;;;;AAK1D,SAAS,YAAY,OAAO;AAC3B,KAAI,UAAU,OAAO,MAAM,WAAW,KAAK,IAAI,KAAK,KAAK,MAAM,CAAE,OAAM,I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