gpu.js
gpu.js copied to clipboard
Please this dev is right but product incorrect
Error: Error compiling fragment shader: ERROR: 0:404: '!' : wrong operand type - no operation '!' exists that takes an operand of type lowp int (or there is no acceptable conversion) ERROR: 0:404: '&&' : wrong operand types - no operation '&&' exists that takes a left-hand operand of type 'bool' and a right operand of type 'void' (or there is no acceptable conversion)
Error: Error compiling fragment shader: ERROR: 0:404: ’!‘ : wrong operand type - no operation ’!‘ exists that takes an operand of type lowp int (or there is no acceptable conversion) ERROR: 0:404: ’&&‘ : wrong operand types - no operation ’&&‘ exists that takes a left-hand operand of type ’bool‘ and a right operand of type ’void‘ (or there is no acceptable conversion)
only a little code
If (len > this. Ouput. Y - this. Thread. Y)
I got the same problem....
@mei2015 could you provide the code that uses the ! operator and the && operator? It seems like you are comparing non-Boolean values with Boolean operators.
We'll need a more extensive example to solve this issue.
I have experienced this as a result of Angular's JS optimizer converting true into 1.0 for the release build but not the dev build. Ditto the && issue, as if(expr1) { expr2; } is optimized to expr1 && expr2 (if expr1 evaluates to false, then expr2 won't evaluate.
This is not a problem with GPU.js per se, since it is behaving properly given the code, but it took me a day and a half to track down the root cause, and it seems common enough that it should be documented.
The workaround for the ! issue is to encode booleans as 0-1 ints, and NOT x as (1-x).