We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphical option with ImageData doesn't work in WebWorker but when I use {mode: 'cpu'} it works.
{mode: 'cpu'}
Google Chrome FireFox
Windows 11 22H2 i7 8565U UHD Graphics 620
Windows 11 22H2 i7 1255U Intel Iris Xe Graphics
// 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);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: