Graphical output canvas is affected by a separate kernel
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện GPU.js trong trình duyệt được cung cấp trên Chrome với WebGL2 được bật, tập trung vào createKernel, setGraphical, setOutput và tương tác với renderKernel.canvas. So sánh kích thước canvas sau khi imgKernel chạy với đầu ra đồ họa 32x32 dự kiến. Được xem là hoàn tất khi image kernel riêng biệt không còn ảnh hưởng đến kích thước canvas được kết xuất; canvas phải có kích thước 32x32 và được đầu ra màu đỏ lấp đầy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả

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.
- Ngôn ngữ chính
- JavaScript
- Star
- 15.5k
- Fork
- 663
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gpujs/gpu.js
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
WebGL backend silently returns all zeros for long-running kernels (no GL error, no context loss)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Bitwise result not correctĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Issue tương tự
-
Complexity: Small P-Feature: Projects page ready for merge team role: back end/devOps role: front end size: 0.25pt
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100
bellingcat/toolkit#905 ·
-
self-care self-care:docs-build-time-investigator
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 76/100
githubnext/gh-aw-cao#14191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:low impact:medium RAG status: auto-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mastra-ai/mastra#25229 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sugarlabs/musicblocks#8984 ·
Maintainer thường phản hồi trong vòng 1 ngày