Skip to content

Commit

Permalink
Rename files from wgsl to tgpu (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhawryluk authored Sep 10, 2024
1 parent ff3f17c commit 75de8e3
Show file tree
Hide file tree
Showing 32 changed files with 98 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -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<BufferUsage, 'vertex'>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TgpuIdentifier } from './wgslIdentifier';
import { TgpuIdentifier } from './tgpuIdentifier';

export const builtin = {
vertexIndex: Symbol('builtin_vertexIndex'),
Expand Down
2 changes: 1 addition & 1 deletion packages/typegpu/src/builtinTypes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { builtin } from './builtin';
import {
type F32,
type TgpuArray,
Expand All @@ -10,7 +11,6 @@ import {
vec3u,
vec4f,
} from './data';
import { builtin } from './wgslBuiltin';

export type BuiltInPossibleTypes = U32 | F32 | Vec3u | Vec4f | TgpuArray<U32>;

Expand Down
20 changes: 10 additions & 10 deletions packages/typegpu/src/createRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ 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,
RenderPipelineExecutorOptions,
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.
Expand Down
4 changes: 2 additions & 2 deletions packages/typegpu/src/data/struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
28 changes: 14 additions & 14 deletions packages/typegpu/src/experimental/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
4 changes: 2 additions & 2 deletions packages/typegpu/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export {
isUsableAsStorage,
isUsableAsUniform,
isUsableAsVertex,
} from './wgslBuffer';
} from './tgpuBuffer';

export type {
TgpuBuffer,
Unmanaged,
} from './wgslBuffer';
} from './tgpuBuffer';
4 changes: 2 additions & 2 deletions packages/typegpu/src/macro/repeat.ts
Original file line number Diff line number Diff line change
@@ -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<Wgsl>,
Expand Down
2 changes: 1 addition & 1 deletion packages/typegpu/src/plumStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type Getter,
type TgpuPlum,
isExternalPlum,
} from './wgslPlum';
} from './tgpuPlum';

export type PlumListener<T> = (newValue: T) => unknown;
type Unsubscribe = () => void;
Expand Down
18 changes: 9 additions & 9 deletions packages/typegpu/src/programBuilder.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/typegpu/src/resolutionCtx.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/typegpu/src/resolutionUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { code } from './tgpuCode';
import type { Wgsl } from './types';
import { code } from './wgslCode';

/**
* Represent expressions as a comma-separated list.
Expand Down
2 changes: 1 addition & 1 deletion packages/typegpu/src/tgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export {
Uniform,
Storage,
Vertex,
} from './wgslBuffer';
} from './tgpuBuffer';
export { read, write } from './tgpuBufferUtils';
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { SimpleTgpuData, TgpuArrayImpl } from './data';
import type {
AnyTgpuData,
BufferUsage,
ResolutionCtx,
TgpuBindable,
} from './types';
import {
type Storage,
type TgpuBuffer,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/typegpu/src/tgpuBufferUtils.ts
Original file line number Diff line number Diff line change
@@ -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<TData extends AnyTgpuData>(
buffer: TgpuBuffer<TData> & Unmanaged,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getBuiltinInfo } from './builtin';
import {
type Eventual,
type InlineResolve,
Expand All @@ -9,7 +10,6 @@ import {
type Wgsl,
isResolvable,
} from './types';
import { getBuiltinInfo } from './wgslBuiltin';

// ----------
// Public API
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { code } from './tgpuCode';
import type {
InlineResolve,
ResolutionCtx,
TgpuResolvable,
Wgsl,
} from './types';
import { code } from './wgslCode';

// ----------
// Public API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { code } from './tgpuCode';
import { TgpuIdentifier } from './tgpuIdentifier';
import type {
Eventual,
InlineResolve,
Expand All @@ -8,8 +10,6 @@ import type {
TgpuSlot,
Wgsl,
} from './types';
import { code } from './wgslCode';
import { TgpuIdentifier } from './wgslIdentifier';

// ----------
// Public API
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -9,8 +11,6 @@ import type {
TgpuValue,
Wgsl,
} from './types';
import { code } from './wgslCode';
import { TgpuIdentifier } from './wgslIdentifier';

// ----------
// Public API
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
Loading

0 comments on commit 75de8e3

Please sign in to comment.