Note: This feature is available in Web Workers.
The WebGL2RenderingContext.getFragDataLocation() method of the WebGL 2 API returns the binding of color numbers to user-defined varying out variables.
getFragDataLocation(program, name)programA WebGLProgram to query.
nameA string specifying the name of the user-defined varying out variable.
A GLint indicating the assigned color number binding, or -1 otherwise.
// program is a linked WebGLProgram
gl.getFragDataLocation(program, "fragColor");