You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constgpu=newGPU();constkernel=gpu.createKernel(function(v){return1+v[this.thread.x];},{output: [1],pipeline: true});const{ context }=kernel;constresult1=kernel([1]);checkError(context);console.log(result1.toArray());constresult2=kernel(result1);checkError(context);console.log(result2.toArray());// this makes a warningconstresult3=kernel(result2);checkError(context);console.log(result3.toArray());functioncheckError(context){consterror=context.getError();if(error>0){thrownewError(`The error is ${error}`);}}
NOTE: this is kind of confusing, but what happens is:
A standard kernel is built
A kernel is ran and returns a texture
That output texture is used with the same kernel
Because the input type differs from the initial run, a new internal kernel is built just in time to handle this new value.
The new kernel returns a texture.
That texture is used with the same kernel, because the output of the same kernel is compatible with this same input type, the kernel is trying to overwrite the very value it is reading from, and since the kernel isn't creating a new texture each time (ie: immutable: true) the kernel has a warning, and essentially throws.
The output can be different in different browsers, I think Firefox is smart enough to handle this scenario, but Chrome dies, for example.
Where does it happen?
How do we replicate the issue?
How important is this (1-5)?
5 We should simply have a check that checks for this exact scenario and resolves it internally, so the end user doesn't have to think about it.
Expected behavior (i.e. solution)
Other Comments
The text was updated successfully, but these errors were encountered:
...it kind of snowballed from some needs
Fixesgpujs#521 - If `tactic` is not set, check precision allowed from WebGL, and automatically change based off needs, otherwise use value from `tactic`.
Fixesgpujs#535 - Internally check if texture from argument is the same as output, if so, clone this texture, and then clean it up after the kernel runs.
Fixesgpujs#536 - Normalize all declarations to non-destructured, and then parse
Fixesgpujs#537 - Change logic
Fixesgpujs#538 - Found the GL script that would work, and reduced the methods to use it
Fixesgpujs#539 - Found a better way of testing random, and this gives me an error for 1 in 10 runs, acceptable
Some refactoring for less duplicate code and documentation
As outlined in https://jsfiddle.net/robertleeplummerjr/jtoyua1w/7/ the following throws an error:
What is wrong?
NOTE: this is kind of confusing, but what happens is:
immutable: true
) the kernel has a warning, and essentially throws.Where does it happen?
How do we replicate the issue?
How important is this (1-5)?
5 We should simply have a check that checks for this exact scenario and resolves it internally, so the end user doesn't have to think about it.
Expected behavior (i.e. solution)
Other Comments
The text was updated successfully, but these errors were encountered: