Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-17 19:08:47 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 22:30:10 +0300
commit536c2e0ec916eb49c534b4937b36da278dbe2364 (patch)
tree87f955824a41094dfd9e4e015c776b86832ea22e /source/blender/gpu/opengl
parent482a51aabf596ca1f279ab3b7cb3170c867b4a42 (diff)
GPUState: Only apply state before drawing
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc2
-rw-r--r--source/blender/gpu/opengl/gl_state.cc3
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 {