mdn / content

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

compressedTexImage2D does not support a form with 6 arguments #33026

Open brianchirls opened 5 months ago

brianchirls commented 5 months ago

MDN URL

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

What specific section or headline is this issue about?

Syntax

What information was incorrect, unhelpful, or incomplete?

This document claims that the following form is acceptable:

compressedTexImage2D(target, level, internalformat, width, height, border)

However, the WebGL 1.0 specification describes no such form, and use of this form throws the following error in Chrome:

Failed to execute 'compressedTexImage2D' on 'WebGLRenderingContext': 7 arguments required, but only 6 present.

In Safari:

no version of function 'compressedTexImage2D' takes 6 arguments

What did you expect to see?

This line should be removed.

I don't know if there's a way to allocate a compressed mip level without providing data. If there is, it would be great to know what that is. If not, it should be noted here that this works differently than texImage2D for uncompressed data.

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

WebGL 1.0 specification

Note that the analogous entry for texImage2D has a question mark on the pixels argument, as if to imply that it's optional.

Do you have anything more you want to share?

For context, I'm trying to meet the texture completeness requirement for a cube map that does not provide all levels. WebGL 2 supports min and max mip level values, but WebGL 1 does not, so I have to define all the levels individually.

See: https://www.khronos.org/opengl/wiki/Texture#Texture_completeness

MDN metadata

Page report details * Folder: `en-us/web/api/webglrenderingcontext/compressedteximage2d` * MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/compressedTexImage2D * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/webglrenderingcontext/compressedteximage2d/index.md * Last commit: https://github.com/mdn/content/commit/acfe8c9f1f4145f77653a2bc64a9744b001358dc * Document last modified: 2023-07-07T07:19:19.000Z
bsmth commented 5 months ago

Hi there, thanks for reporting. This looks familiar, I'd like to link some related issues and PRs initially: