diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-28 13:56:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-28 13:56:10 +0300 |
commit | dfcfc8ee950aea8dd941b8b6c43dc279922aef91 (patch) | |
tree | e25a13c998d7df8c6bd2b91d5399f2eaad8aef63 /source/blender/gpu/intern | |
parent | bf721fb6798bc21206e9e8b3c0f9b81e8ac9400f (diff) | |
parent | 8948f73784cb818689ba38aa9ae5008eb3c8290b (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_state.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index e7a160d1ea3..782d25747bb 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -344,6 +344,20 @@ void GPU_bgl_start() /* Expected by many addons (see T80169, T81289). * This will reset the blend function. */ GPU_blend(GPU_BLEND_NONE); + + /* Equivalent of setting the depth func `glDepthFunc(GL_LEQUAL)` + * Needed since Python scripts may enable depth test. + * Without this block the depth test function is undefined. */ + { + eGPUDepthTest depth_test_real = GPU_depth_test_get(); + eGPUDepthTest depth_test_temp = GPU_DEPTH_LESS_EQUAL; + if (depth_test_real != depth_test_temp) { + GPU_depth_test(depth_test_temp); + state_manager.apply_state(); + GPU_depth_test(depth_test_real); + } + } + state_manager.apply_state(); state_manager.use_bgl = true; } |