GPUTexture:format 屬性
注意:此功能在 Web Workers 中可用。
GPUTexture 介面的format 只讀屬性表示 GPUTexture 的格式。
此屬性透過傳入到原始的 GPUDevice.createTexture() 呼叫中的描述符物件的 format 屬性設定。
值
一個列舉值。有關所有可能的值,請參閱規範中的紋理格式(Texture formats)部分。
示例
js
// …
const depthTexture = device.createTexture({
size: [canvas.width, canvas.height],
format: "depth24plus",
usage: GPUTextureUsage.RENDER_ATTACHMENT,
});
console.log(depthTexture.format); // "depth24plus"
規範
| 規範 |
|---|
| WebGPU # dom-gputexture-format |
瀏覽器相容性
載入中…