diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-17 19:08:47 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | 536c2e0ec916eb49c534b4937b36da278dbe2364 (patch) | |
tree | 87f955824a41094dfd9e4e015c776b86832ea22e /source/blender/gpu/intern/gpu_framebuffer.cc | |
parent | 482a51aabf596ca1f279ab3b7cb3170c867b4a42 (diff) |
GPUState: Only apply state before drawing
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 4c7f13a58eb..a94212969b9 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -622,6 +622,8 @@ void GPU_framebuffer_clear(GPUFrameBuffer *fb, { CHECK_FRAMEBUFFER_IS_BOUND(fb); + GPU_context_active_get()->state_manager->apply_state(); + if (buffers & GPU_COLOR_BIT) { glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glClearColor(clear_col[0], clear_col[1], clear_col[2], clear_col[3]); @@ -786,6 +788,8 @@ void GPU_framebuffer_blit(GPUFrameBuffer *fb_read, GLbitfield mask = convert_buffer_bits_to_gl(blit_buffers); + GPU_context_active_get()->state_manager->apply_state(); + glBlitFramebuffer(0, 0, fb_read->width, @@ -1043,6 +1047,8 @@ void GPU_offscreen_draw_to_screen(GPUOffScreen *ofs, int x, int y) const int w = GPU_texture_width(ofs->color); const int h = GPU_texture_height(ofs->color); + GPU_context_active_get()->state_manager->apply_state(); + GPUFrameBuffer *ofs_fb = gpu_offscreen_fb_get(ofs); glBindFramebuffer(GL_READ_FRAMEBUFFER, ofs_fb->object); @@ -1107,6 +1113,7 @@ void GPU_clear_depth(float depth) void GPU_clear(eGPUFrameBufferBits flags) { + GPU_context_active_get()->state_manager->apply_state(); glClear(convert_buffer_bits_to_gl(flags)); } |