GPUCompilationMessage: length 属性
注意:此功能在 Web Workers 中可用。
GPUCompilationMessage 接口的 length 只读属性是一个数字,表示消息对应的子字符串的长度。
值
一个数字。
准确地说,length 是着色器代码子字符串中 UTF-16 代码单元的数量,该子字符串对应于此消息。如果消息对应于单个点而不是子字符串,则 length 将为 0。
示例
js
const shaderModule = device.createShaderModule({
code: shaders,
});
const shaderInfo = await shaderModule.getCompilationInfo();
const firstMessage = shaderInfo.messages[0];
console.log(firstMessage.length);
有关更详细的示例,请参阅主要的 GPUCompilationInfo 页面。
规范
| 规范 |
|---|
| WebGPU # dom-gpucompilationmessage-length |
浏览器兼容性
加载中…