Skip to content

ResolutionCtx

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

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:261

itemStateStack: ItemStateStack


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

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


readonly gen: ShaderGenerator

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


readonly mode: ExecState

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

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

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

Record<string, number> | undefined

addDeclaration(declaration): void

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

string

void


allocateFixedEntry(layoutEntry, resource): object

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

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:276

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:314

FnToWgslOptions

object

code: string

returnType: BaseData


getUniqueName(resource): string

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

object

string


makeNameValid(name): string

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

string

string


popMode(expected?): void

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

ExecMode

void


pushMode(state): void

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

ExecState

void


resolve(item, schema?): ResolvedSnippet

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

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:312

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:299

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:331

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:270

T

() => T

T


withSlots<T>(pairs, callback): T

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

T

SlotValuePair[]

() => T

T


withVaryingLocations<T>(locations, callback): T

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

T

Record<string, number>

() => T

T