diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-29 16:17:13 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-30 14:11:03 +0300 |
commit | 8527d84d3588563123bfad7ccbdeeff62ee90bdb (patch) | |
tree | 51ccbaa3c129c62a54af5aed43b55b9c89b901e6 /source/blender/gpu/opengl/gl_framebuffer.hh | |
parent | 4f395c84fe9f05b59b81be36b464521bcf92331e (diff) |
GPUState: Move Scissor and Viewport state to framebuffer
This way it is way clearer what each viewport state is. There is
no more save and reset. The scissor test is also saved per
framebuffer.
The only rule to remember is that the viewport state (size and
origin) is reset for both the viewport and scissor when a texture
is attached or detached from an attachment slot.
Diffstat (limited to 'source/blender/gpu/opengl/gl_framebuffer.hh')
-rw-r--r-- | source/blender/gpu/opengl/gl_framebuffer.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_framebuffer.hh b/source/blender/gpu/opengl/gl_framebuffer.hh index a83bc1f6cae..8d386116159 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.hh +++ b/source/blender/gpu/opengl/gl_framebuffer.hh @@ -33,6 +33,8 @@ namespace blender::gpu { +class GLStateManager; + /** * Implementation of FrameBuffer object using OpenGL. **/ @@ -42,6 +44,8 @@ class GLFrameBuffer : public FrameBuffer { GLuint fbo_id_ = 0; /** Context the handle is from. Framebuffers are not shared accros contexts. */ GLContext *context_ = NULL; + /** State Manager of the same contexts. */ + GLStateManager *state_manager_ = NULL; /** Copy of the GL state. Contains ONLY color attachments enums for slot binding. */ GLenum gl_attachments_[GPU_FB_MAX_COLOR_ATTACHMENT]; /** Internal framebuffers are immutable. */ @@ -92,6 +96,8 @@ class GLFrameBuffer : public FrameBuffer { int dst_offset_x, int dst_offset_y) override; + void apply_state(void); + private: void init(void); void update_attachments(void); |