typegpu 0.0.0-alpha.4 → 0.0.0-alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- package/chunk-337KOXP7.js +2 -0
- package/chunk-337KOXP7.js.map +1 -0
- package/chunk-6WFXH2OR.js +8 -0
- package/chunk-6WFXH2OR.js.map +1 -0
- package/chunk-G6QA55EY.cjs +8 -0
- package/chunk-G6QA55EY.cjs.map +1 -0
- package/chunk-S55XYV7U.cjs +2 -0
- package/chunk-S55XYV7U.cjs.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.d.cts +64 -23
- package/data/index.d.ts +64 -23
- package/data/index.js +1 -1
- package/index.cjs +1 -48
- package/index.cjs.map +1 -1
- package/index.d.cts +54 -330
- package/index.d.ts +54 -330
- package/index.js +1 -48
- package/index.js.map +1 -1
- package/macro/index.cjs +3 -3
- package/macro/index.cjs.map +1 -1
- package/macro/index.d.cts +1 -1
- package/macro/index.d.ts +1 -1
- package/macro/index.js +2 -2
- package/macro/index.js.map +1 -1
- package/package.json +7 -8
- package/types-DU0c7BuW.d.cts +207 -0
- package/types-DU0c7BuW.d.ts +207 -0
- package/chunk-7HTWRNOH.cjs +0 -12
- package/chunk-7HTWRNOH.cjs.map +0 -1
- package/chunk-K2GYQABQ.js +0 -12
- package/chunk-K2GYQABQ.js.map +0 -1
- package/std140-Cv7GDE9w.d.ts +0 -26
- package/std140-DRitCcmc.d.cts +0 -26
- package/types-ENDwr_p9.d.cts +0 -243
- package/types-ENDwr_p9.d.ts +0 -243
package/chunk-K2GYQABQ.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/data/std140.ts","../src/errors.ts","../src/data/alignIO.ts","../src/data/numeric.ts","../src/data/dynamicArray.ts","../src/types.ts","../src/wgslBuiltin.ts","../src/wgslIdentifier.ts","../src/wgslCode.ts","../src/data/struct.ts","../src/data/array.ts","../src/data/pointer.ts","../src/data/atomic.ts"],"sourcesContent":["/*\n * Typed-binary types that adhere to the `std140` layout rules.\n */\n\nimport {\n type AnySchema,\n type IMeasurer,\n type ISerialInput,\n type ISerialOutput,\n MaxValue,\n Measurer,\n type ParseUnwrapped,\n Schema,\n type Unwrap,\n} from 'typed-binary';\nimport { RecursiveDataTypeError } from '../errors';\nimport type { ResolutionCtx, Wgsl, WgslData } from '../types';\nimport alignIO from './alignIO';\n\nexport class SimpleWgslData<TSchema extends AnySchema>\n extends Schema<Unwrap<TSchema>>\n implements WgslData<Unwrap<TSchema>>\n{\n public readonly size: number;\n public readonly byteAlignment: number;\n public readonly expressionCode: Wgsl;\n\n private readonly _innerSchema: TSchema;\n\n /**\n * byteAlignment has to be a power of 2\n */\n constructor({\n schema,\n byteAlignment,\n code,\n }: {\n schema: TSchema;\n byteAlignment: number;\n code: Wgsl;\n }) {\n super();\n\n this._innerSchema = schema;\n this.byteAlignment = byteAlignment;\n this.expressionCode = code;\n this.size = this.measure(MaxValue).size;\n }\n\n resolveReferences(): void {\n throw new RecursiveDataTypeError();\n }\n\n write(output: ISerialOutput, value: ParseUnwrapped<TSchema>): void {\n alignIO(output, this.byteAlignment);\n this._innerSchema.write(output, value);\n }\n\n read(input: ISerialInput): ParseUnwrapped<TSchema> {\n alignIO(input, this.byteAlignment);\n return this._innerSchema.read(input) as ParseUnwrapped<TSchema>;\n }\n\n measure(\n value: ParseUnwrapped<TSchema> | MaxValue,\n measurer: IMeasurer = new Measurer(),\n ): IMeasurer {\n alignIO(measurer, this.byteAlignment);\n\n this._innerSchema.measure(value, measurer);\n\n return measurer;\n }\n\n getUnderlyingTypeString(): string {\n if (typeof this.expressionCode === 'string') {\n return this.expressionCode;\n }\n if ('elementSchema' in this._innerSchema) {\n const underlyingType = this._innerSchema\n .elementSchema as SimpleWgslData<AnySchema>;\n return underlyingType.getUnderlyingTypeString();\n }\n throw new Error('Unexpected type used as vertex buffer element');\n }\n\n getUnderlyingType(): SimpleWgslData<AnySchema> {\n if ('elementSchema' in this._innerSchema) {\n const underlyingType = this._innerSchema\n .elementSchema as SimpleWgslData<AnySchema>;\n return underlyingType.getUnderlyingType();\n }\n return this;\n }\n\n resolve(ctx: ResolutionCtx): string {\n return ctx.resolve(this.expressionCode);\n }\n}\n","import type { WgslResolvable, WgslSlot } from './types';\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 */\nexport class ResolutionError extends Error {\n constructor(\n public readonly cause: unknown,\n public readonly trace: WgslResolvable[],\n ) {\n let entries = trace.map((ancestor) => `- ${ancestor}`);\n\n // Showing only the root and leaf nodes.\n if (entries.length > 20) {\n entries = [...entries.slice(0, 11), '...', ...entries.slice(-10)];\n }\n\n super(`Resolution of the following tree failed: \\n${entries.join('\\n')}`);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, ResolutionError.prototype);\n }\n\n appendToTrace(ancestor: WgslResolvable): ResolutionError {\n const newTrace = [ancestor, ...this.trace];\n\n return new ResolutionError(this.cause, newTrace);\n }\n}\n\n/**\n * @category Errors\n */\nexport class MissingSlotValueError extends Error {\n constructor(public readonly slot: WgslSlot<unknown>) {\n super(`Missing value for '${slot}'`);\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, MissingSlotValueError.prototype);\n }\n}\n\n/**\n * @category Errors\n */\nexport class RecursiveDataTypeError extends Error {\n constructor() {\n super('Recursive types are not supported in WGSL');\n\n // Set the prototype explicitly.\n Object.setPrototypeOf(this, RecursiveDataTypeError.prototype);\n }\n}\n","import type { IMeasurer, ISerialInput, ISerialOutput } from 'typed-binary';\n\n/**\n * @param io the IO to align\n * @param baseAlignment must be power of 2\n */\nfunction alignIO(\n io: ISerialInput | ISerialOutput | IMeasurer,\n baseAlignment: number,\n) {\n const currentPos = 'size' in io ? io.size : io.currentByteOffset;\n\n const bitMask = baseAlignment - 1;\n const offset = currentPos & bitMask;\n\n if ('skipBytes' in io) {\n io.skipBytes((baseAlignment - offset) & bitMask);\n } else {\n io.add((baseAlignment - offset) & bitMask);\n }\n}\n\nexport default alignIO;\n","import * as TB from 'typed-binary';\nimport type { WgslData } from '../types';\nimport { SimpleWgslData } from './std140';\n\nexport type Bool = WgslData<boolean>;\nexport const bool: Bool = new SimpleWgslData({\n schema: TB.bool,\n byteAlignment: 4,\n code: 'bool',\n});\nexport type U32 = WgslData<number>;\nexport const u32: U32 = new SimpleWgslData({\n schema: TB.u32,\n byteAlignment: 4,\n code: 'u32',\n});\nexport type I32 = WgslData<number>;\nexport const i32: I32 = new SimpleWgslData({\n schema: TB.i32,\n byteAlignment: 4,\n code: 'i32',\n});\nexport type F32 = WgslData<number>;\nexport const f32: F32 = new SimpleWgslData({\n schema: TB.f32,\n byteAlignment: 4,\n code: 'f32',\n});\n\nexport type Vec2u = WgslData<[number, number]>;\nexport const vec2u: Vec2u = new SimpleWgslData({\n schema: TB.tupleOf([TB.u32, TB.u32]),\n byteAlignment: 8,\n code: 'vec2u',\n});\n\nexport type Vec2i = WgslData<[number, number]>;\nexport const vec2i: Vec2i = new SimpleWgslData({\n schema: TB.tupleOf([TB.i32, TB.i32]),\n byteAlignment: 8,\n code: 'vec2i',\n});\nexport type Vec2f = WgslData<[number, number]>;\nexport const vec2f: Vec2f = new SimpleWgslData({\n schema: TB.tupleOf([TB.f32, TB.f32]),\n byteAlignment: 8,\n code: 'vec2f',\n});\nexport type Vec3u = WgslData<[number, number, number]>;\nexport const vec3u: Vec3u = new SimpleWgslData({\n schema: TB.tupleOf([TB.u32, TB.u32, TB.u32]),\n byteAlignment: 16,\n code: 'vec3u',\n});\nexport type Vec3i = WgslData<[number, number, number]>;\nexport const vec3i: Vec3i = new SimpleWgslData({\n schema: TB.tupleOf([TB.i32, TB.i32, TB.i32]),\n byteAlignment: 16,\n code: 'vec3i',\n});\nexport type Vec3f = WgslData<[number, number, number]>;\nexport const vec3f: Vec3f = new SimpleWgslData({\n schema: TB.tupleOf([TB.f32, TB.f32, TB.f32]),\n byteAlignment: 16,\n code: 'vec3f',\n});\nexport type Vec4u = WgslData<[number, number, number, number]>;\nexport const vec4u: Vec4u = new SimpleWgslData({\n schema: TB.tupleOf([TB.u32, TB.u32, TB.u32, TB.u32]),\n byteAlignment: 16,\n code: 'vec4u',\n});\nexport type Vec4i = WgslData<[number, number, number, number]>;\nexport const vec4i: Vec4i = new SimpleWgslData({\n schema: TB.tupleOf([TB.i32, TB.i32, TB.i32, TB.i32]),\n byteAlignment: 16,\n code: 'vec4i',\n});\nexport type Vec4f = WgslData<[number, number, number, number]>;\nexport const vec4f: Vec4f = new SimpleWgslData({\n schema: TB.tupleOf([TB.f32, TB.f32, TB.f32, TB.f32]),\n byteAlignment: 16,\n code: 'vec4f',\n});\n\n/**\n * Array of column vectors\n */\nexport type Mat4f = WgslData<number[]>;\nexport const mat4f: Mat4f = new SimpleWgslData({\n schema: TB.arrayOf(TB.f32, 16),\n byteAlignment: 16,\n code: 'mat4x4f',\n});\n","import {\n type IMeasurer,\n type ISerialInput,\n type ISerialOutput,\n MaxValue,\n Measurer,\n type ParseUnwrapped,\n Schema,\n type Unwrap,\n ValidationError,\n} from 'typed-binary';\nimport { RecursiveDataTypeError } from '../errors';\nimport type { AnyWgslData, ResolutionCtx, WgslData } from '../types';\nimport { code } from '../wgslCode';\nimport { WgslIdentifier } from '../wgslIdentifier';\nimport alignIO from './alignIO';\nimport { u32 } from './numeric';\n\nclass DynamicArrayDataType<TElement extends WgslData<unknown>>\n extends Schema<Unwrap<TElement>[]>\n implements WgslData<Unwrap<TElement>[]>\n{\n private _label: string | undefined;\n\n public readonly byteAlignment: number;\n public readonly size: number;\n\n constructor(\n private readonly _elementType: TElement,\n public readonly capacity: number,\n ) {\n super();\n\n this.byteAlignment = Math.max(\n 4 /* u32 base alignment */,\n this._elementType.byteAlignment,\n );\n\n this.size = this.measure(MaxValue).size;\n }\n\n $name(label: string) {\n this._label = label;\n return this;\n }\n\n resolveReferences(): void {\n throw new RecursiveDataTypeError();\n }\n\n write(output: ISerialOutput, values: ParseUnwrapped<TElement>[]): void {\n if (values.length > this.capacity) {\n throw new ValidationError(\n `Tried to write too many values, ${values.length} > ${this.capacity}`,\n );\n }\n\n alignIO(output, this.byteAlignment); // aligning to the start\n u32.write(output, values.length);\n alignIO(output, this._elementType.byteAlignment); // aligning to the start of the array\n const startOffset = output.currentByteOffset;\n for (const value of values) {\n this._elementType.write(output, value);\n }\n output.seekTo(startOffset + this.capacity * this._elementType.size);\n }\n\n read(input: ISerialInput): ParseUnwrapped<TElement>[] {\n const array: ParseUnwrapped<TElement>[] = [];\n\n alignIO(input, this.byteAlignment); // aligning to the start\n const len = u32.read(input);\n alignIO(input, this._elementType.byteAlignment); // aligning to the start of the array\n const startOffset = input.currentByteOffset;\n for (let i = 0; i < len; ++i) {\n array.push(this._elementType.read(input) as ParseUnwrapped<TElement>);\n }\n input.seekTo(startOffset + this.capacity * this._elementType.size);\n\n return array;\n }\n\n measure(\n _values: ParseUnwrapped<TElement>[] | typeof MaxValue,\n measurer: IMeasurer = new Measurer(),\n ): IMeasurer {\n alignIO(measurer, this.byteAlignment); // aligning to the start\n\n // Length encoding\n u32.measure(MaxValue, measurer);\n\n // Aligning to the start of the array\n alignIO(measurer, this._elementType.byteAlignment);\n\n // Values encoding\n measurer.add(this._elementType.size * this.capacity);\n\n return measurer;\n }\n\n resolve(ctx: ResolutionCtx): string {\n const identifier = new WgslIdentifier().$name(this._label);\n\n ctx.addDeclaration(code`\n struct ${identifier} {\n count: u32,\n values: array<${this._elementType}, ${this.capacity}>,\n }`);\n\n return ctx.resolve(identifier);\n }\n}\n\nexport const dynamicArrayOf = <TSchema extends AnyWgslData>(\n elementType: TSchema,\n capacity: number,\n) => new DynamicArrayDataType(elementType, capacity);\n\nexport default DynamicArrayDataType;\n","import type { ISchema, Parsed } from 'typed-binary';\nimport type { F32, I32, U32, Vec4f, Vec4i, Vec4u } from './data';\nimport type { Builtin } from './wgslBuiltin';\nimport type { WgslIdentifier } from './wgslIdentifier';\nimport type { WgslPlum } from './wgslPlum';\n\nexport type Wgsl = string | number | WgslResolvable | symbol | boolean;\n\n/**\n * Passed into each resolvable item. All sibling items share a resolution ctx,\n * and a new resolution ctx is made when going down each level in the tree.\n */\nexport interface ResolutionCtx {\n /**\n * Slots that were used by items resolved by this context.\n */\n readonly usedSlots: Iterable<WgslSlot<unknown>>;\n\n addDeclaration(item: WgslResolvable): void;\n addBinding(bindable: WgslBindable, identifier: WgslIdentifier): void;\n addRenderResource(\n resource: WgslRenderResource,\n identifier: WgslIdentifier,\n ): void;\n addBuiltin(builtin: Builtin): void;\n nameFor(token: WgslResolvable): string;\n /**\n * Unwraps all layers of slot indirection and returns the concrete value if available.\n * @throws {MissingSlotValueError}\n */\n unwrap<T>(eventual: Eventual<T>): T;\n resolve(item: Wgsl, slotValueOverrides?: SlotValuePair<unknown>[]): string;\n}\n\nexport interface WgslResolvable {\n readonly label?: string | undefined;\n\n resolve(ctx: ResolutionCtx): string;\n}\n\nexport function isResolvable(value: unknown): value is WgslResolvable {\n return (\n !!value &&\n (typeof value === 'object' || typeof value === 'function') &&\n 'resolve' in value\n );\n}\n\nexport function isWgsl(value: unknown): value is Wgsl {\n return (\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'string' ||\n isResolvable(value)\n );\n}\n\nexport interface WgslSlot<T> {\n readonly __brand: 'WgslSlot';\n\n readonly defaultValue: T | undefined;\n\n readonly label?: string | undefined;\n\n $name(label: string): WgslSlot<T>;\n\n /**\n * Used to determine if code generated using either value `a` or `b` in place\n * of the slot will be equivalent. Defaults to `Object.is`.\n */\n areEqual(a: T, b: T): boolean;\n}\n\nexport function isSlot<T>(value: unknown | WgslSlot<T>): value is WgslSlot<T> {\n return (value as WgslSlot<T>).__brand === 'WgslSlot';\n}\n\n/**\n * Represents a value that is available at resolution time.\n */\nexport type Eventual<T> = T | WgslSlot<T>;\n\nexport type EventualGetter = <T>(value: Eventual<T>) => T;\n\nexport type InlineResolve = (get: EventualGetter) => Wgsl;\n\nexport interface WgslResolvableSlot<T extends Wgsl>\n extends WgslResolvable,\n WgslSlot<T> {\n $name(label: string): WgslResolvableSlot<T>;\n}\n\nexport type SlotValuePair<T> = [WgslSlot<T>, T];\n\nexport interface WgslAllocatable<TData extends AnyWgslData = AnyWgslData> {\n /**\n * The data type this allocatable was constructed with.\n * It informs the size and format of data in both JS and\n * binary.\n */\n readonly dataType: TData;\n vertexLayout: Omit<GPUVertexBufferLayout, 'attributes'> | null;\n readonly initial?: Parsed<TData> | WgslPlum<Parsed<TData>> | undefined;\n readonly flags: GPUBufferUsageFlags;\n get label(): string | undefined;\n}\n\nexport interface WgslBindable<\n TData extends AnyWgslData = AnyWgslData,\n TUsage extends BufferUsage = BufferUsage,\n> extends WgslResolvable {\n readonly allocatable: WgslAllocatable<TData>;\n readonly usage: TUsage;\n}\n\nexport type WgslSamplerType = 'sampler' | 'sampler_comparison';\nexport type WgslTypedTextureType =\n | 'texture_1d'\n | 'texture_2d'\n | 'texture_2d_array'\n | 'texture_3d'\n | 'texture_cube'\n | 'texture_cube_array'\n | 'texture_multisampled_2d';\nexport type WgslDepthTextureType =\n | 'texture_depth_2d'\n | 'texture_depth_2d_array'\n | 'texture_depth_cube'\n | 'texture_depth_cube_array'\n | 'texture_depth_multisampled_2d';\nexport type WgslStorageTextureType =\n | 'texture_storage_1d'\n | 'texture_storage_2d'\n | 'texture_storage_2d_array'\n | 'texture_storage_3d';\nexport type WgslExternalTextureType = 'texture_external';\n\nexport type WgslRenderResourceType =\n | WgslSamplerType\n | WgslTypedTextureType\n | WgslDepthTextureType\n | WgslStorageTextureType\n | WgslExternalTextureType;\n\nexport interface WgslRenderResource extends WgslResolvable {\n readonly type: WgslRenderResourceType;\n}\n\nexport type BufferUsage = 'uniform' | 'readonly' | 'mutable' | 'vertex';\nexport type TextureUsage = 'sampled' | 'storage';\nexport type StorageTextureAccess = 'read' | 'write' | 'read_write';\n\nexport type StorageTextureParams = {\n type: WgslStorageTextureType;\n access: StorageTextureAccess;\n descriptor?: GPUTextureViewDescriptor;\n};\nexport type SampledTextureParams = {\n type: WgslTypedTextureType;\n dataType: AnyWgslPrimitive;\n descriptor?: GPUTextureViewDescriptor;\n};\n\nexport function isSamplerType(\n type: WgslRenderResourceType,\n): type is WgslSamplerType {\n return type === 'sampler' || type === 'sampler_comparison';\n}\n\nexport function isTypedTextureType(\n type: WgslRenderResourceType,\n): type is WgslTypedTextureType {\n return [\n 'texture_1d',\n 'texture_2d',\n 'texture_2d_array',\n 'texture_3d',\n 'texture_cube',\n 'texture_cube_array',\n 'texture_multisampled_2d',\n ].includes(type);\n}\n\nexport function isDepthTextureType(\n type: WgslRenderResourceType,\n): type is WgslDepthTextureType {\n return [\n 'texture_depth_2d',\n 'texture_depth_2d_array',\n 'texture_depth_cube',\n 'texture_depth_cube_array',\n 'texture_depth_multisampled_2d',\n ].includes(type);\n}\n\nexport function isStorageTextureType(\n type: WgslRenderResourceType,\n): type is WgslStorageTextureType {\n return [\n 'texture_storage_1d',\n 'texture_storage_2d',\n 'texture_storage_2d_array',\n 'texture_storage_3d',\n ].includes(type);\n}\n\nexport function isExternalTextureType(\n type: WgslRenderResourceType,\n): type is WgslExternalTextureType {\n return type === 'texture_external';\n}\n\nexport interface WgslData<TInner> extends ISchema<TInner>, WgslResolvable {\n readonly byteAlignment: number;\n readonly size: number;\n}\n\nexport type AnyWgslData = WgslData<unknown>;\nexport type AnyWgslPrimitive = U32 | I32 | F32;\nexport type AnyWgslTexelFormat = Vec4u | Vec4i | Vec4f;\n\nexport interface WgslPointer<\n TScope extends 'function',\n TInner extends AnyWgslData,\n> {\n readonly scope: TScope;\n readonly pointsTo: TInner;\n}\n\n/**\n * A virtual representation of a WGSL value.\n */\nexport type WgslValue<TDataType> = {\n readonly __dataType: TDataType;\n};\n\nexport type AnyWgslPointer = WgslPointer<'function', AnyWgslData>;\n\nexport type WgslFnArgument = AnyWgslPointer | AnyWgslData;\n\nexport function isPointer(\n value: AnyWgslPointer | AnyWgslData,\n): value is AnyWgslPointer {\n return 'pointsTo' in value;\n}\n","import * as TB from 'typed-binary';\nimport type { F32, U32, Vec3u, Vec4f } from './data';\nimport { SimpleWgslData, f32, u32, vec3u, vec4f } from './data';\nimport type { WgslData } from './types';\nimport { WgslIdentifier } from './wgslIdentifier';\n\nexport type BuiltInPossibleTypes =\n | U32\n | F32\n | Vec3u\n | Vec4f\n | WgslData<TB.Unwrap<U32>[]>;\n\nexport const builtin = {\n vertexIndex: Symbol('builtin_vertexIndex'),\n instanceIndex: Symbol('builtin_instanceIndex'),\n position: Symbol('builtin_position'),\n clipDistances: Symbol('builtin_clipDistances'),\n frontFacing: Symbol('builtin_frontFacing'),\n fragDepth: Symbol('builtin_fragDepth'),\n sampleIndex: Symbol('builtin_sampleIndex'),\n sampleMask: Symbol('builtin_sampleMask'),\n fragment: Symbol('builtin_fragment'),\n localInvocationId: Symbol('builtin_localInvocationId'),\n localInvocationIndex: Symbol('builtin_localInvocationIndex'),\n globalInvocationId: Symbol('builtin_globalInvocationId'),\n workgroupId: Symbol('builtin_workgroupId'),\n numWorkgroups: Symbol('builtin_numWorkgroups'),\n} as const;\n\nexport interface Builtin {\n name: string;\n stage: 'vertex' | 'fragment' | 'compute';\n direction: 'input' | 'output';\n type: BuiltInPossibleTypes;\n identifier: WgslIdentifier;\n}\n\nconst builtinSymbolToObj: Record<symbol, Builtin> = {\n [builtin.vertexIndex]: {\n name: 'vertex_index',\n stage: 'vertex',\n direction: 'input',\n type: u32,\n identifier: new WgslIdentifier().$name('vertex_index'),\n },\n [builtin.instanceIndex]: {\n name: 'instance_index',\n stage: 'vertex',\n direction: 'input',\n type: u32,\n identifier: new WgslIdentifier().$name('instance_index'),\n },\n [builtin.position]: {\n name: 'position',\n stage: 'vertex',\n direction: 'output',\n type: vec4f,\n identifier: new WgslIdentifier().$name('position'),\n },\n [builtin.clipDistances]: {\n name: 'clip_distances',\n stage: 'vertex',\n direction: 'output',\n type: new SimpleWgslData({\n schema: TB.arrayOf(u32, 8),\n byteAlignment: 16,\n code: 'array<u32, 8>',\n }),\n identifier: new WgslIdentifier().$name('clip_distances'),\n },\n [builtin.frontFacing]: {\n name: 'front_facing',\n stage: 'fragment',\n direction: 'input',\n type: f32,\n identifier: new WgslIdentifier().$name('front_facing'),\n },\n [builtin.fragDepth]: {\n name: 'frag_depth',\n stage: 'fragment',\n direction: 'output',\n type: f32,\n identifier: new WgslIdentifier().$name('frag_depth'),\n },\n [builtin.sampleIndex]: {\n name: 'sample_index',\n stage: 'fragment',\n direction: 'input',\n type: u32,\n identifier: new WgslIdentifier().$name('sample_index'),\n },\n [builtin.sampleMask]: {\n name: 'sample_mask',\n stage: 'fragment',\n direction: 'input',\n type: u32,\n identifier: new WgslIdentifier().$name('sample_mask'),\n },\n [builtin.fragment]: {\n name: 'fragment',\n stage: 'fragment',\n direction: 'input',\n type: vec4f,\n identifier: new WgslIdentifier().$name('fragment'),\n },\n [builtin.localInvocationId]: {\n name: 'local_invocation_id',\n stage: 'compute',\n direction: 'input',\n type: vec3u,\n identifier: new WgslIdentifier().$name('local_invocation_id'),\n },\n [builtin.localInvocationIndex]: {\n name: 'local_invocation_index',\n stage: 'compute',\n direction: 'input',\n type: u32,\n identifier: new WgslIdentifier().$name('local_invocation_index'),\n },\n [builtin.globalInvocationId]: {\n name: 'global_invocation_id',\n stage: 'compute',\n direction: 'input',\n type: vec3u,\n identifier: new WgslIdentifier().$name('global_invocation_id'),\n },\n [builtin.workgroupId]: {\n name: 'workgroup_id',\n stage: 'compute',\n direction: 'input',\n type: vec3u,\n identifier: new WgslIdentifier().$name('workgroup_id'),\n },\n [builtin.numWorkgroups]: {\n name: 'num_workgroups',\n stage: 'compute',\n direction: 'input',\n type: vec3u,\n identifier: new WgslIdentifier().$name('num_workgroups'),\n },\n};\n\nexport function getBuiltinInfo(s: symbol): Builtin {\n const builtin = builtinSymbolToObj[s];\n if (!builtin) {\n throw new Error('Symbol is not a member of builtin');\n }\n return builtin;\n}\n\nexport function getUsedBuiltinsNamed(\n o: Record<symbol, string>,\n): { name: string; builtin: Builtin }[] {\n const res = Object.getOwnPropertySymbols(o).map((s) => {\n const builtin = builtinSymbolToObj[s];\n if (!builtin) {\n throw new Error('Symbol is not a member of builtin');\n }\n const name = o[s];\n if (!name) {\n throw new Error('Name is not provided');\n }\n return { name: name, builtin: builtin };\n });\n return res;\n}\n","import type { ResolutionCtx, WgslResolvable } from './types';\n\n/**\n * Helpful when creating new Resolvable types. For internal use.\n */\nexport class WgslIdentifier implements WgslResolvable {\n label?: string | undefined;\n\n $name(label: string | undefined) {\n this.label = label;\n return this;\n }\n\n resolve(ctx: ResolutionCtx): string {\n return ctx.nameFor(this);\n }\n\n toString(): string {\n return `id:${this.label ?? '<unnamed>'}`;\n }\n}\n","import {\n type Eventual,\n type InlineResolve,\n type ResolutionCtx,\n type SlotValuePair,\n type Wgsl,\n type WgslResolvable,\n type WgslSlot,\n isResolvable,\n} from './types';\nimport { getBuiltinInfo } from './wgslBuiltin';\n\n// ----------\n// Public API\n// ----------\n\nexport interface WgslCode extends WgslResolvable {\n $name(label?: string | undefined): WgslCode;\n\n with<T>(slot: WgslSlot<T>, value: Eventual<T>): BoundWgslCode;\n}\n\nexport type BoundWgslCode = Omit<WgslCode, '$name'>;\n\nexport function code(\n strings: TemplateStringsArray,\n ...params: (Wgsl | Wgsl[] | InlineResolve)[]\n): WgslCode {\n const segments: (Wgsl | InlineResolve)[] = strings.flatMap((string, idx) => {\n const param = params[idx];\n if (param === undefined) {\n return [string];\n }\n\n return Array.isArray(param) ? [string, ...param] : [string, param];\n });\n\n return new WgslCodeImpl(segments);\n}\n\n// --------------\n// Implementation\n// --------------\n\nclass WgslCodeImpl implements WgslCode {\n private _label: string | undefined;\n\n constructor(public readonly segments: (Wgsl | InlineResolve)[]) {}\n\n get label() {\n return this._label;\n }\n\n $name(label?: string | undefined) {\n this._label = label;\n return this;\n }\n\n resolve(ctx: ResolutionCtx) {\n let code = '';\n\n for (const s of this.segments) {\n if (typeof s === 'function') {\n const result = s((eventual) => ctx.unwrap(eventual));\n code += ctx.resolve(result);\n } else if (isResolvable(s)) {\n code += ctx.resolve(s);\n } else if (typeof s === 'symbol') {\n const builtin = getBuiltinInfo(s);\n ctx.addBuiltin(builtin);\n code += ctx.resolve(builtin.identifier);\n } else {\n code += String(s);\n }\n }\n\n return code;\n }\n\n with<TValue>(slot: WgslSlot<TValue>, value: Eventual<TValue>): BoundWgslCode {\n return new BoundWgslCodeImpl(this, [slot, value]);\n }\n\n toString(): string {\n return `code:${this._label ?? '<unnamed>'}`;\n }\n}\n\nclass BoundWgslCodeImpl<T> implements BoundWgslCode {\n constructor(\n private readonly _innerFn: BoundWgslCode,\n private readonly _slotValuePair: SlotValuePair<T>,\n ) {}\n\n get label() {\n return this._innerFn.label;\n }\n\n with<TValue>(slot: WgslSlot<TValue>, value: Eventual<TValue>): BoundWgslCode {\n return new BoundWgslCodeImpl(this, [slot, value]);\n }\n\n resolve(ctx: ResolutionCtx): string {\n return ctx.resolve(this._innerFn, [this._slotValuePair]);\n }\n\n toString(): string {\n const [slot, value] = this._slotValuePair;\n return `code:${this.label ?? '<unnamed>'}[${slot.label ?? '<unnamed>'}=${value}]`;\n }\n}\n","import {\n type IMeasurer,\n type ISchema,\n type ISerialInput,\n type ISerialOutput,\n MaxValue,\n Measurer,\n type Parsed,\n Schema,\n type UnwrapRecord,\n object,\n} from 'typed-binary';\nimport { RecursiveDataTypeError } from '../errors';\nimport type { AnyWgslData, ResolutionCtx, WgslData } from '../types';\nimport { code } from '../wgslCode';\nimport { WgslIdentifier } from '../wgslIdentifier';\nimport alignIO from './alignIO';\n\n// ----------\n// Public API\n// ----------\n\nexport interface WgslStruct<TProps extends Record<string, AnyWgslData>>\n extends ISchema<UnwrapRecord<TProps>>,\n WgslData<UnwrapRecord<TProps>> {\n $name(label: string): this;\n}\n\nexport const struct = <TProps extends Record<string, AnyWgslData>>(\n properties: TProps,\n): WgslStruct<TProps> => new WgslStructImpl(properties);\n\n// --------------\n// Implementation\n// --------------\n\nclass WgslStructImpl<TProps extends Record<string, AnyWgslData>>\n extends Schema<UnwrapRecord<TProps>>\n implements WgslData<UnwrapRecord<TProps>>\n{\n private _label: string | undefined;\n private _innerSchema: ISchema<UnwrapRecord<TProps>>;\n\n public readonly byteAlignment: number;\n public readonly size: number;\n\n constructor(private readonly _properties: TProps) {\n super();\n\n this._innerSchema = object(_properties);\n\n this.byteAlignment = Object.values(_properties)\n .map((prop) => prop.byteAlignment)\n .reduce((a, b) => (a > b ? a : b));\n\n this.size = this.measure(MaxValue).size;\n }\n\n $name(label: string) {\n this._label = label;\n return this;\n }\n\n resolveReferences(): void {\n throw new RecursiveDataTypeError();\n }\n\n write(output: ISerialOutput, value: Parsed<UnwrapRecord<TProps>>): void {\n this._innerSchema.write(output, value);\n }\n\n read(input: ISerialInput): Parsed<UnwrapRecord<TProps>> {\n return this._innerSchema.read(input);\n }\n\n measure(\n value: MaxValue | Parsed<UnwrapRecord<TProps>>,\n measurer: IMeasurer = new Measurer(),\n ): IMeasurer {\n alignIO(measurer, this.byteAlignment);\n this._innerSchema.measure(value, measurer);\n return measurer;\n }\n\n resolve(ctx: ResolutionCtx): string {\n const identifier = new WgslIdentifier().$name(this._label);\n\n ctx.addDeclaration(code`\n struct ${identifier} {\n ${Object.entries(this._properties).map(([key, field]) => code`${key}: ${field},\\n`)}\n }\n `);\n\n return ctx.resolve(identifier);\n }\n}\n","import * as TB from 'typed-binary';\nimport type { AnyWgslData, WgslData } from '../types';\nimport { code } from '../wgslCode';\nimport { SimpleWgslData } from './std140';\n\nexport type WgslArray<TElement extends AnyWgslData> = WgslData<\n TB.Unwrap<TElement>[]\n>;\n\nexport const arrayOf = <TElement extends AnyWgslData>(\n elementType: TElement,\n size: number,\n): WgslArray<TElement> =>\n new SimpleWgslData({\n schema: TB.arrayOf(elementType, size),\n byteAlignment: elementType.byteAlignment,\n code: code`array<${elementType}, ${size}>`,\n });\n","import type { AnyWgslData, WgslPointer } from '../types';\n\nexport function ptr<TDataType extends AnyWgslData>(\n pointsTo: TDataType,\n): WgslPointer<'function', TDataType> {\n return {\n scope: 'function',\n pointsTo,\n };\n}\n","import {\n type IMeasurer,\n type ISerialInput,\n type ISerialOutput,\n type MaxValue,\n Measurer,\n type ParseUnwrapped,\n Schema,\n type Unwrap,\n} from 'typed-binary';\nimport { RecursiveDataTypeError } from '../errors';\nimport type { ResolutionCtx, WgslData } from '../types';\nimport type { I32, U32 } from './numeric';\n\nexport function atomic<TSchema extends U32 | I32>(\n data: TSchema,\n): Atomic<TSchema> {\n return new AtomicImpl(data);\n}\n\nexport interface Atomic<TSchema extends U32 | I32>\n extends WgslData<Unwrap<TSchema>> {}\n\nclass AtomicImpl<TSchema extends U32 | I32>\n extends Schema<Unwrap<TSchema>>\n implements Atomic<TSchema>\n{\n public readonly size: number;\n public readonly byteAlignment: number;\n\n constructor(private readonly innerData: TSchema) {\n super();\n this.size = this.innerData.size;\n this.byteAlignment = this.innerData.byteAlignment;\n }\n\n resolveReferences(): void {\n throw new RecursiveDataTypeError();\n }\n\n write(output: ISerialOutput, value: ParseUnwrapped<TSchema>): void {\n this.innerData.write(output, value);\n }\n\n read(input: ISerialInput): ParseUnwrapped<TSchema> {\n return this.innerData.read(input) as ParseUnwrapped<TSchema>;\n }\n\n measure(\n value: ParseUnwrapped<TSchema> | MaxValue,\n measurer: IMeasurer = new Measurer(),\n ): IMeasurer {\n return this.innerData.measure(value, measurer);\n }\n\n resolve(ctx: ResolutionCtx): string {\n return `atomic<${ctx.resolve(this.innerData)}>`;\n }\n}\n"],"mappings":"soBAIA,OAKE,YAAAA,EACA,YAAAC,EAEA,UAAAC,MAEK,eCLA,IAAMC,EAAN,MAAMC,UAAwB,KAAM,CACzC,YACkBC,EACAC,EAChB,CACA,IAAIC,EAAUD,EAAM,IAAKE,GAAa,KAAKA,CAAQ,EAAE,EAGjDD,EAAQ,OAAS,KACnBA,EAAU,CAAC,GAAGA,EAAQ,MAAM,EAAG,EAAE,EAAG,MAAO,GAAGA,EAAQ,MAAM,GAAG,CAAC,GAGlE,MAAM;AAAA,EAA8CA,EAAQ,KAAK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C,EAAa,IAAIC,EAAe,EAAE,MAAM,KAAK,MAAM,EAEzD,OAAAF,EAAI,eAAeG;AAAA,eACRF,CAAU;AAAA,UACf,OAAO,QAAQ,KAAK,WAAW,EAAE,IAAI,CAAC,CAACG,EAAKC,CAAK,IAAMF,IAAOC,CAAG,KAAKC,CAAK,KAAK,CAAC;AAAA;AAAA,KAEtF,EAEML,EAAI,QAAQC,CAAU,CAC/B,CACF,EC/FA,UAAYK,MAAQ,eASb,IAAMC,GAAU,CACrBC,EACAC,IAEA,IAAIC,EAAe,CACjB,OAAW,UAAQF,EAAaC,CAAI,EACpC,cAAeD,EAAY,cAC3B,KAAMG,UAAaH,CAAW,KAAKC,CAAI,GACzC,CAAC,ECfI,SAASG,EACdC,EACoC,CACpC,MAAO,CACL,MAAO,WACP,SAAAA,CACF,CACF,CCTA,OAKE,YAAAC,EAEA,UAAAC,MAEK,eAKA,SAASC,EACdC,EACiB,CACjB,OAAO,IAAIC,EAAWD,CAAI,CAC5B,CAKA,IAAMC,EAAN,cACUC,CAEV,CAIE,YAA6BC,EAAoB,CAC/C,MAAM,EADqB,eAAAA,EAH7BC,EAAA,KAAgB,QAChBA,EAAA,KAAgB,iBAId,KAAK,KAAO,KAAK,UAAU,KAC3B,KAAK,cAAgB,KAAK,UAAU,aACtC,CAEA,mBAA0B,CACxB,MAAM,IAAIC,CACZ,CAEA,MAAMC,EAAuBC,EAAsC,CACjE,KAAK,UAAU,MAAMD,EAAQC,CAAK,CACpC,CAEA,KAAKC,EAA8C,CACjD,OAAO,KAAK,UAAU,KAAKA,CAAK,CAClC,CAEA,QACED,EACAE,EAAsB,IAAIC,EACf,CACX,OAAO,KAAK,UAAU,QAAQH,EAAOE,CAAQ,CAC/C,CAEA,QAAQE,EAA4B,CAClC,MAAO,UAAUA,EAAI,QAAQ,KAAK,SAAS,CAAC,GAC9C,CACF","names":["MaxValue","Measurer","Schema","ResolutionError","_ResolutionError","cause","trace","entries","ancestor","newTrace","MissingSlotValueError","_MissingSlotValueError","slot","RecursiveDataTypeError","_RecursiveDataTypeError","alignIO","io","baseAlignment","currentPos","bitMask","offset","alignIO_default","SimpleWgslData","Schema","schema","byteAlignment","code","__publicField","MaxValue","RecursiveDataTypeError","output","value","alignIO_default","input","measurer","Measurer","ctx","TB","bool","SimpleWgslData","u32","i32","f32","vec2u","vec2i","vec2f","vec3u","vec3i","vec3f","vec4u","vec4i","vec4f","mat4f","MaxValue","Measurer","Schema","ValidationError","isResolvable","value","isWgsl","isSlot","isSamplerType","type","isTypedTextureType","isDepthTextureType","isStorageTextureType","isExternalTextureType","isPointer","TB","WgslIdentifier","__publicField","label","ctx","_a","builtin","builtinSymbolToObj","u32","WgslIdentifier","vec4f","SimpleWgslData","f32","vec3u","getBuiltinInfo","s","getUsedBuiltinsNamed","o","name","code","strings","params","segments","string","idx","param","WgslCodeImpl","__publicField","label","ctx","s","result","eventual","isResolvable","builtin","getBuiltinInfo","slot","value","BoundWgslCodeImpl","_a","_BoundWgslCodeImpl","_innerFn","_slotValuePair","_b","DynamicArrayDataType","Schema","_elementType","capacity","__publicField","MaxValue","label","RecursiveDataTypeError","output","values","ValidationError","alignIO_default","u32","startOffset","value","input","array","len","i","_values","measurer","Measurer","ctx","identifier","WgslIdentifier","code","dynamicArrayOf","elementType","MaxValue","Measurer","Schema","object","struct","properties","WgslStructImpl","Schema","_properties","__publicField","object","prop","a","b","MaxValue","label","RecursiveDataTypeError","output","value","input","measurer","Measurer","alignIO_default","ctx","identifier","WgslIdentifier","code","key","field","TB","arrayOf","elementType","size","SimpleWgslData","code","ptr","pointsTo","Measurer","Schema","atomic","data","AtomicImpl","Schema","innerData","__publicField","RecursiveDataTypeError","output","value","input","measurer","Measurer","ctx"]}
|
package/std140-Cv7GDE9w.d.ts
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
import { AnySchema, Schema, Unwrap, ISerialOutput, ParseUnwrapped, ISerialInput, MaxValue, IMeasurer } from 'typed-binary';
|
2
|
-
import { M as WgslData, b as Wgsl, R as ResolutionCtx } from './types-ENDwr_p9.js';
|
3
|
-
|
4
|
-
declare class SimpleWgslData<TSchema extends AnySchema> extends Schema<Unwrap<TSchema>> implements WgslData<Unwrap<TSchema>> {
|
5
|
-
readonly size: number;
|
6
|
-
readonly byteAlignment: number;
|
7
|
-
readonly expressionCode: Wgsl;
|
8
|
-
private readonly _innerSchema;
|
9
|
-
/**
|
10
|
-
* byteAlignment has to be a power of 2
|
11
|
-
*/
|
12
|
-
constructor({ schema, byteAlignment, code, }: {
|
13
|
-
schema: TSchema;
|
14
|
-
byteAlignment: number;
|
15
|
-
code: Wgsl;
|
16
|
-
});
|
17
|
-
resolveReferences(): void;
|
18
|
-
write(output: ISerialOutput, value: ParseUnwrapped<TSchema>): void;
|
19
|
-
read(input: ISerialInput): ParseUnwrapped<TSchema>;
|
20
|
-
measure(value: ParseUnwrapped<TSchema> | MaxValue, measurer?: IMeasurer): IMeasurer;
|
21
|
-
getUnderlyingTypeString(): string;
|
22
|
-
getUnderlyingType(): SimpleWgslData<AnySchema>;
|
23
|
-
resolve(ctx: ResolutionCtx): string;
|
24
|
-
}
|
25
|
-
|
26
|
-
export { SimpleWgslData as S };
|
package/std140-DRitCcmc.d.cts
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
import { AnySchema, Schema, Unwrap, ISerialOutput, ParseUnwrapped, ISerialInput, MaxValue, IMeasurer } from 'typed-binary';
|
2
|
-
import { M as WgslData, b as Wgsl, R as ResolutionCtx } from './types-ENDwr_p9.cjs';
|
3
|
-
|
4
|
-
declare class SimpleWgslData<TSchema extends AnySchema> extends Schema<Unwrap<TSchema>> implements WgslData<Unwrap<TSchema>> {
|
5
|
-
readonly size: number;
|
6
|
-
readonly byteAlignment: number;
|
7
|
-
readonly expressionCode: Wgsl;
|
8
|
-
private readonly _innerSchema;
|
9
|
-
/**
|
10
|
-
* byteAlignment has to be a power of 2
|
11
|
-
*/
|
12
|
-
constructor({ schema, byteAlignment, code, }: {
|
13
|
-
schema: TSchema;
|
14
|
-
byteAlignment: number;
|
15
|
-
code: Wgsl;
|
16
|
-
});
|
17
|
-
resolveReferences(): void;
|
18
|
-
write(output: ISerialOutput, value: ParseUnwrapped<TSchema>): void;
|
19
|
-
read(input: ISerialInput): ParseUnwrapped<TSchema>;
|
20
|
-
measure(value: ParseUnwrapped<TSchema> | MaxValue, measurer?: IMeasurer): IMeasurer;
|
21
|
-
getUnderlyingTypeString(): string;
|
22
|
-
getUnderlyingType(): SimpleWgslData<AnySchema>;
|
23
|
-
resolve(ctx: ResolutionCtx): string;
|
24
|
-
}
|
25
|
-
|
26
|
-
export { SimpleWgslData as S };
|
package/types-ENDwr_p9.d.cts
DELETED
@@ -1,243 +0,0 @@
|
|
1
|
-
import * as TB from 'typed-binary';
|
2
|
-
import { Parsed, ISchema } from 'typed-binary';
|
3
|
-
|
4
|
-
type Bool = WgslData<boolean>;
|
5
|
-
declare const bool: Bool;
|
6
|
-
type U32 = WgslData<number>;
|
7
|
-
declare const u32: U32;
|
8
|
-
type I32 = WgslData<number>;
|
9
|
-
declare const i32: I32;
|
10
|
-
type F32 = WgslData<number>;
|
11
|
-
declare const f32: F32;
|
12
|
-
type Vec2u = WgslData<[number, number]>;
|
13
|
-
declare const vec2u: Vec2u;
|
14
|
-
type Vec2i = WgslData<[number, number]>;
|
15
|
-
declare const vec2i: Vec2i;
|
16
|
-
type Vec2f = WgslData<[number, number]>;
|
17
|
-
declare const vec2f: Vec2f;
|
18
|
-
type Vec3u = WgslData<[number, number, number]>;
|
19
|
-
declare const vec3u: Vec3u;
|
20
|
-
type Vec3i = WgslData<[number, number, number]>;
|
21
|
-
declare const vec3i: Vec3i;
|
22
|
-
type Vec3f = WgslData<[number, number, number]>;
|
23
|
-
declare const vec3f: Vec3f;
|
24
|
-
type Vec4u = WgslData<[number, number, number, number]>;
|
25
|
-
declare const vec4u: Vec4u;
|
26
|
-
type Vec4i = WgslData<[number, number, number, number]>;
|
27
|
-
declare const vec4i: Vec4i;
|
28
|
-
type Vec4f = WgslData<[number, number, number, number]>;
|
29
|
-
declare const vec4f: Vec4f;
|
30
|
-
/**
|
31
|
-
* Array of column vectors
|
32
|
-
*/
|
33
|
-
type Mat4f = WgslData<number[]>;
|
34
|
-
declare const mat4f: Mat4f;
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Helpful when creating new Resolvable types. For internal use.
|
38
|
-
*/
|
39
|
-
declare class WgslIdentifier implements WgslResolvable {
|
40
|
-
label?: string | undefined;
|
41
|
-
$name(label: string | undefined): this;
|
42
|
-
resolve(ctx: ResolutionCtx): string;
|
43
|
-
toString(): string;
|
44
|
-
}
|
45
|
-
|
46
|
-
type BuiltInPossibleTypes = U32 | F32 | Vec3u | Vec4f | WgslData<TB.Unwrap<U32>[]>;
|
47
|
-
declare const builtin: {
|
48
|
-
readonly vertexIndex: symbol;
|
49
|
-
readonly instanceIndex: symbol;
|
50
|
-
readonly position: symbol;
|
51
|
-
readonly clipDistances: symbol;
|
52
|
-
readonly frontFacing: symbol;
|
53
|
-
readonly fragDepth: symbol;
|
54
|
-
readonly sampleIndex: symbol;
|
55
|
-
readonly sampleMask: symbol;
|
56
|
-
readonly fragment: symbol;
|
57
|
-
readonly localInvocationId: symbol;
|
58
|
-
readonly localInvocationIndex: symbol;
|
59
|
-
readonly globalInvocationId: symbol;
|
60
|
-
readonly workgroupId: symbol;
|
61
|
-
readonly numWorkgroups: symbol;
|
62
|
-
};
|
63
|
-
interface Builtin {
|
64
|
-
name: string;
|
65
|
-
stage: 'vertex' | 'fragment' | 'compute';
|
66
|
-
direction: 'input' | 'output';
|
67
|
-
type: BuiltInPossibleTypes;
|
68
|
-
identifier: WgslIdentifier;
|
69
|
-
}
|
70
|
-
declare function getBuiltinInfo(s: symbol): Builtin;
|
71
|
-
declare function getUsedBuiltinsNamed(o: Record<symbol, string>): {
|
72
|
-
name: string;
|
73
|
-
builtin: Builtin;
|
74
|
-
}[];
|
75
|
-
|
76
|
-
declare const WgslSettableTrait: unique symbol;
|
77
|
-
interface WgslSettable {
|
78
|
-
readonly [WgslSettableTrait]: true;
|
79
|
-
}
|
80
|
-
|
81
|
-
type Getter = <T>(plum: WgslPlum<T>) => T;
|
82
|
-
type Unsubscribe = () => unknown;
|
83
|
-
type ExtractPlumValue<T> = T extends WgslPlum<infer TValue> ? TValue : never;
|
84
|
-
interface WgslPlum<TValue = unknown> {
|
85
|
-
readonly __brand: 'WgslPlum';
|
86
|
-
$name(label: string): this;
|
87
|
-
/**
|
88
|
-
* Computes the value of this plum. Circumvents the store
|
89
|
-
* memoization, so use with care.
|
90
|
-
*/
|
91
|
-
compute(get: Getter): TValue;
|
92
|
-
}
|
93
|
-
declare const WgslExternalPlumTrait: unique symbol;
|
94
|
-
interface WgslExternalPlum {
|
95
|
-
readonly [WgslExternalPlumTrait]: true;
|
96
|
-
readonly version: number;
|
97
|
-
subscribe(listener: () => unknown): Unsubscribe;
|
98
|
-
}
|
99
|
-
/**
|
100
|
-
* Creates a computed plum. Its value depends on the plums read using `get`
|
101
|
-
* inside the `compute` function, so cannot be set imperatively.
|
102
|
-
*
|
103
|
-
* @param compute A pure function that describes this plum's value.
|
104
|
-
*/
|
105
|
-
declare function plum<T extends Wgsl>(compute: (get: Getter) => T): WgslPlum<T> & WgslResolvable;
|
106
|
-
/**
|
107
|
-
* Creates a computed plum. Its value depends on the plums read using `get`
|
108
|
-
* inside the `compute` function, so cannot be set imperatively.
|
109
|
-
*
|
110
|
-
* @param compute A pure function that describes this plum's value.
|
111
|
-
*/
|
112
|
-
declare function plum<T>(compute: (get: Getter) => T): WgslPlum<T>;
|
113
|
-
/**
|
114
|
-
* Creates a plum with an initial value of `initial`.
|
115
|
-
* Its value can be updated by calling `runtime.setPlum(thePlum, newValue)`.
|
116
|
-
*
|
117
|
-
* @param initial The initial value of this plum.
|
118
|
-
*/
|
119
|
-
declare function plum<T extends Wgsl>(initial: T): WgslPlum<T> & WgslSettable & WgslResolvable;
|
120
|
-
/**
|
121
|
-
* Creates a plum with an initial value of `initial`.
|
122
|
-
* Its value can be updated by calling `runtime.setPlum(thePlum, newValue)`.
|
123
|
-
*
|
124
|
-
* @param initial The initial value of this plum.
|
125
|
-
*/
|
126
|
-
declare function plum<T>(initial: T): WgslPlum<T> & WgslSettable;
|
127
|
-
declare function plumFromEvent<T>(subscribe: (listener: () => unknown) => Unsubscribe, getLatest: () => T): WgslPlum<T> & WgslExternalPlum;
|
128
|
-
|
129
|
-
type Wgsl = string | number | WgslResolvable | symbol | boolean;
|
130
|
-
/**
|
131
|
-
* Passed into each resolvable item. All sibling items share a resolution ctx,
|
132
|
-
* and a new resolution ctx is made when going down each level in the tree.
|
133
|
-
*/
|
134
|
-
interface ResolutionCtx {
|
135
|
-
/**
|
136
|
-
* Slots that were used by items resolved by this context.
|
137
|
-
*/
|
138
|
-
readonly usedSlots: Iterable<WgslSlot<unknown>>;
|
139
|
-
addDeclaration(item: WgslResolvable): void;
|
140
|
-
addBinding(bindable: WgslBindable, identifier: WgslIdentifier): void;
|
141
|
-
addRenderResource(resource: WgslRenderResource, identifier: WgslIdentifier): void;
|
142
|
-
addBuiltin(builtin: Builtin): void;
|
143
|
-
nameFor(token: WgslResolvable): string;
|
144
|
-
/**
|
145
|
-
* Unwraps all layers of slot indirection and returns the concrete value if available.
|
146
|
-
* @throws {MissingSlotValueError}
|
147
|
-
*/
|
148
|
-
unwrap<T>(eventual: Eventual<T>): T;
|
149
|
-
resolve(item: Wgsl, slotValueOverrides?: SlotValuePair<unknown>[]): string;
|
150
|
-
}
|
151
|
-
interface WgslResolvable {
|
152
|
-
readonly label?: string | undefined;
|
153
|
-
resolve(ctx: ResolutionCtx): string;
|
154
|
-
}
|
155
|
-
declare function isResolvable(value: unknown): value is WgslResolvable;
|
156
|
-
declare function isWgsl(value: unknown): value is Wgsl;
|
157
|
-
interface WgslSlot<T> {
|
158
|
-
readonly __brand: 'WgslSlot';
|
159
|
-
readonly defaultValue: T | undefined;
|
160
|
-
readonly label?: string | undefined;
|
161
|
-
$name(label: string): WgslSlot<T>;
|
162
|
-
/**
|
163
|
-
* Used to determine if code generated using either value `a` or `b` in place
|
164
|
-
* of the slot will be equivalent. Defaults to `Object.is`.
|
165
|
-
*/
|
166
|
-
areEqual(a: T, b: T): boolean;
|
167
|
-
}
|
168
|
-
declare function isSlot<T>(value: unknown | WgslSlot<T>): value is WgslSlot<T>;
|
169
|
-
/**
|
170
|
-
* Represents a value that is available at resolution time.
|
171
|
-
*/
|
172
|
-
type Eventual<T> = T | WgslSlot<T>;
|
173
|
-
type EventualGetter = <T>(value: Eventual<T>) => T;
|
174
|
-
type InlineResolve = (get: EventualGetter) => Wgsl;
|
175
|
-
interface WgslResolvableSlot<T extends Wgsl> extends WgslResolvable, WgslSlot<T> {
|
176
|
-
$name(label: string): WgslResolvableSlot<T>;
|
177
|
-
}
|
178
|
-
type SlotValuePair<T> = [WgslSlot<T>, T];
|
179
|
-
interface WgslAllocatable<TData extends AnyWgslData = AnyWgslData> {
|
180
|
-
/**
|
181
|
-
* The data type this allocatable was constructed with.
|
182
|
-
* It informs the size and format of data in both JS and
|
183
|
-
* binary.
|
184
|
-
*/
|
185
|
-
readonly dataType: TData;
|
186
|
-
vertexLayout: Omit<GPUVertexBufferLayout, 'attributes'> | null;
|
187
|
-
readonly initial?: Parsed<TData> | WgslPlum<Parsed<TData>> | undefined;
|
188
|
-
readonly flags: GPUBufferUsageFlags;
|
189
|
-
get label(): string | undefined;
|
190
|
-
}
|
191
|
-
interface WgslBindable<TData extends AnyWgslData = AnyWgslData, TUsage extends BufferUsage = BufferUsage> extends WgslResolvable {
|
192
|
-
readonly allocatable: WgslAllocatable<TData>;
|
193
|
-
readonly usage: TUsage;
|
194
|
-
}
|
195
|
-
type WgslSamplerType = 'sampler' | 'sampler_comparison';
|
196
|
-
type WgslTypedTextureType = 'texture_1d' | 'texture_2d' | 'texture_2d_array' | 'texture_3d' | 'texture_cube' | 'texture_cube_array' | 'texture_multisampled_2d';
|
197
|
-
type WgslDepthTextureType = 'texture_depth_2d' | 'texture_depth_2d_array' | 'texture_depth_cube' | 'texture_depth_cube_array' | 'texture_depth_multisampled_2d';
|
198
|
-
type WgslStorageTextureType = 'texture_storage_1d' | 'texture_storage_2d' | 'texture_storage_2d_array' | 'texture_storage_3d';
|
199
|
-
type WgslExternalTextureType = 'texture_external';
|
200
|
-
type WgslRenderResourceType = WgslSamplerType | WgslTypedTextureType | WgslDepthTextureType | WgslStorageTextureType | WgslExternalTextureType;
|
201
|
-
interface WgslRenderResource extends WgslResolvable {
|
202
|
-
readonly type: WgslRenderResourceType;
|
203
|
-
}
|
204
|
-
type BufferUsage = 'uniform' | 'readonly' | 'mutable' | 'vertex';
|
205
|
-
type TextureUsage = 'sampled' | 'storage';
|
206
|
-
type StorageTextureAccess = 'read' | 'write' | 'read_write';
|
207
|
-
type StorageTextureParams = {
|
208
|
-
type: WgslStorageTextureType;
|
209
|
-
access: StorageTextureAccess;
|
210
|
-
descriptor?: GPUTextureViewDescriptor;
|
211
|
-
};
|
212
|
-
type SampledTextureParams = {
|
213
|
-
type: WgslTypedTextureType;
|
214
|
-
dataType: AnyWgslPrimitive;
|
215
|
-
descriptor?: GPUTextureViewDescriptor;
|
216
|
-
};
|
217
|
-
declare function isSamplerType(type: WgslRenderResourceType): type is WgslSamplerType;
|
218
|
-
declare function isTypedTextureType(type: WgslRenderResourceType): type is WgslTypedTextureType;
|
219
|
-
declare function isDepthTextureType(type: WgslRenderResourceType): type is WgslDepthTextureType;
|
220
|
-
declare function isStorageTextureType(type: WgslRenderResourceType): type is WgslStorageTextureType;
|
221
|
-
declare function isExternalTextureType(type: WgslRenderResourceType): type is WgslExternalTextureType;
|
222
|
-
interface WgslData<TInner> extends ISchema<TInner>, WgslResolvable {
|
223
|
-
readonly byteAlignment: number;
|
224
|
-
readonly size: number;
|
225
|
-
}
|
226
|
-
type AnyWgslData = WgslData<unknown>;
|
227
|
-
type AnyWgslPrimitive = U32 | I32 | F32;
|
228
|
-
type AnyWgslTexelFormat = Vec4u | Vec4i | Vec4f;
|
229
|
-
interface WgslPointer<TScope extends 'function', TInner extends AnyWgslData> {
|
230
|
-
readonly scope: TScope;
|
231
|
-
readonly pointsTo: TInner;
|
232
|
-
}
|
233
|
-
/**
|
234
|
-
* A virtual representation of a WGSL value.
|
235
|
-
*/
|
236
|
-
type WgslValue<TDataType> = {
|
237
|
-
readonly __dataType: TDataType;
|
238
|
-
};
|
239
|
-
type AnyWgslPointer = WgslPointer<'function', AnyWgslData>;
|
240
|
-
type WgslFnArgument = AnyWgslPointer | AnyWgslData;
|
241
|
-
declare function isPointer(value: AnyWgslPointer | AnyWgslData): value is AnyWgslPointer;
|
242
|
-
|
243
|
-
export { type I32 as $, type AnyWgslTexelFormat as A, type BufferUsage as B, type WgslDepthTextureType as C, type WgslStorageTextureType as D, type Eventual as E, type WgslExternalTextureType as F, isSamplerType as G, isTypedTextureType as H, type InlineResolve as I, isDepthTextureType as J, isStorageTextureType as K, isExternalTextureType as L, type WgslData as M, type WgslPointer as N, type AnyWgslPointer as O, isPointer as P, type BuiltInPossibleTypes as Q, type ResolutionCtx as R, type StorageTextureParams as S, type TextureUsage as T, type Unsubscribe as U, builtin as V, type WgslResolvable as W, type Builtin as X, getBuiltinInfo as Y, getUsedBuiltinsNamed as Z, type U32 as _, type WgslSlot as a, type Bool as a0, bool as a1, u32 as a2, i32 as a3, type F32 as a4, f32 as a5, type Vec2u as a6, vec2u as a7, type Vec2i as a8, vec2i as a9, type Vec2f as aa, vec2f as ab, type Vec3u as ac, vec3u as ad, type Vec3i as ae, vec3i as af, type Vec3f as ag, vec3f as ah, type Vec4u as ai, vec4u as aj, type Vec4i as ak, vec4i as al, type Vec4f as am, vec4f as an, type Mat4f as ao, mat4f as ap, type Wgsl as b, type WgslRenderResource as c, type SampledTextureParams as d, type AnyWgslPrimitive as e, type WgslRenderResourceType as f, type StorageTextureAccess as g, type WgslPlum as h, type ExtractPlumValue as i, type WgslSettable as j, type AnyWgslData as k, type WgslAllocatable as l, type WgslBindable as m, type WgslFnArgument as n, type WgslValue as o, WgslIdentifier as p, type WgslResolvableSlot as q, plum as r, plumFromEvent as s, isResolvable as t, isWgsl as u, isSlot as v, type EventualGetter as w, type SlotValuePair as x, type WgslSamplerType as y, type WgslTypedTextureType as z };
|
package/types-ENDwr_p9.d.ts
DELETED
@@ -1,243 +0,0 @@
|
|
1
|
-
import * as TB from 'typed-binary';
|
2
|
-
import { Parsed, ISchema } from 'typed-binary';
|
3
|
-
|
4
|
-
type Bool = WgslData<boolean>;
|
5
|
-
declare const bool: Bool;
|
6
|
-
type U32 = WgslData<number>;
|
7
|
-
declare const u32: U32;
|
8
|
-
type I32 = WgslData<number>;
|
9
|
-
declare const i32: I32;
|
10
|
-
type F32 = WgslData<number>;
|
11
|
-
declare const f32: F32;
|
12
|
-
type Vec2u = WgslData<[number, number]>;
|
13
|
-
declare const vec2u: Vec2u;
|
14
|
-
type Vec2i = WgslData<[number, number]>;
|
15
|
-
declare const vec2i: Vec2i;
|
16
|
-
type Vec2f = WgslData<[number, number]>;
|
17
|
-
declare const vec2f: Vec2f;
|
18
|
-
type Vec3u = WgslData<[number, number, number]>;
|
19
|
-
declare const vec3u: Vec3u;
|
20
|
-
type Vec3i = WgslData<[number, number, number]>;
|
21
|
-
declare const vec3i: Vec3i;
|
22
|
-
type Vec3f = WgslData<[number, number, number]>;
|
23
|
-
declare const vec3f: Vec3f;
|
24
|
-
type Vec4u = WgslData<[number, number, number, number]>;
|
25
|
-
declare const vec4u: Vec4u;
|
26
|
-
type Vec4i = WgslData<[number, number, number, number]>;
|
27
|
-
declare const vec4i: Vec4i;
|
28
|
-
type Vec4f = WgslData<[number, number, number, number]>;
|
29
|
-
declare const vec4f: Vec4f;
|
30
|
-
/**
|
31
|
-
* Array of column vectors
|
32
|
-
*/
|
33
|
-
type Mat4f = WgslData<number[]>;
|
34
|
-
declare const mat4f: Mat4f;
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Helpful when creating new Resolvable types. For internal use.
|
38
|
-
*/
|
39
|
-
declare class WgslIdentifier implements WgslResolvable {
|
40
|
-
label?: string | undefined;
|
41
|
-
$name(label: string | undefined): this;
|
42
|
-
resolve(ctx: ResolutionCtx): string;
|
43
|
-
toString(): string;
|
44
|
-
}
|
45
|
-
|
46
|
-
type BuiltInPossibleTypes = U32 | F32 | Vec3u | Vec4f | WgslData<TB.Unwrap<U32>[]>;
|
47
|
-
declare const builtin: {
|
48
|
-
readonly vertexIndex: symbol;
|
49
|
-
readonly instanceIndex: symbol;
|
50
|
-
readonly position: symbol;
|
51
|
-
readonly clipDistances: symbol;
|
52
|
-
readonly frontFacing: symbol;
|
53
|
-
readonly fragDepth: symbol;
|
54
|
-
readonly sampleIndex: symbol;
|
55
|
-
readonly sampleMask: symbol;
|
56
|
-
readonly fragment: symbol;
|
57
|
-
readonly localInvocationId: symbol;
|
58
|
-
readonly localInvocationIndex: symbol;
|
59
|
-
readonly globalInvocationId: symbol;
|
60
|
-
readonly workgroupId: symbol;
|
61
|
-
readonly numWorkgroups: symbol;
|
62
|
-
};
|
63
|
-
interface Builtin {
|
64
|
-
name: string;
|
65
|
-
stage: 'vertex' | 'fragment' | 'compute';
|
66
|
-
direction: 'input' | 'output';
|
67
|
-
type: BuiltInPossibleTypes;
|
68
|
-
identifier: WgslIdentifier;
|
69
|
-
}
|
70
|
-
declare function getBuiltinInfo(s: symbol): Builtin;
|
71
|
-
declare function getUsedBuiltinsNamed(o: Record<symbol, string>): {
|
72
|
-
name: string;
|
73
|
-
builtin: Builtin;
|
74
|
-
}[];
|
75
|
-
|
76
|
-
declare const WgslSettableTrait: unique symbol;
|
77
|
-
interface WgslSettable {
|
78
|
-
readonly [WgslSettableTrait]: true;
|
79
|
-
}
|
80
|
-
|
81
|
-
type Getter = <T>(plum: WgslPlum<T>) => T;
|
82
|
-
type Unsubscribe = () => unknown;
|
83
|
-
type ExtractPlumValue<T> = T extends WgslPlum<infer TValue> ? TValue : never;
|
84
|
-
interface WgslPlum<TValue = unknown> {
|
85
|
-
readonly __brand: 'WgslPlum';
|
86
|
-
$name(label: string): this;
|
87
|
-
/**
|
88
|
-
* Computes the value of this plum. Circumvents the store
|
89
|
-
* memoization, so use with care.
|
90
|
-
*/
|
91
|
-
compute(get: Getter): TValue;
|
92
|
-
}
|
93
|
-
declare const WgslExternalPlumTrait: unique symbol;
|
94
|
-
interface WgslExternalPlum {
|
95
|
-
readonly [WgslExternalPlumTrait]: true;
|
96
|
-
readonly version: number;
|
97
|
-
subscribe(listener: () => unknown): Unsubscribe;
|
98
|
-
}
|
99
|
-
/**
|
100
|
-
* Creates a computed plum. Its value depends on the plums read using `get`
|
101
|
-
* inside the `compute` function, so cannot be set imperatively.
|
102
|
-
*
|
103
|
-
* @param compute A pure function that describes this plum's value.
|
104
|
-
*/
|
105
|
-
declare function plum<T extends Wgsl>(compute: (get: Getter) => T): WgslPlum<T> & WgslResolvable;
|
106
|
-
/**
|
107
|
-
* Creates a computed plum. Its value depends on the plums read using `get`
|
108
|
-
* inside the `compute` function, so cannot be set imperatively.
|
109
|
-
*
|
110
|
-
* @param compute A pure function that describes this plum's value.
|
111
|
-
*/
|
112
|
-
declare function plum<T>(compute: (get: Getter) => T): WgslPlum<T>;
|
113
|
-
/**
|
114
|
-
* Creates a plum with an initial value of `initial`.
|
115
|
-
* Its value can be updated by calling `runtime.setPlum(thePlum, newValue)`.
|
116
|
-
*
|
117
|
-
* @param initial The initial value of this plum.
|
118
|
-
*/
|
119
|
-
declare function plum<T extends Wgsl>(initial: T): WgslPlum<T> & WgslSettable & WgslResolvable;
|
120
|
-
/**
|
121
|
-
* Creates a plum with an initial value of `initial`.
|
122
|
-
* Its value can be updated by calling `runtime.setPlum(thePlum, newValue)`.
|
123
|
-
*
|
124
|
-
* @param initial The initial value of this plum.
|
125
|
-
*/
|
126
|
-
declare function plum<T>(initial: T): WgslPlum<T> & WgslSettable;
|
127
|
-
declare function plumFromEvent<T>(subscribe: (listener: () => unknown) => Unsubscribe, getLatest: () => T): WgslPlum<T> & WgslExternalPlum;
|
128
|
-
|
129
|
-
type Wgsl = string | number | WgslResolvable | symbol | boolean;
|
130
|
-
/**
|
131
|
-
* Passed into each resolvable item. All sibling items share a resolution ctx,
|
132
|
-
* and a new resolution ctx is made when going down each level in the tree.
|
133
|
-
*/
|
134
|
-
interface ResolutionCtx {
|
135
|
-
/**
|
136
|
-
* Slots that were used by items resolved by this context.
|
137
|
-
*/
|
138
|
-
readonly usedSlots: Iterable<WgslSlot<unknown>>;
|
139
|
-
addDeclaration(item: WgslResolvable): void;
|
140
|
-
addBinding(bindable: WgslBindable, identifier: WgslIdentifier): void;
|
141
|
-
addRenderResource(resource: WgslRenderResource, identifier: WgslIdentifier): void;
|
142
|
-
addBuiltin(builtin: Builtin): void;
|
143
|
-
nameFor(token: WgslResolvable): string;
|
144
|
-
/**
|
145
|
-
* Unwraps all layers of slot indirection and returns the concrete value if available.
|
146
|
-
* @throws {MissingSlotValueError}
|
147
|
-
*/
|
148
|
-
unwrap<T>(eventual: Eventual<T>): T;
|
149
|
-
resolve(item: Wgsl, slotValueOverrides?: SlotValuePair<unknown>[]): string;
|
150
|
-
}
|
151
|
-
interface WgslResolvable {
|
152
|
-
readonly label?: string | undefined;
|
153
|
-
resolve(ctx: ResolutionCtx): string;
|
154
|
-
}
|
155
|
-
declare function isResolvable(value: unknown): value is WgslResolvable;
|
156
|
-
declare function isWgsl(value: unknown): value is Wgsl;
|
157
|
-
interface WgslSlot<T> {
|
158
|
-
readonly __brand: 'WgslSlot';
|
159
|
-
readonly defaultValue: T | undefined;
|
160
|
-
readonly label?: string | undefined;
|
161
|
-
$name(label: string): WgslSlot<T>;
|
162
|
-
/**
|
163
|
-
* Used to determine if code generated using either value `a` or `b` in place
|
164
|
-
* of the slot will be equivalent. Defaults to `Object.is`.
|
165
|
-
*/
|
166
|
-
areEqual(a: T, b: T): boolean;
|
167
|
-
}
|
168
|
-
declare function isSlot<T>(value: unknown | WgslSlot<T>): value is WgslSlot<T>;
|
169
|
-
/**
|
170
|
-
* Represents a value that is available at resolution time.
|
171
|
-
*/
|
172
|
-
type Eventual<T> = T | WgslSlot<T>;
|
173
|
-
type EventualGetter = <T>(value: Eventual<T>) => T;
|
174
|
-
type InlineResolve = (get: EventualGetter) => Wgsl;
|
175
|
-
interface WgslResolvableSlot<T extends Wgsl> extends WgslResolvable, WgslSlot<T> {
|
176
|
-
$name(label: string): WgslResolvableSlot<T>;
|
177
|
-
}
|
178
|
-
type SlotValuePair<T> = [WgslSlot<T>, T];
|
179
|
-
interface WgslAllocatable<TData extends AnyWgslData = AnyWgslData> {
|
180
|
-
/**
|
181
|
-
* The data type this allocatable was constructed with.
|
182
|
-
* It informs the size and format of data in both JS and
|
183
|
-
* binary.
|
184
|
-
*/
|
185
|
-
readonly dataType: TData;
|
186
|
-
vertexLayout: Omit<GPUVertexBufferLayout, 'attributes'> | null;
|
187
|
-
readonly initial?: Parsed<TData> | WgslPlum<Parsed<TData>> | undefined;
|
188
|
-
readonly flags: GPUBufferUsageFlags;
|
189
|
-
get label(): string | undefined;
|
190
|
-
}
|
191
|
-
interface WgslBindable<TData extends AnyWgslData = AnyWgslData, TUsage extends BufferUsage = BufferUsage> extends WgslResolvable {
|
192
|
-
readonly allocatable: WgslAllocatable<TData>;
|
193
|
-
readonly usage: TUsage;
|
194
|
-
}
|
195
|
-
type WgslSamplerType = 'sampler' | 'sampler_comparison';
|
196
|
-
type WgslTypedTextureType = 'texture_1d' | 'texture_2d' | 'texture_2d_array' | 'texture_3d' | 'texture_cube' | 'texture_cube_array' | 'texture_multisampled_2d';
|
197
|
-
type WgslDepthTextureType = 'texture_depth_2d' | 'texture_depth_2d_array' | 'texture_depth_cube' | 'texture_depth_cube_array' | 'texture_depth_multisampled_2d';
|
198
|
-
type WgslStorageTextureType = 'texture_storage_1d' | 'texture_storage_2d' | 'texture_storage_2d_array' | 'texture_storage_3d';
|
199
|
-
type WgslExternalTextureType = 'texture_external';
|
200
|
-
type WgslRenderResourceType = WgslSamplerType | WgslTypedTextureType | WgslDepthTextureType | WgslStorageTextureType | WgslExternalTextureType;
|
201
|
-
interface WgslRenderResource extends WgslResolvable {
|
202
|
-
readonly type: WgslRenderResourceType;
|
203
|
-
}
|
204
|
-
type BufferUsage = 'uniform' | 'readonly' | 'mutable' | 'vertex';
|
205
|
-
type TextureUsage = 'sampled' | 'storage';
|
206
|
-
type StorageTextureAccess = 'read' | 'write' | 'read_write';
|
207
|
-
type StorageTextureParams = {
|
208
|
-
type: WgslStorageTextureType;
|
209
|
-
access: StorageTextureAccess;
|
210
|
-
descriptor?: GPUTextureViewDescriptor;
|
211
|
-
};
|
212
|
-
type SampledTextureParams = {
|
213
|
-
type: WgslTypedTextureType;
|
214
|
-
dataType: AnyWgslPrimitive;
|
215
|
-
descriptor?: GPUTextureViewDescriptor;
|
216
|
-
};
|
217
|
-
declare function isSamplerType(type: WgslRenderResourceType): type is WgslSamplerType;
|
218
|
-
declare function isTypedTextureType(type: WgslRenderResourceType): type is WgslTypedTextureType;
|
219
|
-
declare function isDepthTextureType(type: WgslRenderResourceType): type is WgslDepthTextureType;
|
220
|
-
declare function isStorageTextureType(type: WgslRenderResourceType): type is WgslStorageTextureType;
|
221
|
-
declare function isExternalTextureType(type: WgslRenderResourceType): type is WgslExternalTextureType;
|
222
|
-
interface WgslData<TInner> extends ISchema<TInner>, WgslResolvable {
|
223
|
-
readonly byteAlignment: number;
|
224
|
-
readonly size: number;
|
225
|
-
}
|
226
|
-
type AnyWgslData = WgslData<unknown>;
|
227
|
-
type AnyWgslPrimitive = U32 | I32 | F32;
|
228
|
-
type AnyWgslTexelFormat = Vec4u | Vec4i | Vec4f;
|
229
|
-
interface WgslPointer<TScope extends 'function', TInner extends AnyWgslData> {
|
230
|
-
readonly scope: TScope;
|
231
|
-
readonly pointsTo: TInner;
|
232
|
-
}
|
233
|
-
/**
|
234
|
-
* A virtual representation of a WGSL value.
|
235
|
-
*/
|
236
|
-
type WgslValue<TDataType> = {
|
237
|
-
readonly __dataType: TDataType;
|
238
|
-
};
|
239
|
-
type AnyWgslPointer = WgslPointer<'function', AnyWgslData>;
|
240
|
-
type WgslFnArgument = AnyWgslPointer | AnyWgslData;
|
241
|
-
declare function isPointer(value: AnyWgslPointer | AnyWgslData): value is AnyWgslPointer;
|
242
|
-
|
243
|
-
export { type I32 as $, type AnyWgslTexelFormat as A, type BufferUsage as B, type WgslDepthTextureType as C, type WgslStorageTextureType as D, type Eventual as E, type WgslExternalTextureType as F, isSamplerType as G, isTypedTextureType as H, type InlineResolve as I, isDepthTextureType as J, isStorageTextureType as K, isExternalTextureType as L, type WgslData as M, type WgslPointer as N, type AnyWgslPointer as O, isPointer as P, type BuiltInPossibleTypes as Q, type ResolutionCtx as R, type StorageTextureParams as S, type TextureUsage as T, type Unsubscribe as U, builtin as V, type WgslResolvable as W, type Builtin as X, getBuiltinInfo as Y, getUsedBuiltinsNamed as Z, type U32 as _, type WgslSlot as a, type Bool as a0, bool as a1, u32 as a2, i32 as a3, type F32 as a4, f32 as a5, type Vec2u as a6, vec2u as a7, type Vec2i as a8, vec2i as a9, type Vec2f as aa, vec2f as ab, type Vec3u as ac, vec3u as ad, type Vec3i as ae, vec3i as af, type Vec3f as ag, vec3f as ah, type Vec4u as ai, vec4u as aj, type Vec4i as ak, vec4i as al, type Vec4f as am, vec4f as an, type Mat4f as ao, mat4f as ap, type Wgsl as b, type WgslRenderResource as c, type SampledTextureParams as d, type AnyWgslPrimitive as e, type WgslRenderResourceType as f, type StorageTextureAccess as g, type WgslPlum as h, type ExtractPlumValue as i, type WgslSettable as j, type AnyWgslData as k, type WgslAllocatable as l, type WgslBindable as m, type WgslFnArgument as n, type WgslValue as o, WgslIdentifier as p, type WgslResolvableSlot as q, plum as r, plumFromEvent as s, isResolvable as t, isWgsl as u, isSlot as v, type EventualGetter as w, type SlotValuePair as x, type WgslSamplerType as y, type WgslTypedTextureType as z };
|