Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code on WEBGL_depth_texture gives GL_INVALID_VALUE when run in WebGL 2 #30130

Open
TeraV8 opened this issue Nov 8, 2023 · 1 comment

Comments

@TeraV8
Copy link

TeraV8 commented Nov 8, 2023

MDN URL

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

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

The example code calls

gl.texImage2D( gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, 512, 512, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null );

which will throw a gl.INVALID_VALUE.

What did you expect to see?

The code should be modified by replacing the first gl.DEPTH_COMPONENT with gl.DEPTH_COMPONENT16.

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

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@TeraV8 TeraV8 added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 8, 2023
@github-actions github-actions bot added Content:WebAPI Web API docs and removed Content:WebAPI Web API docs labels Nov 8, 2023
@pepelsbey
Copy link
Member

Hey! Thank you for bringing this up :) Unfortunately, I’m not a WebGL expert. But it seems to me that this extension is specific to WebGL 1.0 and mentioned in the spec with this value:

The texImage2D entry point is extended to accept the format parameter DEPTH_COMPONENT and DEPTH_STENCIL

Do you think you may get the error because you’re using WebGL 2.0? It would also help if you could bring the full code code sample to the issue.

@pepelsbey pepelsbey removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 14, 2023
@Josh-Cena Josh-Cena added the Content:WebAPI Web API docs label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants