Skip to content

Conversation

robertleeplummerjr
Copy link
Member

All tests passing, webgl2 iminent.

@robertleeplummerjr robertleeplummerjr changed the title 261 webgl2 261 - webgl2 Feb 26, 2018
@ubernaut
Copy link

ubernaut commented Mar 5, 2018

Will the addition of webgl2 support bring in any new features, or make new features possible in the future?

@robertleeplummerjr
Copy link
Member Author

It'll open the door for the following to be either fixed, or resolved completely:

#247
#202
#166
#92
#194

@robertleeplummerjr
Copy link
Member Author

All tests that can be are run on cpu, auto, gpu, and then specifically for webgl & webgl2

Firefox: screen shot 2018-03-08 at 8 03 39 pm

Chrome:
screen shot 2018-03-08 at 8 05 25 pm

@robertleeplummerjr
Copy link
Member Author

Here is a profile of a neural network (brain.js) learning xor, using webgl 2 via gpu.js:
screen shot 2018-03-08 at 8 10 06 pm

@robertleeplummerjr robertleeplummerjr merged commit b99960c into develop Mar 9, 2018
@robertleeplummerjr robertleeplummerjr deleted the 261-webgl2 branch March 9, 2018 01:13
@Blancduman
Copy link

Blancduman commented May 22, 2019

I noticed in gpu.js-2.0.0-rc.13 release you have folder webgl2.. How to use it? I really need it

@robertleeplummerjr
Copy link
Member Author

If you simply use

const gpu = new GPU();
const kernel = gpu.createKernel(function() {
  // some maths here
  return value;
}, { output: [50] });

If it is available on your system, WebGL2 will be used automatically. If it is not, WebGL1 will be used. If that isn't available, your CPU will be used. Likewise in Node, if you do the same, HeadlessGL will be used, and if it is not available, CPU will be used.

@Blancduman
Copy link

well... I get this error:

C:\GitProjects\WebProjects\fighting-gold\backend\node_modules\gpu.js\src\backend\web-gl\kernel.js:406
                        throw new Error('Error compiling fragment shader: ' + gl.getShaderInfoLog(fragShader));
                        ^

Error: Error compiling fragment shader: ERROR: 0:202: '<<=' : bit-wise operator supported in GLSL ES 3.00 only
ERROR: 0:202: 'assign' :  cannot convert from 'const float' to 'highp float'
ERROR: 0:204: '^' : bit-wise operator supported in GLSL ES 3.00 only
ERROR: 0:204: '^' :  wrong operand types  no operation '^' exists that takes a left-hand operand of type 'highp float' and a right operand of type 'const float' (or there is no acceptable conversion)
ERROR: 0:204: '&' : bit-wise operator supported in GLSL ES 3.00 only
ERROR: 0:204: '&' :  wrong operand types  no operation '&' exists that takes a left-hand operand of type 'highp float' and a right operand of type 'const float' (or there is no acceptable conversion)
ERROR: 0:206: '<<' : bit-wise operator supported in GLSL ES 3.00 only
ERROR: 0:206: '<<' :  wrong operand types  no operation '<<' exists that takes a left-hand operand of type 'highp float' and a right operand of type 'const float' (or there is no acceptable conversion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants