Skip to content

Commit

Permalink
tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed Mar 4, 2024
1 parent cdb25e6 commit 14fa757
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/webgpu/src/adapter/resources/webgpu-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class WebGPUBuffer extends Buffer {

override destroy(): void {
this.handle?.destroy();
// @ts-expect-error readonly
this.handle = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class WebGPUExternalTexture extends ExternalTexture {
// External textures are destroyed automatically,
// as a microtask, instead of manually or upon garbage collection like other resources.
// this.handle.destroy();
// @ts-expect-error readonly
this.handle = null;
}

Expand Down
1 change: 1 addition & 0 deletions modules/webgpu/src/adapter/resources/webgpu-query-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class WebGPUQuerySet extends QuerySet {

override destroy(): void {
this.handle?.destroy();
// @ts-expect-error readonly
this.handle = null;
}
}
2 changes: 2 additions & 0 deletions modules/webgpu/src/adapter/resources/webgpu-sampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export class WebGPUSampler extends Sampler {
}

override destroy(): void {
// GPUSampler does not have a destroy method
// this.handle.destroy();
// @ts-expect-error readonly
this.handle = null;
}
}
1 change: 1 addition & 0 deletions modules/webgpu/src/adapter/resources/webgpu-shader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class WebGPUShader extends Shader {
override destroy(): void {
// Note: WebGPU does not offer a method to destroy shaders
// this.handle.destroy();
// @ts-expect-error readonly
this.handle = null;
}

Expand Down
2 changes: 2 additions & 0 deletions modules/webgpu/src/adapter/resources/webgpu-texture-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export class WebGPUTextureView extends TextureView {
}

override destroy(): void {
// GPUTextureView does not have a destroy method
// this.handle.destroy();
// @ts-expect-error readonly
this.handle = null;
}
}
1 change: 1 addition & 0 deletions modules/webgpu/src/adapter/resources/webgpu-texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class WebGPUTexture extends Texture {

override destroy(): void {
this.handle?.destroy();
// @ts-expect-error readonly
this.handle = null;
}

Expand Down

0 comments on commit 14fa757

Please sign in to comment.