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

Can't use backend.buffer_age() on winit due to new bind() borrowing requirements #1672

Open
YaLTeR opened this issue Mar 10, 2025 · 4 comments

Comments

@YaLTeR
Copy link
Contributor

YaLTeR commented Mar 10, 2025

df08c6f made bind() mutably borrow the backend, making it impossible to get backend.buffer_age() while it is bound. However, when the backend is not bound, buffer_age() returns None. So effectively you can't use the buffer age on winit currently.

@Drakulix
Copy link
Member

I think it actually is possible, since the Renderer doesn't unbind when finishing a Frame, but that is still a super ackward api.

@YaLTeR
Copy link
Contributor Author

YaLTeR commented Mar 10, 2025

If I'm not mistaken, GlesTarget unbinds on Drop, and it is one of the things borrowing the backend from bind(). So I'm not sure it's possible

@Drakulix
Copy link
Member

Drakulix commented Mar 10, 2025

If I'm not mistaken, GlesTarget unbinds on Drop, and it is one of the things borrowing the backend from bind(). So I'm not sure it's possible

No, I am pretty sure it doesn't. It destroys framebuffer objects, but it doesn't call unbind to save instructions, if the user just binds the same framebuffer again next cycle.

@Drakulix
Copy link
Member

#1673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants