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/opengl | |
parent | 482a51aabf596ca1f279ab3b7cb3170c867b4a42 (diff) |
GPUState: Only apply state before drawing
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r-- | source/blender/gpu/opengl/gl_batch.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_state.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc index f1cbb2c10d5..fade8763065 100644 --- a/source/blender/gpu/opengl/gl_batch.cc +++ b/source/blender/gpu/opengl/gl_batch.cc @@ -300,6 +300,8 @@ GLBatch::~GLBatch() void GLBatch::bind(int i_first) { + GPU_context_active_get()->state_manager->apply_state(); + if (flag & GPU_BATCH_DIRTY) { vao_cache_.clear(); } diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc index f4360f51527..5274a86ebe5 100644 --- a/source/blender/gpu/opengl/gl_state.cc +++ b/source/blender/gpu/opengl/gl_state.cc @@ -102,9 +102,8 @@ void GLStateManager::set_mutable_state(const GPUStateMutable &state) if ((changed.scissor_rect[0] != 0) || (changed.scissor_rect[1] != 0) || (changed.scissor_rect[2] != 0) || (changed.scissor_rect[3] != 0)) { - glScissor(UNPACK4(state.scissor_rect)); - if ((state.scissor_rect[2] > 0)) { + glScissor(UNPACK4(state.scissor_rect)); glEnable(GL_SCISSOR_TEST); } else { |