Skip to content

TgpuFragmentFnShell

Describes a fragment entry function signature (its arguments, return type and targets). Allows creating tgpu fragment functions by calling this shell and passing the implementation (as WGSL string or JS function) as the argument.

  • TgpuFragmentFnShellHeader<TIn, TOut>

TIn extends In = In

TOut extends Out = Out

TgpuFragmentFnShell(implementation): TgpuFragmentFn<CleanIO<TIn>, CleanIO<TOut>>

Describes a fragment entry function signature (its arguments, return type and targets). Allows creating tgpu fragment functions by calling this shell and passing the implementation (as WGSL string or JS function) as the argument.

(input, out) => InferIO<TOut>

TgpuFragmentFn<CleanIO<TIn>, CleanIO<TOut>>

packages/typegpu/src/core/function/tgpuFragmentFn.ts:99

TgpuFragmentFnShell(implementation): TgpuFragmentFn<CleanIO<TIn>, CleanIO<TOut>>

Describes a fragment entry function signature (its arguments, return type and targets). Allows creating tgpu fragment functions by calling this shell and passing the implementation (as WGSL string or JS function) as the argument.

string

Raw WGSL function implementation with header and body without fn keyword and function name e.g. "(x: f32) -> f32 { return x; }";

TgpuFragmentFn<CleanIO<TIn>, CleanIO<TOut>>

packages/typegpu/src/core/function/tgpuFragmentFn.ts:111

TgpuFragmentFnShell(strings, …values): TgpuFragmentFn<CleanIO<TIn>, CleanIO<TOut>>

Describes a fragment entry function signature (its arguments, return type and targets). Allows creating tgpu fragment functions by calling this shell and passing the implementation (as WGSL string or JS function) as the argument.

TemplateStringsArray

unknown[]

TgpuFragmentFn<CleanIO<TIn>, CleanIO<TOut>>

packages/typegpu/src/core/function/tgpuFragmentFn.ts:114

readonly entryPoint: "fragment"

TgpuFragmentFnShellHeader.entryPoint

packages/typegpu/src/core/function/tgpuFragmentFn.ts:73


readonly in: undefined | TIn

TgpuFragmentFnShellHeader.in

packages/typegpu/src/core/function/tgpuFragmentFn.ts:70


readonly out: TOut

TgpuFragmentFnShellHeader.out

packages/typegpu/src/core/function/tgpuFragmentFn.ts:71


readonly returnType: IOLayoutToSchema<TOut>

TgpuFragmentFnShellHeader.returnType

packages/typegpu/src/core/function/tgpuFragmentFn.ts:72