Error: Unhandled argument combination of ArrayTexture(2) and Array(2) for argument named "texture" on line 2, position 1:
doSample(texture, [x, y])
If I uncomment out the argumentTypes line in the call to addNativeFunction, I get:
Error: Error compiling fragment shader: ERROR: 0:508: 'doSample' : no matching overloaded function found
ERROR: 0:508: 'assign' : cannot convert from 'const float' to 'lowp 2-component vector of float'
If I use the gpu.addFunction variant of doSample instead of the addNativeFunction variant, it compiles and runs, although that doesn't actually implement the interpolation that GLSL's texture2D does (which is why I need to use addNativeFunction).
Where does it happen?
I'm running this on MacOS 10.13, using node, and gpu.js version 2.10.6.
How do we replicate the issue?
See above.
How important is this (1-5)?
Without being able to do this, I don't believe I'll be able to use gpu.js, so for me personally this is a 5.
What is wrong?
I'm trying to use
addNativeFunction
with textures as inputs, and running into typechecking issues in the transpiler process.Here is my sample code, with some parts commented out:
When I compile this as-is, I get:
If I uncomment out the
argumentTypes
line in the call toaddNativeFunction
, I get:If I use the
gpu.addFunction
variant ofdoSample
instead of theaddNativeFunction
variant, it compiles and runs, although that doesn't actually implement the interpolation that GLSL'stexture2D
does (which is why I need to useaddNativeFunction
).Where does it happen?
I'm running this on MacOS 10.13, using node, and gpu.js version 2.10.6.
How do we replicate the issue?
See above.
How important is this (1-5)?
Without being able to do this, I don't believe I'll be able to use gpu.js, so for me personally this is a 5.
Expected behavior (i.e. solution)
It should print something like:
while using
addNativeFunction
.