Note: This feature is available in Web Workers.
The WebGL2RenderingContext.bindSampler() method of the WebGL 2 API binds a passed WebGLSampler object to the texture unit at the passed index.
bindSampler(unit, sampler)unitA GLuint specifying the index of the texture unit to which to bind the sampler to.
samplerA WebGLSampler object to bind.
None (undefined).
const sampler = gl.createSampler();
gl.bindSampler(0, sampler);