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:11:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 22:30:10 +0300
commita9f2ebb215084debae70099b3d2e58195d9a9e32 (patch)
tree839b142dc49f8d6727a4d6e076a6227ea2e573d2 /source/blender/gpu/opengl/gl_state.cc
parent536c2e0ec916eb49c534b4937b36da278dbe2364 (diff)
Cleanup: DRW: Use GPUState instead of raw opengl calls
Should not break anything! Huh!
Diffstat (limited to 'source/blender/gpu/opengl/gl_state.cc')
-rw-r--r--source/blender/gpu/opengl/gl_state.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc
index 5274a86ebe5..f85fb804317 100644
--- a/source/blender/gpu/opengl/gl_state.cc
+++ b/source/blender/gpu/opengl/gl_state.cc
@@ -153,6 +153,13 @@ void GLStateManager::set_write_mask(const eGPUWriteMask value)
(value & GPU_WRITE_GREEN) != 0,
(value & GPU_WRITE_BLUE) != 0,
(value & GPU_WRITE_ALPHA) != 0);
+
+ if (value == GPU_WRITE_NONE) {
+ glEnable(GL_RASTERIZER_DISCARD);
+ }
+ else {
+ glDisable(GL_RASTERIZER_DISCARD);
+ }
}
void GLStateManager::set_depth_test(const eGPUDepthTest value)