Skip to content

Instantly share code, notes, and snippets.

@greggman
Created Sep 24, 2021
Embed
What would you like to do?
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