Skip to content

Commit a7a7dc9

Browse files
aleksanderkatanAleksander Katan
andauthored
Remove does from entrypoints (#1997)
Co-authored-by: Aleksander Katan <aleksander.katan@swmansion.com>
1 parent 57e31c9 commit a7a7dc9

3 files changed

Lines changed: 9 additions & 56 deletions

File tree

packages/typegpu/src/core/function/tgpuComputeFn.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,7 @@ export type TgpuComputeFnShell<
5454
& ((
5555
strings: TemplateStringsArray,
5656
...values: unknown[]
57-
) => TgpuComputeFn<ComputeIn>)
58-
& {
59-
/**
60-
* @deprecated Invoke the shell as a function instead.
61-
*/
62-
does:
63-
& ((
64-
implementation: (input: InferIO<ComputeIn>) => undefined,
65-
) => TgpuComputeFn<ComputeIn>)
66-
& /**
67-
* @param implementation
68-
* Raw WGSL function implementation with header and body
69-
* without `fn` keyword and function name
70-
* e.g. `"(x: f32) -> f32 { return x; }"`;
71-
*/ ((implementation: string) => TgpuComputeFn<ComputeIn>);
72-
};
57+
) => TgpuComputeFn<ComputeIn>);
7358

7459
export interface TgpuComputeFn<
7560
// biome-ignore lint/suspicious/noExplicitAny: to allow assigning any compute fn to TgpuComputeFn (non-generic) type
@@ -135,9 +120,7 @@ export function computeFn<
135120
stripTemplate(arg, ...values),
136121
);
137122

138-
return Object.assign(Object.assign(call, shell), {
139-
does: call,
140-
}) as TgpuComputeFnShell<ComputeIn>;
123+
return Object.assign(call, shell);
141124
}
142125

143126
// --------------

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

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,7 @@ export type TgpuFragmentFnShell<
9393
& ((
9494
strings: TemplateStringsArray,
9595
...values: unknown[]
96-
) => TgpuFragmentFn<OmitBuiltins<FragmentIn>, FragmentOut>)
97-
& {
98-
/**
99-
* @deprecated Invoke the shell as a function instead.
100-
*/
101-
does:
102-
& ((
103-
implementation: (input: InferIO<FragmentIn>) => InferIO<FragmentOut>,
104-
) => TgpuFragmentFn<OmitBuiltins<FragmentIn>, FragmentOut>)
105-
& /**
106-
* @param implementation
107-
* Raw WGSL function implementation with header and body
108-
* without `fn` keyword and function name
109-
* e.g. `"(x: f32) -> f32 { return x; }"`;
110-
*/ ((
111-
implementation: string,
112-
) => TgpuFragmentFn<OmitBuiltins<FragmentIn>, FragmentOut>);
113-
};
96+
) => TgpuFragmentFn<OmitBuiltins<FragmentIn>, FragmentOut>);
11497

11598
export interface TgpuFragmentFn<
11699
Varying extends FragmentInConstrained = FragmentInConstrained,
@@ -170,9 +153,10 @@ export function fragmentFn<
170153
...values: unknown[]
171154
) => createFragmentFn(shell, stripTemplate(arg, ...values));
172155

173-
return Object.assign(Object.assign(call, shell), {
174-
does: call,
175-
}) as TgpuFragmentFnShell<FragmentIn, FragmentOut>;
156+
return Object.assign(call, shell) as TgpuFragmentFnShell<
157+
FragmentIn,
158+
FragmentOut
159+
>;
176160
}
177161

178162
// --------------

packages/typegpu/src/core/function/tgpuVertexFn.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,7 @@ export type TgpuVertexFnShell<
7777
& ((
7878
strings: TemplateStringsArray,
7979
...values: unknown[]
80-
) => TgpuVertexFn<OmitBuiltins<VertexIn>, OmitBuiltins<VertexOut>>)
81-
& {
82-
/**
83-
* @deprecated Invoke the shell as a function instead.
84-
*/
85-
does:
86-
& ((
87-
implementation: (input: InferIO<VertexIn>) => InferIO<VertexOut>,
88-
) => TgpuVertexFn<OmitBuiltins<VertexIn>, OmitBuiltins<VertexOut>>)
89-
& ((
90-
implementation: string,
91-
) => TgpuVertexFn<OmitBuiltins<VertexIn>, OmitBuiltins<VertexOut>>);
92-
};
80+
) => TgpuVertexFn<OmitBuiltins<VertexIn>, OmitBuiltins<VertexOut>>);
9381

9482
export interface TgpuVertexFn<
9583
VertexIn extends VertexInConstrained = VertexInConstrained,
@@ -154,9 +142,7 @@ export function vertexFn<
154142
...values: unknown[]
155143
) => createVertexFn(shell, stripTemplate(arg, ...values));
156144

157-
return Object.assign(Object.assign(call, shell), {
158-
does: call,
159-
}) as TgpuVertexFnShell<VertexIn, VertexOut>;
145+
return Object.assign(call, shell) as TgpuVertexFnShell<VertexIn, VertexOut>;
160146
}
161147

162148
// --------------

0 commit comments

Comments
 (0)