Skip to content
Draft
20 changes: 0 additions & 20 deletions packages/typegpu/src/core/buffer/bufferShorthand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ export interface TgpuMutable<out TData extends BaseData> extends TgpuBufferShort
readonly buffer: TgpuBuffer<TData> & StorageFlag;

// Accessible on the GPU
/**
* @deprecated Use `.$` instead, works the same way.
*/
value: InferGPU<TData>;
$: InferGPU<TData>;
// ---

Expand All @@ -64,10 +60,6 @@ export interface TgpuReadonly<out TData extends BaseData> extends TgpuBufferShor
readonly buffer: TgpuBuffer<TData> & StorageFlag;

// Accessible on the GPU
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: InferGPU<TData>;
readonly $: InferGPU<TData>;
// ---

Expand All @@ -80,10 +72,6 @@ export interface TgpuUniform<out TData extends BaseData> extends TgpuBufferShort
readonly buffer: TgpuBuffer<TData> & UniformFlag;

// Accessible on the GPU
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: InferGPU<TData>;
readonly $: InferGPU<TData>;
// ---
}
Expand Down Expand Up @@ -221,14 +209,6 @@ export class TgpuBufferShorthandImpl<
assertExhaustive(mode, 'bufferShorthand.ts#TgpuBufferShorthandImpl/$');
}

get value(): InferGPU<TData> {
return this.$;
}

set value(value: InferGPU<TData>) {
this.$ = value;
}

toString(): string {
return `${this.resourceType}BufferShorthand:${getName(this) ?? '<unnamed>'}`;
}
Expand Down
8 changes: 0 additions & 8 deletions packages/typegpu/src/core/constant/tgpuConstant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ type DeepReadonly<T> = T extends { [$internal]: unknown }
export interface TgpuConst<TDataType extends BaseData = BaseData> extends TgpuNamable {
readonly resourceType: 'const';
readonly [$gpuValueOf]: DeepReadonly<InferGPU<TDataType>>;
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: DeepReadonly<InferGPU<TDataType>>;
readonly $: DeepReadonly<InferGPU<TDataType>>;

readonly [$internal]: {
Expand Down Expand Up @@ -144,8 +140,4 @@ class TgpuConstImpl<TDataType extends BaseData> implements TgpuConst<TDataType>,

return this.#value;
}

get value(): DeepReadonly<InferGPU<TDataType>> {
return this.$;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { valueProxyHandler } from '../valueProxyUtils.ts';
*/
export interface TgpuRawCodeSnippet<TDataType extends BaseData> {
$: InferGPU<TDataType>;
value: InferGPU<TDataType>;
readonly [$gpuValueOf]: InferGPU<TDataType>;

$uses(dependencyMap: Record<string, unknown>): this;
Expand Down Expand Up @@ -146,8 +145,4 @@ class TgpuRawCodeSnippetImpl<TDataType extends BaseData>

return this[$gpuValueOf];
}

get value(): InferGPU<TDataType> {
return this.$;
}
}
10 changes: 0 additions & 10 deletions packages/typegpu/src/core/sampler/sampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface TgpuSampler {
readonly schema: WgslSampler;

readonly [$gpuValueOf]: Infer<WgslSampler>;
value: Infer<WgslSampler>;
$: Infer<WgslSampler>;

toString(): string;
Expand All @@ -42,7 +41,6 @@ export interface TgpuComparisonSampler {
readonly schema: WgslComparisonSampler;

readonly [$gpuValueOf]: Infer<WgslComparisonSampler>;
value: Infer<WgslComparisonSampler>;
$: Infer<WgslComparisonSampler>;

toString(): string;
Expand Down Expand Up @@ -140,10 +138,6 @@ export class TgpuLaidOutSamplerImpl<
);
}

get value(): Infer<T> {
return this.$;
}

toString() {
return `${this.resourceType}:${getName(this) ?? '<unnamed>'}`;
}
Expand Down Expand Up @@ -231,10 +225,6 @@ class TgpuFixedSamplerImpl<T extends WgslSampler | WgslComparisonSampler>
);
}

get value(): Infer<T> {
return this.$;
}

$name(label: string) {
setName(this, label);
return this;
Expand Down
4 changes: 0 additions & 4 deletions packages/typegpu/src/core/slot/accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ abstract class AccessorBase<

abstract readonly $: InferGPU<T>;

get value(): InferGPU<T> {
return this.$;
}

[$resolve](ctx: ResolutionCtx): ResolvedSnippet {
const snippet = this.#createSnippet();
return snip(
Expand Down
4 changes: 0 additions & 4 deletions packages/typegpu/src/core/slot/lazy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class TgpuLazyImpl<out T> implements TgpuLazy<T> {
return getGpuValueRecursively(ctx.unwrap(this));
}

get value(): GPUValueOf<T> {
return this[$gpuValueOf];
}

get $(): GPUValueOf<T> {
return this[$gpuValueOf];
}
Expand Down
6 changes: 1 addition & 5 deletions packages/typegpu/src/core/slot/slot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ class TgpuSlotImpl<T> implements TgpuSlot<T> {
return getGpuValueRecursively(ctx.unwrap(this));
}

get value(): GPUValueOf<T> {
return this[$gpuValueOf];
}

get $(): GPUValueOf<T> {
return this.value;
return this[$gpuValueOf];
}
}
13 changes: 0 additions & 13 deletions packages/typegpu/src/core/slot/slotTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export interface TgpuSlot<T> extends TgpuNamable {
areEqual(a: T, b: T): boolean;

readonly [$gpuValueOf]: GPUValueOf<T>;
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: GPUValueOf<T>;
readonly $: GPUValueOf<T>;
toString(): string;
}
Expand All @@ -38,10 +34,6 @@ export interface TgpuLazy<out T> extends Withable<TgpuLazy<T>> {
readonly resourceType: 'lazy';

readonly [$gpuValueOf]: GPUValueOf<T>;
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: GPUValueOf<T>;
readonly $: GPUValueOf<T>;

// Type-tokens, not available at runtime
Expand All @@ -58,10 +50,6 @@ export interface TgpuAccessor<T extends BaseData = BaseData> extends TgpuNamable
readonly slot: TgpuSlot<TgpuAccessor.In<T>>;

readonly [$gpuValueOf]: InferGPU<T>;
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: InferGPU<T>;
readonly $: InferGPU<T>;

toString(): string;
Expand Down Expand Up @@ -95,7 +83,6 @@ export interface TgpuMutableAccessor<T extends BaseData = BaseData> extends Tgpu
readonly slot: TgpuSlot<TgpuMutableAccessor.In<T>>;

readonly [$gpuValueOf]: InferGPU<T>;
value: InferGPU<T>;
$: InferGPU<T>;
}

Expand Down
4 changes: 0 additions & 4 deletions packages/typegpu/src/core/texture/externalTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ export class TgpuExternalTextureImpl implements TgpuExternalTexture, SelfResolva
);
}

get value(): Infer<WgslExternalTexture> {
return this.$;
}

toString() {
return `textureExternal:${getName(this) ?? '<unnamed>'}`;
}
Expand Down
9 changes: 0 additions & 9 deletions packages/typegpu/src/core/texture/texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ export interface TgpuTextureView<
readonly size?: number[] | undefined;

readonly [$gpuValueOf]: Infer<TSchema>;
value: Infer<TSchema>;
$: Infer<TSchema>;

toString(): string;
Expand Down Expand Up @@ -590,10 +589,6 @@ class TgpuFixedTextureViewImpl<T extends WgslTexture | WgslStorageTexture>
);
}

get value(): Infer<T> {
return this.$;
}

get size(): number[] {
return this.#baseTexture.props.size;
}
Expand Down Expand Up @@ -687,10 +682,6 @@ export class TgpuLaidOutTextureViewImpl<T extends WgslTexture | WgslStorageTextu
);
}

get value(): Infer<T> {
return this.$;
}

$name(label: string): this {
setName(this, label);
return this;
Expand Down
12 changes: 0 additions & 12 deletions packages/typegpu/src/core/variable/tgpuVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export interface TgpuVar<
> extends TgpuNamable {
readonly resourceType: 'var';
readonly [$gpuValueOf]: InferGPU<TDataType>;
/**
* @deprecated Use `.$` instead, works the same way.
*/
value: InferGPU<TDataType>;
$: InferGPU<TDataType>;

readonly [$internal]: {
Expand Down Expand Up @@ -177,12 +173,4 @@ class TgpuVarImpl<TScope extends VariableScope, TDataType extends BaseData>

assertExhaustive(mode, 'tgpuVariable.ts#TgpuVarImpl/$');
}

get value(): InferGPU<TDataType> {
return this.$;
}

set value(v: InferGPU<TDataType>) {
this.$ = v;
}
}
14 changes: 2 additions & 12 deletions packages/typegpu/src/tgpuBindGroupLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ export interface TgpuBindGroupLayout<
readonly [$gpuValueOf]: {
[K in keyof Entries]: InferLayoutEntry<Entries[K]>;
};
/**
* @deprecated Use `.$` instead, works the same way.
*/
readonly value: {
[K in keyof Entries]: InferLayoutEntry<Entries[K]>;
};
readonly $: {
[K in keyof Entries]: InferLayoutEntry<Entries[K]>;
};
Expand Down Expand Up @@ -267,11 +261,7 @@ class TgpuBindGroupLayoutImpl<
readonly [$internal]: ResolvableObject[];
readonly resourceType = 'bind-group-layout' as const;

readonly value = {} as {
[K in keyof Entries]: InferLayoutEntry<Entries[K]>;
};

readonly $ = this.value as {
readonly $ = {} as {
[K in keyof Entries]: InferLayoutEntry<Entries[K]>;
};

Expand Down Expand Up @@ -325,7 +315,7 @@ class TgpuBindGroupLayoutImpl<
}

invariant(item !== undefined, 'Internal error, expected item to be defined');
Object.defineProperty(this.value, key, {
Object.defineProperty(this.$, key, {
get: () => {
return item.$;
},
Expand Down
Loading