google / node-gles

Apache License 2.0
324 stars 32 forks source link

Add ANGLE_instanced_arrays support #49

Closed AlexVestin closed 5 years ago

AlexVestin commented 5 years ago

Adds support for the instanced arrays extension


This change is Reviewable

AlexVestin commented 5 years ago

Actually, this throws a std::out_of_range atm, somehow I bypassed this in the js.

Seems to be something in the WEBGL_depth_texture

Running this code (using the current build from npm) fails

const nodeGles = require("node-gles");
const gl = nodeGles.binding.createWebGLRenderingContext();
gl.getExtension("WEBGL_depth_texture")

with

terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
Aborted (core dumped)

fails on requesting GL_CHROMIUM_depth_texture https://github.com/google/node-gles/blob/5ad78c53d002b78c27c2a562488f1043a80f8048/binding/webgl_extensions.cc#L802

I peeked at the ANGLE source and couldn't find any reference to GL_CHROMIUM_depth_texture, Maybe named ANGLE_depth_texture or OESL_depth_texture? However neither of those show up in the angle_requestable_extensions->LogExtensions();

Okay, so ANGLE_depth_texture was in gl_extensions->LogExtensions(); so I used that and it seems to work.

nkreeger commented 5 years ago

This looks great - thank you!

Can you please lint (I'll update dev instructions today)

$ yarn format
nkreeger commented 5 years ago

Thanks so much for these - I'll try and spin a build this afternoon.

AlexVestin commented 5 years ago

No problem! Excited to use the project :)