GPUTexture: destroy() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

Phương thức destroy() của giao diện GPUTexture hủy GPUTexture.

Cú pháp

js
destroy()

Tham số

Không có.

Giá trị trả về

Không có (Undefined).

Ví dụ

js
// …

const depthTexture = device.createTexture({
  size: [canvas.width, canvas.height],
  format: "depth24plus",
  usage: GPUTextureUsage.RENDER_ATTACHMENT,
});

// some time later

depthTexture.destroy();

Thông số kỹ thuật

Specification
WebGPU
# dom-gputexture-destroy

Tương thích trình duyệt

Xem thêm