mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.16k stars 22.46k forks source link

WebGL2RenderingContext»texSubImage3D page: List of valid "format" parameter values does not match WebGL2 spec #19610

Closed JohnGrime closed 3 months ago

JohnGrime commented 2 years ago

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D

What specific section or headline is this issue about?

Parameters

What information was incorrect, unhelpful, or incomplete?

The "Parameters" section of the WebGL2RenderingContext.texSubImage3D() documentation appears to list values that do not agree with the documentation provided by Khronos. They also do not seem to agree with the values linked via the "WebGL 2.0 Specification 3.7.6" link under the "Specifications" section.

For example, Tables 1 & 2 of the glTexImage3D() method (indicated as the authoritative source of information regarding the legal combinations of the format and type parameters for WebGL2's texSubImage3D() method) include format values of e.g. GL_RED and GL_RED_INTEGER that are not listed in the MDN documentation for this method.

Furthermore, the MDN documentation claims that gl.R8, gl.R16F, gl.R32F etc are valid format parameters - but these values are not listed as valid format parameters by Khronos. Indeed, trying to use gl.R8 as a format parameter with a type parameter of gl.UNSIGNED_BYTE and uint8 source data produced the following error in Chrome:

WebGL: INVALID_ENUM: texSubImage3D: invalid format

... but using gl.RED_INTEGER (as per the Khronos specifications) fixed that error message.

What did you expect to see?

Values for format that agree with the Khronos documentation for this method.

Do you have any supporting links, references, or citations?

Khronos documentation for texSubImage3D : https://registry.khronos.org/webgl/specs/latest/2.0/#3.7.6

The documentation above links to the Khronos documentation for Tables 1 & 2 of the glTexImage3D() documentation:

https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage3D.xhtml

These tables contain the "valid" values (and their combinations) for the format and type parameters of texSubImage3D().

Do you have anything more you want to share?

No response

MDN metadata

Page report details * Folder: `en-us/web/api/webgl2renderingcontext/texsubimage3d` * MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/webgl2renderingcontext/texsubimage3d/index.md * Last commit: https://github.com/mdn/content/commit/3381c87b92394ef5c68b72d40367d93c796e0870 * Document last modified: 2022-07-28T09:27:35.000Z
Josh-Cena commented 3 months ago

This is a duplicate of https://github.com/mdn/content/issues/32524. Since that one is more up to date and contains more discussions, I'll close this as a duplicate. Please comment there if there's any more context to share.