diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-29 02:13:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-30 14:11:02 +0300 |
commit | f3a65a1b4aa3c7da221acdbeee20afb7ebe3b221 (patch) | |
tree | 1b7b8c90ef0ecb891b35c8fa89cf25873035d784 /source/blender/gpu/intern/gpu_context_private.hh | |
parent | 0850afb34e21c073eb2a4c7475eeab2684f30e43 (diff) |
GPUFrameBuffer: GL backend isolation
This is related to the Vulkan port T68990.
This is a full cleanup of the Framebuffer module and a separation
of OpenGL related functions.
There is some changes with how the default framebuffers are handled.
Now the default framebuffers are individually wrapped inside special
GLFrameBuffers. This make it easier to keep track of the currently bound
framebuffer state and have some specificity for operations on these
framebuffers.
Another change is dropping the optimisation of only configuring the
changed attachements during framebuffers update. This does not give
any benefits and add some complexity to the code. This might be brought
back if it has a performance impact on some systems.
This also adds support for naming framebuffers but it is currently not
used.
Diffstat (limited to 'source/blender/gpu/intern/gpu_context_private.hh')
-rw-r--r-- | source/blender/gpu/intern/gpu_context_private.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh index d18d18dc97b..664f4e2f676 100644 --- a/source/blender/gpu/intern/gpu_context_private.hh +++ b/source/blender/gpu/intern/gpu_context_private.hh @@ -49,6 +49,18 @@ struct GPUContext { GPUMatrixState *matrix_state = NULL; blender::gpu::GPUStateManager *state_manager = NULL; + /** + * All 4 window framebuffers. + * None of them are valid in an offscreen context. + * Right framebuffers are only available if using stereo rendering. + * Front framebuffers contains (in principle, but not always) the last frame color. + * Default framebuffer is back_left. + */ + blender::gpu::FrameBuffer *back_left = NULL; + blender::gpu::FrameBuffer *front_left = NULL; + blender::gpu::FrameBuffer *back_right = NULL; + blender::gpu::FrameBuffer *front_right = NULL; + protected: /** Thread on which this context is active. */ pthread_t thread_; |