Open poonwu opened 4 years ago
Nevermind, it's my mistake. I believe the matrices are intended to be passed as input only, not constants. Apparently, we really need better constants documentation.
So, to solve above case, just don't set texture as constants and correct the kernel to something like identity(m, n)
where m,n are matrices.
I believe the matrices are intended to be passed as input only, not constants.
That is incorrect, this is a bug.
Setting constants somehow override the input in GPU mode. This behavior, of course, does not happen in CPU mode.
I am using Node v14.4.0 and GPU.js 2.9.5
How important is this (1-5)?
4 or 5. This is related to the core function of gpu.js
Expected behavior
Should return same values as CPU counterpart.
Other Comments
I checked the compiled shader code, and nothing much different between no
setConstants
andsetConstants
other than extra uniform sampler field. That field isn't even accessed, so I can only suspect that the lib might be sending constant texture to the wrong channel...