gpu.js icon indicating copy to clipboard operation
gpu.js copied to clipboard

renderer.js:1 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)

Open mei2015 opened this issue 5 years ago • 5 comments

renderer.js:1 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)

The development environment is normal but the packaging is not normal with webpack packaging

mei2015 avatar Mar 26 '20 03:03 mei2015

Can you post reproduction steps?

robertleeplummerjr avatar Mar 26 '20 11:03 robertleeplummerjr

Duplicate of #584

FarazzShaikh avatar Aug 11 '20 06:08 FarazzShaikh

Can you post reproduction steps?

robertleeplummerjr avatar Aug 11 '20 12:08 robertleeplummerjr

Please see my comment on #584.

evanakm avatar Feb 03 '21 00:02 evanakm

Just use "new Function",webpack will not compile it,example:

let process = this.gpu.createKernel(new Function (['canvas0', 'canvas1'],` let pixel0 = canvas0[this.thread.y][this.thread.x] let pixel1 = canvas1[this.thread.y][this.thread.x] if (pixel1[0] != this.constants.defaultColor[0] || pixel1[1] != this.constants.defaultColor[1] || pixel1[2] != this.constants.defaultColor[2] || pixel1[3] != this.constants.defaultColor[3]) { pixel0[0] = pixel1[0] pixel0[1] = pixel1[1] pixel0[2] = pixel1[2] pixel0[3] = pixel1[3] } this.color(pixel0[0], pixel0[1], pixel0[2], pixel0[3]) `), { constants: { loopLength: canvases.length, defaultColor: defaultColor.map(v => v / 255) } }).setGraphical(true).setOutput([canvases[0].width, canvases[0].height]);

thesunfei avatar Feb 24 '21 08:02 thesunfei