content icon indicating copy to clipboard operation
content copied to clipboard

Content bug: vertexAttribPointer: missing WebGL 2 types

Open scurest opened this issue 4 years ago • 1 comments

What page(s) did you find the problem on?

https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer

Specific page section or heading?

Syntax > Parameters > type

What is the problem?

Only the HALF_FLOAT type is noted to be added by WebGL 2

When using a WebGL 2 context, the following values are available additionally:

  • gl.HALF_FLOAT: 16-bit IEEE floating point number

However if you compare the ES 3.0 docs to the ES 2.0 ones, there are actually several more that were added:

  • gl.INT
  • gl.UNSIGNED_INT
  • gl.INT_2_10_10_10_REV
  • gl.UNSIGNED_INT_2_10_10_10_REV

ES 2.0 : https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glVertexAttribPointer.xml
ES 3.0 : https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glVertexAttribPointer.xhtml

What did you expect to see?

AFAIK, the types allowed in WebGL 2 should reflect the ES 3.0 docs (except FIXED).

Did you test this? If so, how?

I tested on Firefox 91/Linux. All of the types listed above did work. Here is a quick test with gl.INT_2_10_10_10_REV (you should see a rotating square).

scurest avatar Dec 05 '21 05:12 scurest

@dawei-wang please see comment at https://github.com/mdn/content/pull/22209#issuecomment-1309829749

sideshowbarker avatar Nov 10 '22 06:11 sideshowbarker