diff options
author | Jeroen Bakker <jbakker> | 2020-08-28 15:33:51 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-08-28 15:38:33 +0300 |
commit | 3198fec1fed525ee705e6945605723615958b292 (patch) | |
tree | f5acea2bf7af9cd4e2eb94b2bba9e475e9413846 | |
parent | df8e2c76c9f62c4359efcdcc5b3f0f430bfc3e6f (diff) |
Fix T80160: Workbench shadows are broken
In recent refactoring {a9f2ebb21508} an issue was introduced that the
opengl rasterizer would be disabled when only writing to a stencil
buffer.
This fix adds stencil writing to the write mask and set it. This makes
the write map not evaluate to GPU_WRITE_NONE and the rasterizer will be
enabled in `GLStateManager::set_write_mask`.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D8743
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 3 | ||||
-rw-r--r-- | source/blender/gpu/GPU_state.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index b3e1258ff7f..8a81b3db7d8 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -99,6 +99,9 @@ void drw_state_set(DRWState state) if (state & DRW_STATE_WRITE_COLOR) { write_mask |= GPU_WRITE_COLOR; } + if (state & DRW_STATE_WRITE_STENCIL_ENABLED) { + write_mask |= GPU_WRITE_STENCIL; + } switch (state & (DRW_STATE_CULL_BACK | DRW_STATE_CULL_FRONT)) { case DRW_STATE_CULL_BACK: diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h index e56df6d77a7..253877bcca0 100644 --- a/source/blender/gpu/GPU_state.h +++ b/source/blender/gpu/GPU_state.h @@ -29,6 +29,7 @@ typedef enum eGPUWriteMask { GPU_WRITE_BLUE = (1 << 2), GPU_WRITE_ALPHA = (1 << 3), GPU_WRITE_DEPTH = (1 << 4), + GPU_WRITE_STENCIL = (1 << 5), GPU_WRITE_COLOR = (GPU_WRITE_RED | GPU_WRITE_GREEN | GPU_WRITE_BLUE | GPU_WRITE_ALPHA), } eGPUWriteMask; |