GPUDevice: phương thức createShaderModule()

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 createShaderModule() của giao diện GPUDevice tạo một GPUShaderModule từ một chuỗi mã nguồn WGSL.

Cú pháp

js
createShaderModule(descriptor)

Tham số

descriptor

Đối tượng mô tả module shader cần tạo.

Giá trị trả về

Một thể hiện GPUShaderModule.

Đặc tả

Specification
WebGPU
# dom-gpudevice-createshadermodule

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