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

webgl backend uses invalid glow::BGRA constant #3583

Open
Tracked by #3674
Aaron1011 opened this issue Mar 13, 2023 · 0 comments
Open
Tracked by #3674

webgl backend uses invalid glow::BGRA constant #3583

Aaron1011 opened this issue Mar 13, 2023 · 0 comments
Labels
api: gles Issues with GLES or WebGL type: bug Something isn't working

Comments

@Aaron1011
Copy link
Contributor

Description
On web, attempting to create a texture with TextureFormat::Bgra8Unorm will result in wgpu attempting to call glTexSubImage2D with glow::BGRA:

Tf::Bgra8Unorm => (glow::RGBA8, glow::BGRA, glow::UNSIGNED_BYTE), //TODO?

However, the MDN documents don't list this as a valid format value: https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D

On Chrome, this logs WebGL: INVALID_ENUM: texSubImage2D: invalid format to the console

Repro steps
Create a texture with TextureFormat::Bgra8Unorm on the webgl backend.

Expected vs observed behavior

wgpu should produce a validation error when attempting to create a texture with a format that the backend doesn't support (e.g. Bgra8Unorm on webgl). Currently, no indication is given to Rust code that the texture creation failed.

Extra materials

Platform
wgpu v0.15.1

@teoxoy teoxoy added type: bug Something isn't working api: gles Issues with GLES or WebGL labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: gles Issues with GLES or WebGL type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants