GPUCompilationMessage: type property
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.
Thuộc tính chỉ đọc type của giao diện GPUCompilationMessage là một giá trị liệt kê đại diện cho loại thông báo. Mỗi loại đại diện cho một mức độ nghiêm trọng khác nhau.
Giá trị
Một giá trị liệt kê. Các giá trị có thể:
Ví dụ
js
const shaderModule = device.createShaderModule({
code: shaders,
});
const shaderInfo = await shaderModule.getCompilationInfo();
const firstMessage = shaderInfo.messages[0];
console.log(firstMessage.type);
Xem trang chính GPUCompilationInfo để biết ví dụ chi tiết hơn.
Thông số kỹ thuật
| Specification |
|---|
| WebGPU> # dom-gpucompilationmessage-type> |