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: INVALID_ENUM: framebufferTexture2D: invalid attachment #3659

Closed
lucasmerlin opened this issue Apr 8, 2023 · 2 comments
Closed

WebGL: INVALID_ENUM: framebufferTexture2D: invalid attachment #3659

lucasmerlin opened this issue Apr 8, 2023 · 2 comments
Labels
api: gles Issues with GLES or WebGL type: bug Something isn't working

Comments

@lucasmerlin
Copy link

lucasmerlin commented Apr 8, 2023

Description
I have two render passes, one occasionally renders something to different textures, and the other renders those textures on screen.

Running my app in chrome leads to the following error being logged almost every frame: WebGL: INVALID_OPERATION: drawElementsInstanced: no buffer is bound to enabled attribute
In safari the following is logged:
image

A couple of frames do succeed though, and render the expected output. I suspect in those frames, the render pass rendering to the texture was run.

Repro steps
I was able to create a reproduction for the WebGL: INVALID_ENUM: framebufferTexture2D: invalid attachment error from safari, which I hope is the root cause of the problem: https://github.com/lucasmerlin/invalid-attachment-reproduction

Running the code natively should show a red square on green background, running it in the browser shows nothing and in safari it logs the invalid attachment error.

Surface.rs contains code that renders the square to a texture and surface_view.rs contains code that displays the texture on screen.

Expected vs observed behavior
There should be no errors and the frame should render successfully.

Extra materials
A video of the issue in my app (once the first tile loads, the frames start to fail)
https://user-images.githubusercontent.com/8009393/230718617-54357603-c722-4e21-b15c-be040c066bda.mov

For reference, I also asked about this on matrix: https://matrix.to/#/!XFRnMvAfptAHthwBCx:matrix.org/$dSku7Ho_VLMf81jjr7w5mriD6wzeHY4FGvJISRSK7T8?via=matrix.org

Platform
I'm using MacOS, the error showed up in chrome, firefox and safari, although with different, or no error messages. Natively it runs fine.

@teoxoy teoxoy added type: bug Something isn't working api: gles Issues with GLES or WebGL labels Apr 24, 2023
@Azorlogh
Copy link
Contributor

Could you try again with wgpu 0.16?
I suspect there might be two different bugs here, and one of them might have been fixed by #3706

@lucasmerlin
Copy link
Author

Gave it a try, seems to be fixed now! Thank you!

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

3 participants