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

WIP: OpenGL: use a single framebuffer instead of 1 per texture #2959

Closed
wants to merge 4 commits into from

Conversation

Zyko0
Copy link
Contributor

@Zyko0 Zyko0 commented Apr 9, 2024

What issue is this addressing?

No associated issue yet, related to: #2930 and #2953

What type of issue is this addressing?

Refactorization

What this PR does | solves

This PR uses a single framebuffer instead of creating a new one for each isolated texture for OpenGL.
This is a necessary step in order to introduce MRT, since a single framebuffer should be bound (itself containing the multiple destinations textures) for the MRT draw call.

Since a framebuffer represents a logical object, that is a group of buffers in openGL, it is not necessary to mark it with a size or create one for each texture, so it also should ease the internal logic hopefully!

Notes:

Edit: It's actually more recommended to swap framebuffers, instead of changing its state every frame (its color attachments). Also, I realized manipulating attachments this way introduced some complexity, and MRT can be introduced without this by using a dedicated framebuffer.

@Zyko0 Zyko0 changed the title Refactor/reduce fbo usage OpenGL: use a single framebuffer instead of 1 per texture Apr 9, 2024
@Zyko0 Zyko0 changed the title OpenGL: use a single framebuffer instead of 1 per texture WIP: OpenGL: use a single framebuffer instead of 1 per texture Apr 9, 2024
@hajimehoshi hajimehoshi marked this pull request as draft April 10, 2024 02:41
@Zyko0 Zyko0 closed this Apr 10, 2024
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

Successfully merging this pull request may close these issues.

None yet

1 participant