Skip to content

ResolutionCtx

Defined in: packages/typegpu/src/types.ts:253

Passed into each resolvable item. All items in a tree share a resolution ctx, but there can be layers added and removed from the item stack when going down and up the tree.

[$internal]: object

Defined in: packages/typegpu/src/types.ts:254

itemStateStack: ItemStateStack


readonly enableExtensions: ("f16" | "clip_distances" | "primitive_index" | "dual_source_blending" | "subgroups")[] | undefined

Defined in: packages/typegpu/src/types.ts:259


readonly gen: ShaderGenerator

Defined in: packages/typegpu/src/types.ts:260


readonly mode: ExecState

Defined in: packages/typegpu/src/types.ts:258

get varyingLocations(): Record<string, number> | undefined

Defined in: packages/typegpu/src/types.ts:315

Record<string, number> | undefined

addDeclaration(declaration): void

Defined in: packages/typegpu/src/types.ts:262

string

void


allocateFixedEntry(layoutEntry, resource): object

Defined in: packages/typegpu/src/types.ts:275

Reserves a spot in the catch-all bind group, without the indirection of a bind-group. This means the resource is ‘fixed’, and cannot be swapped between code execution.

TgpuLayoutEntry

object

object

binding: number

group: string


allocateLayoutEntry(layout): string

Defined in: packages/typegpu/src/types.ts:269

Reserves a bind group number, and returns a placeholder that will be replaced with a concrete number at the end of the resolution process.

TgpuBindGroupLayout

string


fnToWgsl(options): object

Defined in: packages/typegpu/src/types.ts:307

FnToWgslOptions

object

body: Wgsl

head: Wgsl

returnType: BaseData


getUniqueName(resource): string

Defined in: packages/typegpu/src/types.ts:327

object

string


makeNameValid(name): string

Defined in: packages/typegpu/src/types.ts:328

string

string


popMode(expected?): void

Defined in: packages/typegpu/src/types.ts:286

ExecMode

void


pushMode(state): void

Defined in: packages/typegpu/src/types.ts:285

ExecState

void


resolve(item, schema?): ResolvedSnippet

Defined in: packages/typegpu/src/types.ts:300

Returns the snippet representing item.

unknown

The value to resolve

Additional information about the item’s data type

BaseData | typeof UnknownData

ResolvedSnippet


resolveSnippet(snippet): ResolvedSnippet

Defined in: packages/typegpu/src/types.ts:305

Equivalent to snip(ctx.resolve(snippet.value, snippet.dataType).value, snippet.dataType, snippet.origin).

Snippet

ResolvedSnippet


unwrap<T>(eventual): T

Defined in: packages/typegpu/src/types.ts:292

Unwraps all layers of slot/lazy indirection and returns the concrete value if available.

T

Eventual<T>

T


withRenamed<T>(item, name, callback): T

Defined in: packages/typegpu/src/types.ts:325

Temporarily renames the item. Useful for resolutions with slots, since functions with different slots should have different names, and all hold the same inner function that is being resolved multiple times.

T

object

the item to rename

the temporary name to assign to the item (if missing, just returns callback())

string | undefined

() => T

T


withResetIndentLevel<T>(callback): T

Defined in: packages/typegpu/src/types.ts:263

T

() => T

T


withSlots<T>(pairs, callback): T

Defined in: packages/typegpu/src/types.ts:283

T

SlotValuePair[]

() => T

T


withVaryingLocations<T>(locations, callback): T

Defined in: packages/typegpu/src/types.ts:313

T

Record<string, number>

() => T

T