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-16 21:56:39 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 22:30:10 +0300
commitf30df15edc0b5bfce98809cfa8c2ca96cfe03e97 (patch)
tree3b5fb309ed8a39e64a576cc6631d2866ca5318ac /source/blender/gpu/opengl/gl_state.cc
parent298329554a5a0ae40bc4a64ca9c1490d22edc947 (diff)
GPUState: Make use of GPUStateStack class
This isolate most GL calls to the GL backend. Still a few remains.
Diffstat (limited to 'source/blender/gpu/opengl/gl_state.cc')
-rw-r--r--source/blender/gpu/opengl/gl_state.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc
index c64e4471087..32bc66c4dda 100644
--- a/source/blender/gpu/opengl/gl_state.cc
+++ b/source/blender/gpu/opengl/gl_state.cc
@@ -41,6 +41,9 @@ void GLStateStack::set_state(GPUState &state)
{
GPUState changed = state ^ current_;
+ if (changed.blend != 0) {
+ set_blend(state.blend);
+ }
if (changed.write_mask != 0) {
set_write_mask(state.write_mask);
}
@@ -101,10 +104,7 @@ void GLStateStack::set_mutable_state(GPUStateMutable &state)
(changed.scissor_rect[2] != 0) || (changed.scissor_rect[3] != 0)) {
glScissor(UNPACK4(state.scissor_rect));
- if ((state.scissor_rect[0] != state.viewport_rect[0]) ||
- (state.scissor_rect[1] != state.viewport_rect[1]) ||
- (state.scissor_rect[2] != state.viewport_rect[2]) ||
- (state.scissor_rect[3] != state.viewport_rect[3])) {
+ if ((state.scissor_rect[2] > 0)) {
glEnable(GL_SCISSOR_TEST);
}
else {