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-25 13:15:15 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-25 16:02:34 +0300
commite51c428be64feef0877a957b483aa71e5753b29c (patch)
treeff37a101ca533674a474025acab673bb64f969d0 /source/blender/gpu/intern
parent5f86a104775be51e216c40efe1bd69c3e35f49e7 (diff)
GPUSelect: Avoid assert caused by clearing without a depth mask
This should not cause any problem since the depth test is required in order to draw to the depth buffer and this is not altered by this change. To be on the safe side, we still restor the mask after altering it.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_select_pick.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index 5ee97134015..c3ccb68a998 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -518,8 +518,13 @@ bool gpu_select_pick_load_id(uint id, bool end)
SWAP(DepthBufCache *, ps->gl.rect_depth, ps->gl.rect_depth_test);
if (g_pick_state.mode == GPU_SELECT_PICK_ALL) {
+ /* (fclem) This is to be on the safe side. I don't know if this is required. */
+ bool prev_depth_mask = GPU_depth_mask_get();
/* we want new depths every time */
+ GPU_depth_mask(true);
GPU_clear_depth(1.0f);
+
+ GPU_depth_mask(prev_depth_mask);
}
}
}