I tried to write a unit test that draws a single point with drawElements (obviously, this is not production), and have found that a count of at least 2, not 1, is required for it to render. I see offset and stride requirements in the spec, but nothing related to count.
For example, the following code doesn’t render the point:
var buffer = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 0]), gl.STATIC_DRAW); gl.drawElements(gl.POINTS, 1, _gl.UNSIGNED_SHORT, 0);
But the following drawElements does:
gl.drawElements(gl.POINTS, 2, _gl.UNSIGNED_SHORT, 0);
No GL errors are given. I tried with both unsigned byte and unsigned short on Chrome and Firefox with a Radeon HD 5870.
I have an easy workaround for my unit test, but wanted to see if I am missing something obvious.