Graphical option with ImageData doesn't work in WebWorker
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
リポジトリのファイルやテストは指定されていません。まず、Chrome または Firefox の WebWorker で ImageData を使って、提供されている createKernel の例を再現し、その後、グラフィカルシェーダーのコンパイルと入力処理を追跡してください。グラフィカルモードが、報告されているシェーダーエラーやバイナリ式エラーなしで WebWorker 内の ImageData 入力を受け入れ、CPU モードも引き続き動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Issue
Graphical option with ImageData doesn't work in WebWorker but when I use {mode: 'cpu'} it works.
Env
Google Chrome
FireFox
Windows 11 22H2
i7 8565U
UHD Graphics 620
Windows 11 22H2
i7 1255U
Intel Iris Xe Graphics
Code
// doesn't work
const gpu = new GPU();
const graphicalTest = gpu.createKernel(function(data) {
const [r, g, b, a] = data[this.thread.y][this.thread.x];
this.color(r, g, b, a);
}, {
output: [width, height],
graphical: true,
});
graphicalTest(imageData/* ImageData Object */);
const newImageData = new ImageData(Uint8ClampedArray.from(graphicalTest.getPixels()), this.#width, this.#height);
// > gpu-browser.min.js:28 Uncaught (in promise) Error: Error compiling fragment shader: ERROR: 0:465: 'color' : no matching overloaded function found
// works
const gpu = new GPU({mode: 'cpu'});
const graphicalTest = gpu.createKernel(function(data) {
const [r, g, b, a] = data[this.thread.y][this.thread.x];
this.color(r, g, b, a);
}, {
output: [width, height],
graphical: true,
});
graphicalTest(imageData/* ImageData Object */);
const newImageData = new ImageData(Uint8ClampedArray.from(graphicalTest.getPixels()), this.#width, this.#height);
// doesn't work
const gpu = new GPU();
const graphicalTest = gpu.createKernel(function(data) {
const [r, g, b, a] = data[this.thread.y][this.thread.x];
const sum = r + g + b + a;
this.color(r, g, b, a);
}, {
output: [width, height],
graphical: true,
});
graphicalTest(imageData/* ImageData Object */);
const newImageData = new ImageData(Uint8ClampedArray.from(graphicalTest.getPixels()), this.#width, this.#height);
// > Uncaught (in promise) Error: Unhandled binary expression between Number & Array(4) on line 2, position 3:]
// works
const gpu = new GPU({mode: 'cpu'});
const graphicalTest = gpu.createKernel(function(data) {
const [r, g, b, a] = data[this.thread.y][this.thread.x];
const sum = r + g + b + a;
this.color(r, g, b, a);
}, {
output: [width, height],
graphical: true,
});
graphicalTest(imageData/* ImageData Object */);
const newImageData = new ImageData(Uint8ClampedArray.from(graphicalTest.getPixels()), this.#width, this.#height);
- 主要言語
- JavaScript
- スター
- 15.5k
- フォーク
- 663
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gpujs/gpu.js のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
WebGL backend silently returns all zeros for long-running kernels (no GL error, no context loss)オープン
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
似ている issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
amponce/archive-movie-browser#354 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
saayam-for-all/webapp#1870 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Imageomics/OpenCite#66 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
chr15m/twiiit.com#20 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
antropos17/Aegis#629 ·
メンテナーはふだん 4 日以内に返信