GPUDevice: phương thức createRenderPipelineAsync()
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 createRenderPipelineAsync() của giao diện GPUDevice trả về một Promise sẽ được hoàn tất với một GPURenderPipeline, có thể điều khiển các giai đoạn vertex và fragment shader và được dùng trong GPURenderPassEncoder hoặc GPURenderBundleEncoder khi pipeline có thể dùng mà không gây chặn.
Note:
Nói chung nên dùng phương thức này thay cho GPUDevice.createRenderPipeline() khi có thể, vì nó tránh chặn việc thực thi thao tác GPU trong lúc biên dịch pipeline.
Cú pháp
createRenderPipelineAsync(descriptor)
Tham số
descriptor-
Xem định nghĩa descriptor cho phương thức
GPUDevice.createRenderPipeline().
Giá trị trả về
Một Promise sẽ được hoàn tất với một thể hiện GPURenderPipeline khi pipeline được tạo đã sẵn sàng để dùng mà không cần chờ thêm.
Đặc tả
| Specification |
|---|
| WebGPU> # dom-gpudevice-createrenderpipelineasync> |