Graphical output canvas is affected by a separate kernel
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
まず、WebGL2 を有効にした Chrome で、提供されている GPU.js のブラウザー再現を実行し、createKernel、setGraphical、setOutput、および renderKernel.canvas とのインタラクションに注目します。imgKernel の実行後の canvas の寸法を、期待される 32x32 のグラフィカル出力と比較します。個別の画像カーネルがレンダリングされた canvas のサイズに影響しなくなり、canvas が 32x32 で赤い出力によって全面的に埋められていれば完了です。
索引モデルが issue の本文から書いたものです。
説明

What is wrong?
It seems as if one kernel's output size can affect the size of a canvas created by another. This means that the canvas created by a kernel is larger than should be expected.
Where does it happen?
GPU.js running in browser in Chrome on a Mac (WebGL2 enabled)
How do we replicate the issue?
const gpu = new GPU();
const img_width = 64;
const img_height = 64;
const imgKernel = gpu
.createKernel(function (_image) {
const pixel = _image[this.thread.y][this.thread.x];
return pixel[0];
})
.setOutput([img_width, img_height]);
const renderKernel = gpu
.createKernel(function () {
this.color(1, 0, 0, 1);
})
.setGraphical(true)
.setOutput([32, 32]);
const image = document.createElement("img");
image.src = "./test.png";
image.onload = () => {
console.log("image width x height", image.naturalWidth, image.naturalHeight);
const imgOut = imgKernel(image); // This is not used just run
document.body.appendChild(renderKernel.canvas);
renderKernel();
};
The output looks like this:

You can see that the canvas is 64x64 pixels, the size of the imgKernel but the red section is 32x32 inside that which is the output of renderKernel despite the two having no relationship other than both of them are called.
How important is this (1-5)?
5 This is a pretty limiting bug if you want to use multiple kernels.
Expected behavior (i.e. solution)
Should show a 32x32 red canvas as far as I can tell.
Other Comments
Thank you for your time looking at this.
- 主要言語
- 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
-
curriculum documentation quality
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
githubnext/gh-aw-workshop#3897 ·
メンテナーはふだん 2 日以内に返信
-
agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
check:failed feeds:add
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
iptv-org/database#36179 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信