Skip to content

Instantly share code, notes, and snippets.

@greggman
Created September 24, 2021 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggman/34267b546d2a4568efeb90aa202e4006 to your computer and use it in GitHub Desktop.
Save greggman/34267b546d2a4568efeb90aa202e4006 to your computer and use it in GitHub Desktop.
check WebGL_multi_draw
/*bug-in-github-api-content-can-not-be-empty*/
/*bug-in-github-api-content-can-not-be-empty*/
import * as twgl from 'https://twgljs.org/dist/4.x/twgl-full.module.js';
const vs = `#version 300 es
#extension GL_ANGLE_multi_draw : require
uniform float foo;
uniform float moo;
void main() {
gl_Position = vec4(gl_DrawID, foo, moo, 1);
}
`;
const fs = `#version 300 es
precision highp float;
out vec4 outColor;
void main()
{
outColor = vec4(0, 1, 0, 1);
}`;
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl2');
const ext = gl.getExtension('WEBGL_multi_draw');
const programInfo = twgl.createProgramInfo(gl, [vs, fs]);
console.log(programInfo);
console.log(gl.getError());
{"name":"check WebGL_multi_draw","settings":{},"filenames":["index.html","index.css","index.js"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment