Skip to content

Commit 31062ee

Browse files
committed
fix: Use InferGPU in function shell types
1 parent 31abbba commit 31062ee

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type {
2222
Vec4u,
2323
Void,
2424
} from '../../data/wgslTypes.ts';
25-
import type { Infer } from '../../shared/repr.ts';
25+
import type { InferGPU } from '../../shared/repr.ts';
2626

2727
export type AnyFn = (...args: never[]) => unknown;
2828

@@ -40,7 +40,7 @@ export type TranspilationResult = {
4040
};
4141

4242
export type InferArgs<T extends unknown[]> = {
43-
[Idx in keyof T]: Infer<T[Idx]>;
43+
[Idx in keyof T]: InferGPU<T[Idx]>;
4444
};
4545

4646
type InheritTupleValues<T, From> = {
@@ -64,7 +64,7 @@ export type InheritArgNames<T extends AnyFn, From extends AnyFn> = {
6464

6565
export type InferImplSchema<ImplSchema extends AnyFn> = (
6666
...args: InferArgs<Parameters<ImplSchema>>
67-
) => Infer<ReturnType<ImplSchema>>;
67+
) => InferGPU<ReturnType<ImplSchema>>;
6868

6969
export type Implementation<ImplSchema extends AnyFn = AnyFn> = string | InferImplSchema<ImplSchema>;
7070

@@ -100,7 +100,7 @@ export type IOLayout<TElementType extends IOData = IOData> =
100100
| Void;
101101

102102
export type InferIO<T> = T extends { type: string }
103-
? Infer<T>
103+
? InferGPU<T>
104104
: T extends Record<string, unknown>
105-
? { [K in keyof T]: Infer<T[K]> }
105+
? { [K in keyof T]: InferGPU<T[K]> }
106106
: T;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { provideInsideTgpuFn } from '../../execMode.ts';
66
import type { TgpuNamable } from '../../shared/meta.ts';
77
import { getName, setName } from '../../shared/meta.ts';
88
import { isMarkedInternal } from '../../shared/symbols.ts';
9-
import type { Infer } from '../../shared/repr.ts';
9+
import type { InferGPU } from '../../shared/repr.ts';
1010
import { $getNameForward, $internal, $providing, $resolve } from '../../shared/symbols.ts';
1111
import type { Prettify } from '../../shared/utilityTypes.ts';
1212
import type { DualFn, ResolutionCtx, SelfResolvable } from '../../types.ts';
@@ -56,7 +56,7 @@ export type TgpuFnShell<Args extends BaseData[], Return extends BaseData> = Tgpu
5656
Args,
5757
Return
5858
> &
59-
(<T extends (...args: InferArgs<Args>) => Infer<Return>>(
59+
(<T extends (...args: InferArgs<Args>) => InferGPU<Return>>(
6060
implementation: T,
6161
) => TgpuFn<Prettify<InheritArgNames<(...args: Args) => Return, T>>['result']>) &
6262
((implementation: string) => TgpuFn<(...args: Args) => Return>) &

0 commit comments

Comments
 (0)