GPUCompilationMessage: message 屬性

可用性有限

此特性不是基線特性,因為它在一些最廣泛使用的瀏覽器中不起作用。

安全上下文: 此功能僅在安全上下文(HTTPS)中可用,且支援此功能的瀏覽器數量有限。

注意:此功能在 Web Workers 中可用。

GPUCompilationMessage 介面的 message 只讀屬性是一個字串,表示人類可讀的訊息文字。

字串。

示例

js
const shaderModule = device.createShaderModule({
  code: shaders,
});

const shaderInfo = await shaderModule.getCompilationInfo();
const firstMessage = shaderInfo.messages[0];
console.log(firstMessage.message);

有關更詳細的示例,請參閱主要的 GPUCompilationInfo 頁面

規範

規範
WebGPU
# dom-gpucompilationmessage-message

瀏覽器相容性

另見