UNPKG

typegpu

Version:

A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.

22 lines (21 loc) 764 B
import { getName } from "../../shared/meta.js"; import { $getNameForward, $internal, $resolve } from "../../shared/symbols.js"; import { createFnCore } from "./fnCore.js"; export function isShelllessImpl(value) { return value?.resourceType === 'shellless-impl'; } export function createShelllessImpl(argTypes, implementation) { const core = createFnCore(implementation, 'normal'); return { [$internal]: true, [$getNameForward]: core, resourceType: 'shellless-impl', argTypes, [$resolve](ctx) { return core.resolve(ctx, argTypes, undefined); }, toString() { return `fn*:${getName(core) ?? '<unnamed>'}(${argTypes.map((t) => t.toString()).join(', ')})`; }, }; }