GPUInternalError

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

WebGPU APIGPUInternalError インターフェイスは、バリデーションの要求がすべて満たされたにもかかわらずシステムまたは実装に固有の理由で処理に失敗したことを表すアプリケーションエラーを表します。

これは、GPUDevice.popErrorScope および uncapturederror イベントで浮かび上がったエラーの型の一つを表します。

内部エラーは、バリデーションに引っかからず、アウトオブメモリーエラーであると明確に特定できない何かが WebGPU の実装で起きたとき発生します。これは、一般的に、コードが実行しようとした処理が WebGPU で対応している制限で表すのが難しい点でシステムの制限に引っかかったことを示します。同じ処理は、他のデバイスでは成功するかもしれません。このようなエラーはパイプラインの生成でのみ発生し、通常はシェーダーがデバイスにとって複雑すぎるとき発生します。

GPUError GPUInternalError

コンストラクター

GPUInternalError() Experimental

新しい GPUInternalError オブジェクトのインスタンスを生成します。

インスタンスプロパティ

親の GPUError から message プロパティを継承しています。

message Experimental 読取専用

なぜエラーが発生したかを説明する人間向けのメッセージを提供する文字列です。

以下の例では、エラースコープを用いてバリデーションエラーだと疑われるものをキャプチャし、コンソールに記録します。

js
device.pushErrorScope("internal");

const module = device.createShaderModule({
  code: shader, // **非常に**複雑なシェーダー
});

device.popErrorScope().then((error) => {
  if (error) {
    // error は GPUInternalError オブジェクトのインスタンス
    module = null;
    console.error(`シェーダーの作成時にエラー発生: ${error.message}`);
  }
});

仕様書

Specification
WebGPU
# gpuinternalerror

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
GPUInternalError
Experimental
GPUInternalError() constructor
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

関連情報