From 75de8e37caf09d2298c293b4a1a1ba12a9867806 Mon Sep 17 00:00:00 2001 From: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:21:19 +0200 Subject: [PATCH] Rename files from wgsl to tgpu (#273) --- ...dGroupResolver.ts => bindGroupResolver.ts} | 12 ++++---- .../src/{wgslBuiltin.ts => builtin.ts} | 2 +- packages/typegpu/src/builtinTypes.ts | 2 +- packages/typegpu/src/createRuntime.ts | 20 ++++++------- packages/typegpu/src/data/struct.ts | 4 +-- packages/typegpu/src/experimental/index.ts | 28 +++++++++---------- packages/typegpu/src/index.ts | 4 +-- packages/typegpu/src/macro/repeat.ts | 4 +-- packages/typegpu/src/plumStore.ts | 2 +- packages/typegpu/src/programBuilder.ts | 18 ++++++------ packages/typegpu/src/resolutionCtx.ts | 8 +++--- packages/typegpu/src/resolutionUtils.ts | 2 +- packages/typegpu/src/tgpu.ts | 2 +- .../src/{wgslBuffer.ts => tgpuBuffer.ts} | 2 +- ...{wgslBufferUsage.ts => tgpuBufferUsage.ts} | 16 +++++------ packages/typegpu/src/tgpuBufferUtils.ts | 2 +- .../typegpu/src/{wgslCode.ts => tgpuCode.ts} | 2 +- .../src/{wgslConstant.ts => tgpuConstant.ts} | 4 +-- .../src/{wgslDeclare.ts => tgpuDeclare.ts} | 2 +- .../src/{wgslFunction.ts => tgpuFunction.ts} | 4 +-- ...imental.ts => tgpuFunctionExperimental.ts} | 4 +-- .../{wgslIdentifier.ts => tgpuIdentifier.ts} | 0 .../typegpu/src/{wgslPlum.ts => tgpuPlum.ts} | 0 .../src/{typegpuRuntime.ts => tgpuRuntime.ts} | 10 +++---- .../src/{wgslSampler.ts => tgpuSampler.ts} | 2 +- .../typegpu/src/{wgslSlot.ts => tgpuSlot.ts} | 0 .../src/{wgslTexture.ts => tgpuTexture.ts} | 4 +-- .../src/{wgslVariable.ts => tgpuVariable.ts} | 4 +-- packages/typegpu/src/types.ts | 6 ++-- packages/typegpu/src/wgsl.ts | 22 +++++++-------- packages/typegpu/tests/plumStore.test.ts | 2 +- packages/typegpu/tests/runtime.test.ts | 2 +- 32 files changed, 98 insertions(+), 98 deletions(-) rename packages/typegpu/src/{wgslBindGroupResolver.ts => bindGroupResolver.ts} (96%) rename packages/typegpu/src/{wgslBuiltin.ts => builtin.ts} (98%) rename packages/typegpu/src/{wgslBuffer.ts => tgpuBuffer.ts} (99%) rename packages/typegpu/src/{wgslBufferUsage.ts => tgpuBufferUsage.ts} (98%) rename packages/typegpu/src/{wgslCode.ts => tgpuCode.ts} (98%) rename packages/typegpu/src/{wgslConstant.ts => tgpuConstant.ts} (91%) rename packages/typegpu/src/{wgslDeclare.ts => tgpuDeclare.ts} (94%) rename packages/typegpu/src/{wgslFunction.ts => tgpuFunction.ts} (95%) rename packages/typegpu/src/{wgslFunctionExperimental.ts => tgpuFunctionExperimental.ts} (97%) rename packages/typegpu/src/{wgslIdentifier.ts => tgpuIdentifier.ts} (100%) rename packages/typegpu/src/{wgslPlum.ts => tgpuPlum.ts} (100%) rename packages/typegpu/src/{typegpuRuntime.ts => tgpuRuntime.ts} (96%) rename packages/typegpu/src/{wgslSampler.ts => tgpuSampler.ts} (95%) rename packages/typegpu/src/{wgslSlot.ts => tgpuSlot.ts} (100%) rename packages/typegpu/src/{wgslTexture.ts => tgpuTexture.ts} (98%) rename packages/typegpu/src/{wgslVariable.ts => tgpuVariable.ts} (94%) diff --git a/packages/typegpu/src/wgslBindGroupResolver.ts b/packages/typegpu/src/bindGroupResolver.ts similarity index 96% rename from packages/typegpu/src/wgslBindGroupResolver.ts rename to packages/typegpu/src/bindGroupResolver.ts index 65fa717ac..3a2bf86db 100644 --- a/packages/typegpu/src/wgslBindGroupResolver.ts +++ b/packages/typegpu/src/bindGroupResolver.ts @@ -1,16 +1,16 @@ import type { SimpleTgpuData } from './data'; import type { ResolutionCtxImpl } from './resolutionCtx'; -import { deriveVertexFormat } from './typegpuRuntime'; -import type { TgpuRuntime } from './typegpuRuntime'; -import type { AnyTgpuData, BufferUsage, TgpuBindable } from './types'; -import type { TgpuBufferVertex } from './wgslBufferUsage'; -import { type TgpuSampler, isSampler } from './wgslSampler'; +import type { TgpuBufferVertex } from './tgpuBufferUsage'; +import { deriveVertexFormat } from './tgpuRuntime'; +import type { TgpuRuntime } from './tgpuRuntime'; +import { type TgpuSampler, isSampler } from './tgpuSampler'; import { type TgpuAnyTextureView, type TgpuTextureExternal, isExternalTexture, isTextureView, -} from './wgslTexture'; +} from './tgpuTexture'; +import type { AnyTgpuData, BufferUsage, TgpuBindable } from './types'; const usageToBindingTypeMap: Record< Exclude, diff --git a/packages/typegpu/src/wgslBuiltin.ts b/packages/typegpu/src/builtin.ts similarity index 98% rename from packages/typegpu/src/wgslBuiltin.ts rename to packages/typegpu/src/builtin.ts index 556e6f0a2..41978e058 100644 --- a/packages/typegpu/src/wgslBuiltin.ts +++ b/packages/typegpu/src/builtin.ts @@ -1,4 +1,4 @@ -import { TgpuIdentifier } from './wgslIdentifier'; +import { TgpuIdentifier } from './tgpuIdentifier'; export const builtin = { vertexIndex: Symbol('builtin_vertexIndex'), diff --git a/packages/typegpu/src/builtinTypes.ts b/packages/typegpu/src/builtinTypes.ts index 7e36d8a6d..a78bef065 100644 --- a/packages/typegpu/src/builtinTypes.ts +++ b/packages/typegpu/src/builtinTypes.ts @@ -1,3 +1,4 @@ +import { builtin } from './builtin'; import { type F32, type TgpuArray, @@ -10,7 +11,6 @@ import { vec3u, vec4f, } from './data'; -import { builtin } from './wgslBuiltin'; export type BuiltInPossibleTypes = U32 | F32 | Vec3u | Vec4f | TgpuArray; diff --git a/packages/typegpu/src/createRuntime.ts b/packages/typegpu/src/createRuntime.ts index f931e4316..e6ac745bb 100644 --- a/packages/typegpu/src/createRuntime.ts +++ b/packages/typegpu/src/createRuntime.ts @@ -8,6 +8,12 @@ import { } from './programBuilder'; import type { TgpuSettable } from './settableTrait'; import { TaskQueue } from './taskQueue'; +import { + type ExtractPlumValue, + type TgpuPlum, + type Unsubscribe, + isPlum, +} from './tgpuPlum'; import type { ComputePipelineExecutorOptions, ComputePipelineOptions, @@ -15,20 +21,14 @@ import type { RenderPipelineOptions, SetPlumAction, TgpuRuntime, -} from './typegpuRuntime'; -import { type AnyTgpuData, type TgpuAllocatable, isAllocatable } from './types'; -import { - type ExtractPlumValue, - type TgpuPlum, - type Unsubscribe, - isPlum, -} from './wgslPlum'; -import type { TgpuSampler } from './wgslSampler'; +} from './tgpuRuntime'; +import type { TgpuSampler } from './tgpuSampler'; import type { TgpuAnyTexture, TgpuAnyTextureView, TgpuTextureExternal, -} from './wgslTexture'; +} from './tgpuTexture'; +import { type AnyTgpuData, type TgpuAllocatable, isAllocatable } from './types'; /** * Holds all data that is necessary to facilitate CPU and GPU communication. diff --git a/packages/typegpu/src/data/struct.ts b/packages/typegpu/src/data/struct.ts index 638117c8f..fb60165e0 100644 --- a/packages/typegpu/src/data/struct.ts +++ b/packages/typegpu/src/data/struct.ts @@ -11,14 +11,14 @@ import { object, } from 'typed-binary'; import { RecursiveDataTypeError } from '../errors'; +import { code } from '../tgpuCode'; +import { TgpuIdentifier } from '../tgpuIdentifier'; import type { AnyTgpuData, ResolutionCtx, TgpuData, TgpuNamable, } from '../types'; -import { code } from '../wgslCode'; -import { TgpuIdentifier } from '../wgslIdentifier'; import { TgpuAlignedImpl } from './align'; import alignIO from './alignIO'; import { TgpuSizedImpl } from './size'; diff --git a/packages/typegpu/src/experimental/index.ts b/packages/typegpu/src/experimental/index.ts index a4e229b7a..504c53951 100644 --- a/packages/typegpu/src/experimental/index.ts +++ b/packages/typegpu/src/experimental/index.ts @@ -9,10 +9,10 @@ export default tgpu; export * from '../errors'; export * from '../types'; export { AsCallable, Callable } from '../callable'; -export * from '../typegpuRuntime'; +export * from '../tgpuRuntime'; export { default as ProgramBuilder, type Program } from '../programBuilder'; export { StrictNameRegistry, RandomNameRegistry } from '../nameRegistry'; -export * from '../wgslBuiltin'; +export * from '../builtin'; export { default as wgsl } from '../wgsl'; export { std } from '../std'; @@ -21,29 +21,29 @@ export { isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, -} from '../wgslBuffer'; -export { asUniform, asReadonly, asMutable, asVertex } from '../wgslBufferUsage'; +} from '../tgpuBuffer'; +export { asUniform, asReadonly, asMutable, asVertex } from '../tgpuBufferUsage'; export type { TgpuBuffer, Unmanaged, -} from '../wgslBuffer'; +} from '../tgpuBuffer'; export type { TgpuBufferUsage, TgpuBufferUniform, TgpuBufferReadonly, TgpuBufferMutable, TgpuBufferVertex, -} from '../wgslBufferUsage'; -export type { TgpuCode } from '../wgslCode'; -export type { TgpuConst } from '../wgslConstant'; -export type { TgpuFn } from '../wgslFunction'; -export type { TgpuPlum } from '../wgslPlum'; +} from '../tgpuBufferUsage'; +export type { TgpuCode } from '../tgpuCode'; +export type { TgpuConst } from '../tgpuConstant'; +export type { TgpuFn } from '../tgpuFunction'; +export type { TgpuPlum } from '../tgpuPlum'; export type { TgpuSettable } from '../settableTrait'; -export type { TgpuFn as TgpuFnExperimental } from '../wgslFunctionExperimental'; -export type { TgpuVar } from '../wgslVariable'; -export type { TgpuSampler } from '../wgslSampler'; +export type { TgpuFn as TgpuFnExperimental } from '../tgpuFunctionExperimental'; +export type { TgpuVar } from '../tgpuVariable'; +export type { TgpuSampler } from '../tgpuSampler'; export type { TgpuTexture, TgpuTextureView, -} from '../wgslTexture'; +} from '../tgpuTexture'; diff --git a/packages/typegpu/src/index.ts b/packages/typegpu/src/index.ts index cbc49bcb8..ad33c435c 100644 --- a/packages/typegpu/src/index.ts +++ b/packages/typegpu/src/index.ts @@ -17,9 +17,9 @@ export { isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, -} from './wgslBuffer'; +} from './tgpuBuffer'; export type { TgpuBuffer, Unmanaged, -} from './wgslBuffer'; +} from './tgpuBuffer'; diff --git a/packages/typegpu/src/macro/repeat.ts b/packages/typegpu/src/macro/repeat.ts index 18e4ef8a5..d7321e88c 100644 --- a/packages/typegpu/src/macro/repeat.ts +++ b/packages/typegpu/src/macro/repeat.ts @@ -1,6 +1,6 @@ +import { code } from '../tgpuCode'; +import { TgpuIdentifier } from '../tgpuIdentifier'; import type { Eventual, Wgsl } from '../types'; -import { code } from '../wgslCode'; -import { TgpuIdentifier } from '../wgslIdentifier'; export function repeat( count: Eventual, diff --git a/packages/typegpu/src/plumStore.ts b/packages/typegpu/src/plumStore.ts index 1cb55f121..52a634446 100644 --- a/packages/typegpu/src/plumStore.ts +++ b/packages/typegpu/src/plumStore.ts @@ -4,7 +4,7 @@ import { type Getter, type TgpuPlum, isExternalPlum, -} from './wgslPlum'; +} from './tgpuPlum'; export type PlumListener = (newValue: T) => unknown; type Unsubscribe = () => void; diff --git a/packages/typegpu/src/programBuilder.ts b/packages/typegpu/src/programBuilder.ts index 1c8a7da00..3abe6c499 100644 --- a/packages/typegpu/src/programBuilder.ts +++ b/packages/typegpu/src/programBuilder.ts @@ -1,18 +1,18 @@ import type { AnySchema } from 'typed-binary'; +import { BindGroupResolver } from './bindGroupResolver'; +import { + getBuiltinInfo, + getUsedBuiltins, + getUsedBuiltinsNamed, +} from './builtin'; import { builtinToType } from './builtinTypes'; import type { SimpleTgpuData, TgpuArray } from './data'; import { type NameRegistry, RandomNameRegistry } from './nameRegistry'; import { ResolutionCtxImpl } from './resolutionCtx'; -import type { TgpuRuntime } from './typegpuRuntime'; +import type { TgpuBufferVertex } from './tgpuBufferUsage'; +import { type BoundTgpuCode, type TgpuCode, code } from './tgpuCode'; +import type { TgpuRuntime } from './tgpuRuntime'; import type { AnyTgpuData, TgpuResolvable } from './types'; -import { BindGroupResolver } from './wgslBindGroupResolver'; -import type { TgpuBufferVertex } from './wgslBufferUsage'; -import { - getBuiltinInfo, - getUsedBuiltins, - getUsedBuiltinsNamed, -} from './wgslBuiltin'; -import { type BoundTgpuCode, type TgpuCode, code } from './wgslCode'; export type Program = { readonly bindGroupResolver: BindGroupResolver; diff --git a/packages/typegpu/src/resolutionCtx.ts b/packages/typegpu/src/resolutionCtx.ts index ea67d6cdb..9a559b3ed 100644 --- a/packages/typegpu/src/resolutionCtx.ts +++ b/packages/typegpu/src/resolutionCtx.ts @@ -1,5 +1,9 @@ +import type { Builtin } from './builtin'; import { MissingSlotValueError, ResolutionError } from './errors'; import type { NameRegistry } from './nameRegistry'; +import { code } from './tgpuCode'; +import type { TgpuIdentifier } from './tgpuIdentifier'; +import { isTextureView } from './tgpuTexture'; import type { BufferUsage, Eventual, @@ -18,10 +22,6 @@ import { isSamplerType, isSlot, } from './types'; -import type { Builtin } from './wgslBuiltin'; -import { code } from './wgslCode'; -import type { TgpuIdentifier } from './wgslIdentifier'; -import { isTextureView } from './wgslTexture'; export type ResolutionCtxImplOptions = { readonly names: NameRegistry; diff --git a/packages/typegpu/src/resolutionUtils.ts b/packages/typegpu/src/resolutionUtils.ts index 38881c586..8fb9e6382 100644 --- a/packages/typegpu/src/resolutionUtils.ts +++ b/packages/typegpu/src/resolutionUtils.ts @@ -1,5 +1,5 @@ +import { code } from './tgpuCode'; import type { Wgsl } from './types'; -import { code } from './wgslCode'; /** * Represent expressions as a comma-separated list. diff --git a/packages/typegpu/src/tgpu.ts b/packages/typegpu/src/tgpu.ts index f89af2cea..ced5ed9ff 100644 --- a/packages/typegpu/src/tgpu.ts +++ b/packages/typegpu/src/tgpu.ts @@ -3,5 +3,5 @@ export { Uniform, Storage, Vertex, -} from './wgslBuffer'; +} from './tgpuBuffer'; export { read, write } from './tgpuBufferUtils'; diff --git a/packages/typegpu/src/wgslBuffer.ts b/packages/typegpu/src/tgpuBuffer.ts similarity index 99% rename from packages/typegpu/src/wgslBuffer.ts rename to packages/typegpu/src/tgpuBuffer.ts index 96012f621..0a1f6d3aa 100644 --- a/packages/typegpu/src/wgslBuffer.ts +++ b/packages/typegpu/src/tgpuBuffer.ts @@ -1,11 +1,11 @@ import { BufferWriter, type Parsed } from 'typed-binary'; +import type { TgpuPlum } from './tgpuPlum'; import { type AnyTgpuData, type TgpuAllocatable, type TgpuNamable, isGPUBuffer, } from './types'; -import type { TgpuPlum } from './wgslPlum'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslBufferUsage.ts b/packages/typegpu/src/tgpuBufferUsage.ts similarity index 98% rename from packages/typegpu/src/wgslBufferUsage.ts rename to packages/typegpu/src/tgpuBufferUsage.ts index f780ef7da..4e5bd282a 100644 --- a/packages/typegpu/src/wgslBufferUsage.ts +++ b/packages/typegpu/src/tgpuBufferUsage.ts @@ -1,10 +1,4 @@ import { SimpleTgpuData, TgpuArrayImpl } from './data'; -import type { - AnyTgpuData, - BufferUsage, - ResolutionCtx, - TgpuBindable, -} from './types'; import { type Storage, type TgpuBuffer, @@ -13,8 +7,14 @@ import { isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, -} from './wgslBuffer'; -import { TgpuIdentifier } from './wgslIdentifier'; +} from './tgpuBuffer'; +import { TgpuIdentifier } from './tgpuIdentifier'; +import type { + AnyTgpuData, + BufferUsage, + ResolutionCtx, + TgpuBindable, +} from './types'; // ---------- // Public API diff --git a/packages/typegpu/src/tgpuBufferUtils.ts b/packages/typegpu/src/tgpuBufferUtils.ts index 99a8d2e41..81236c6b5 100644 --- a/packages/typegpu/src/tgpuBufferUtils.ts +++ b/packages/typegpu/src/tgpuBufferUtils.ts @@ -1,7 +1,7 @@ import { BufferReader, BufferWriter, type Parsed } from 'typed-binary'; import { roundUp } from './mathUtils'; +import type { TgpuBuffer, Unmanaged } from './tgpuBuffer'; import type { AnyTgpuData } from './types'; -import type { TgpuBuffer, Unmanaged } from './wgslBuffer'; export function write( buffer: TgpuBuffer & Unmanaged, diff --git a/packages/typegpu/src/wgslCode.ts b/packages/typegpu/src/tgpuCode.ts similarity index 98% rename from packages/typegpu/src/wgslCode.ts rename to packages/typegpu/src/tgpuCode.ts index c2382e58d..3fe2ff015 100644 --- a/packages/typegpu/src/wgslCode.ts +++ b/packages/typegpu/src/tgpuCode.ts @@ -1,3 +1,4 @@ +import { getBuiltinInfo } from './builtin'; import { type Eventual, type InlineResolve, @@ -9,7 +10,6 @@ import { type Wgsl, isResolvable, } from './types'; -import { getBuiltinInfo } from './wgslBuiltin'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslConstant.ts b/packages/typegpu/src/tgpuConstant.ts similarity index 91% rename from packages/typegpu/src/wgslConstant.ts rename to packages/typegpu/src/tgpuConstant.ts index fd5bec9cb..524682361 100644 --- a/packages/typegpu/src/wgslConstant.ts +++ b/packages/typegpu/src/tgpuConstant.ts @@ -1,6 +1,6 @@ +import { code } from './tgpuCode'; +import { TgpuIdentifier } from './tgpuIdentifier'; import type { ResolutionCtx, TgpuNamable, TgpuResolvable, Wgsl } from './types'; -import { code } from './wgslCode'; -import { TgpuIdentifier } from './wgslIdentifier'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslDeclare.ts b/packages/typegpu/src/tgpuDeclare.ts similarity index 94% rename from packages/typegpu/src/wgslDeclare.ts rename to packages/typegpu/src/tgpuDeclare.ts index ca41e1123..a4ffe6d3b 100644 --- a/packages/typegpu/src/wgslDeclare.ts +++ b/packages/typegpu/src/tgpuDeclare.ts @@ -1,10 +1,10 @@ +import { code } from './tgpuCode'; import type { InlineResolve, ResolutionCtx, TgpuResolvable, Wgsl, } from './types'; -import { code } from './wgslCode'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslFunction.ts b/packages/typegpu/src/tgpuFunction.ts similarity index 95% rename from packages/typegpu/src/wgslFunction.ts rename to packages/typegpu/src/tgpuFunction.ts index 5bcdb2184..760e1efdf 100644 --- a/packages/typegpu/src/wgslFunction.ts +++ b/packages/typegpu/src/tgpuFunction.ts @@ -1,3 +1,5 @@ +import { code } from './tgpuCode'; +import { TgpuIdentifier } from './tgpuIdentifier'; import type { Eventual, InlineResolve, @@ -8,8 +10,6 @@ import type { TgpuSlot, Wgsl, } from './types'; -import { code } from './wgslCode'; -import { TgpuIdentifier } from './wgslIdentifier'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslFunctionExperimental.ts b/packages/typegpu/src/tgpuFunctionExperimental.ts similarity index 97% rename from packages/typegpu/src/wgslFunctionExperimental.ts rename to packages/typegpu/src/tgpuFunctionExperimental.ts index 703f897b4..d36e91cbd 100644 --- a/packages/typegpu/src/wgslFunctionExperimental.ts +++ b/packages/typegpu/src/tgpuFunctionExperimental.ts @@ -1,4 +1,6 @@ import { type AsCallable, CallableImpl } from './callable'; +import { code } from './tgpuCode'; +import { TgpuIdentifier } from './tgpuIdentifier'; import { isPointer } from './types'; import type { AnyTgpuData, @@ -9,8 +11,6 @@ import type { TgpuValue, Wgsl, } from './types'; -import { code } from './wgslCode'; -import { TgpuIdentifier } from './wgslIdentifier'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslIdentifier.ts b/packages/typegpu/src/tgpuIdentifier.ts similarity index 100% rename from packages/typegpu/src/wgslIdentifier.ts rename to packages/typegpu/src/tgpuIdentifier.ts diff --git a/packages/typegpu/src/wgslPlum.ts b/packages/typegpu/src/tgpuPlum.ts similarity index 100% rename from packages/typegpu/src/wgslPlum.ts rename to packages/typegpu/src/tgpuPlum.ts diff --git a/packages/typegpu/src/typegpuRuntime.ts b/packages/typegpu/src/tgpuRuntime.ts similarity index 96% rename from packages/typegpu/src/typegpuRuntime.ts rename to packages/typegpu/src/tgpuRuntime.ts index 4070d8288..5987d00b9 100644 --- a/packages/typegpu/src/typegpuRuntime.ts +++ b/packages/typegpu/src/tgpuRuntime.ts @@ -3,15 +3,15 @@ import type { Parsed } from 'typed-binary'; import type { SimpleTgpuData, TgpuArray } from './data'; import type { PlumListener } from './plumStore'; import type { TgpuSettable } from './settableTrait'; -import type { AnyTgpuData, TgpuAllocatable } from './types'; -import type { BoundTgpuCode, TgpuCode } from './wgslCode'; -import type { ExtractPlumValue, TgpuPlum, Unsubscribe } from './wgslPlum'; -import type { TgpuSampler } from './wgslSampler'; +import type { BoundTgpuCode, TgpuCode } from './tgpuCode'; +import type { ExtractPlumValue, TgpuPlum, Unsubscribe } from './tgpuPlum'; +import type { TgpuSampler } from './tgpuSampler'; import type { TgpuAnyTexture, TgpuAnyTextureView, TgpuTextureExternal, -} from './wgslTexture'; +} from './tgpuTexture'; +import type { AnyTgpuData, TgpuAllocatable } from './types'; // ---------- // Public API diff --git a/packages/typegpu/src/wgslSampler.ts b/packages/typegpu/src/tgpuSampler.ts similarity index 95% rename from packages/typegpu/src/wgslSampler.ts rename to packages/typegpu/src/tgpuSampler.ts index 671d187a7..0ec30a49a 100644 --- a/packages/typegpu/src/wgslSampler.ts +++ b/packages/typegpu/src/tgpuSampler.ts @@ -1,10 +1,10 @@ +import { TgpuIdentifier } from './tgpuIdentifier'; import type { ResolutionCtx, TgpuNamable, TgpuRenderResource, TgpuSamplerType, } from './types'; -import { TgpuIdentifier } from './wgslIdentifier'; export interface TgpuSampler extends TgpuRenderResource, TgpuNamable { readonly descriptor: GPUSamplerDescriptor; diff --git a/packages/typegpu/src/wgslSlot.ts b/packages/typegpu/src/tgpuSlot.ts similarity index 100% rename from packages/typegpu/src/wgslSlot.ts rename to packages/typegpu/src/tgpuSlot.ts diff --git a/packages/typegpu/src/wgslTexture.ts b/packages/typegpu/src/tgpuTexture.ts similarity index 98% rename from packages/typegpu/src/wgslTexture.ts rename to packages/typegpu/src/tgpuTexture.ts index 29b4ea794..33348f7d4 100644 --- a/packages/typegpu/src/wgslTexture.ts +++ b/packages/typegpu/src/tgpuTexture.ts @@ -1,4 +1,6 @@ import { vec4f, vec4i, vec4u } from './data'; +import { TgpuIdentifier } from './tgpuIdentifier'; +import { isSampler } from './tgpuSampler'; import type { ResolutionCtx, SampledTextureParams, @@ -11,8 +13,6 @@ import type { TgpuRenderResource, TgpuRenderResourceType, } from './types'; -import { TgpuIdentifier } from './wgslIdentifier'; -import { isSampler } from './wgslSampler'; type Optional = { [P in keyof T]?: T[P] | undefined; diff --git a/packages/typegpu/src/wgslVariable.ts b/packages/typegpu/src/tgpuVariable.ts similarity index 94% rename from packages/typegpu/src/wgslVariable.ts rename to packages/typegpu/src/tgpuVariable.ts index d3a0d2183..faa825fee 100644 --- a/packages/typegpu/src/wgslVariable.ts +++ b/packages/typegpu/src/tgpuVariable.ts @@ -1,3 +1,5 @@ +import { code } from './tgpuCode'; +import { TgpuIdentifier } from './tgpuIdentifier'; import type { AnyTgpuData, ResolutionCtx, @@ -5,8 +7,6 @@ import type { TgpuResolvable, Wgsl, } from './types'; -import { code } from './wgslCode'; -import { TgpuIdentifier } from './wgslIdentifier'; // ---------- // Public API diff --git a/packages/typegpu/src/types.ts b/packages/typegpu/src/types.ts index b152e35c0..e1aed8dba 100644 --- a/packages/typegpu/src/types.ts +++ b/packages/typegpu/src/types.ts @@ -1,8 +1,8 @@ import type { ISchema, Parsed } from 'typed-binary'; +import type { Builtin } from './builtin'; import type { F32, I32, U32, Vec4f, Vec4i, Vec4u } from './data'; -import type { Builtin } from './wgslBuiltin'; -import type { TgpuIdentifier } from './wgslIdentifier'; -import type { TgpuPlum } from './wgslPlum'; +import type { TgpuIdentifier } from './tgpuIdentifier'; +import type { TgpuPlum } from './tgpuPlum'; export type Wgsl = string | number | TgpuResolvable | symbol | boolean; diff --git a/packages/typegpu/src/wgsl.ts b/packages/typegpu/src/wgsl.ts index c191d678b..1da20bfc5 100644 --- a/packages/typegpu/src/wgsl.ts +++ b/packages/typegpu/src/wgsl.ts @@ -1,14 +1,14 @@ -import { buffer } from './wgslBuffer'; -import { code } from './wgslCode'; -import { constant } from './wgslConstant'; -import { declare } from './wgslDeclare'; -import { fn } from './wgslFunction'; -import { fn as fun } from './wgslFunctionExperimental'; -import { plum, plumFromEvent } from './wgslPlum'; -import { sampler } from './wgslSampler'; -import { slot } from './wgslSlot'; -import { texture, textureExternal } from './wgslTexture'; -import { variable } from './wgslVariable'; +import { buffer } from './tgpuBuffer'; +import { code } from './tgpuCode'; +import { constant } from './tgpuConstant'; +import { declare } from './tgpuDeclare'; +import { fn } from './tgpuFunction'; +import { fn as fun } from './tgpuFunctionExperimental'; +import { plum, plumFromEvent } from './tgpuPlum'; +import { sampler } from './tgpuSampler'; +import { slot } from './tgpuSlot'; +import { texture, textureExternal } from './tgpuTexture'; +import { variable } from './tgpuVariable'; export default Object.assign(code, { code, diff --git a/packages/typegpu/tests/plumStore.test.ts b/packages/typegpu/tests/plumStore.test.ts index b7ae42e51..14205591b 100644 --- a/packages/typegpu/tests/plumStore.test.ts +++ b/packages/typegpu/tests/plumStore.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest'; import { type PlumListener, PlumStore } from '../src/plumStore'; -import { type Getter, plum, plumFromEvent } from '../src/wgslPlum'; +import { type Getter, plum, plumFromEvent } from '../src/tgpuPlum'; function makeSubject(initial: T) { let value = initial; diff --git a/packages/typegpu/tests/runtime.test.ts b/packages/typegpu/tests/runtime.test.ts index ee74839ba..20b9b77ae 100644 --- a/packages/typegpu/tests/runtime.test.ts +++ b/packages/typegpu/tests/runtime.test.ts @@ -3,7 +3,7 @@ import { afterEach } from 'vitest'; import { createRuntime } from '../src/createRuntime'; import { struct, u32, vec3i, vec4u } from '../src/data'; import tgpu, { asReadonly, asUniform, wgsl } from '../src/experimental'; -import { plum } from '../src/wgslPlum'; +import { plum } from '../src/tgpuPlum'; global.GPUBufferUsage = { MAP_READ: 1,