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

Dynamically fetch default FBO #1598

Merged
merged 1 commit into from
Nov 4, 2023
Merged

Conversation

heinezen
Copy link
Member

@heinezen heinezen commented Nov 4, 2023

Changes the default FBO ID from being hardcoded to fetching it every frame for the current context. This is necessary for platforms where the default FBO is not fixed to 0 and changes on a frame-by-frame basis, e.g. when using Wayland.

Fixes #1596

@heinezen heinezen added area: renderer Concerns our graphics renderer lang: c++ Done in C++ code bugfix Restores intended behavior labels Nov 4, 2023
Copy link
Member

@TheJJ TheJJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder why the framebuffer ids of the window may change - if it's because of dpi changes etc then it would have resize events at arbitrary time points, even after getting the current fbuf id. so i'd expect one has to acquire it and release it during draw?

@TheJJ TheJJ merged commit bd06a25 into SFTtech:master Nov 4, 2023
12 of 13 checks passed
@heinezen
Copy link
Member Author

heinezen commented Nov 4, 2023

@TheJJ I think this is a side effect of isolation. Looks like the used framebuffer is associated with the window surface and changes to the surface result in new framebuffers being used.

On some platforms (for instance, iOS) the default framebuffer object depends on the surface being rendered to, and might be different from 0. Thus, instead of calling glBindFramebuffer(0), you should call glBindFramebuffer(ctx->defaultFramebufferObject()) if you want your application to work across different Qt platforms.

https://doc.qt.io/qt-6/qopenglcontext.html#defaultFramebufferObject

@heinezen heinezen deleted the fix/qtwayland branch November 4, 2023 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer bugfix Restores intended behavior lang: c++ Done in C++ code
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

OpenGL error when launching on Wayland
2 participants