Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/typegpu/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ export type { RenderFlag, SampledFlag } from './core/texture/usageExtension.ts';
export type { InitFromDeviceOptions, InitOptions } from './core/root/init.ts';
export type { TgpuConst } from './core/constant/tgpuConstant.ts';
export type { TgpuVar, VariableScope } from './core/variable/tgpuVariable.ts';
export type { TgpuSampler } from './core/sampler/sampler.ts';
export type {
TgpuComparisonSampler,
TgpuFixedComparisonSampler,
TgpuFixedSampler,
TgpuSampler,
} from './core/sampler/sampler.ts';
export type { TgpuQuerySet } from './core/querySet/querySet.ts';
export type {
BindLayoutEntry,
Expand Down
19 changes: 18 additions & 1 deletion packages/typegpu/tests/texture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
RenderFlag,
SampledFlag,
} from '../src/core/texture/usageExtension.ts';
import tgpu from '../src/index.ts';
import tgpu, { type TgpuRoot } from '../src/index.ts';
import { StrictNameRegistry } from '../src/nameRegistry.ts';
import { it } from './utils/extendedIt.ts';
import * as d from '../src/data/index.ts';
Expand Down Expand Up @@ -695,4 +695,21 @@ Overload 2 of 2, '(schema: "(Error) Storage texture format 'rgba8snorm' incompat
});
});
});

describe('non-parametrized TgpuTexture type', () => {
it('accepts any texture', () => {
const createTexture = (
root: TgpuRoot,
size: { width: number; height: number },
): TgpuTexture => {
const texture = root['~unstable'].createTexture({
size: [size.width, size.height],
format: 'rgba8unorm',
});

// TODO: Fix this error
return texture;
};
});
});
});
Loading