[Bf-blender-cvs] [74ac91d511c] temp-select-pick: Minor cleanup
Campbell Barton
noreply at git.blender.org
Wed Mar 8 19:43:50 CET 2017
Commit: 74ac91d511cd6c034df90d40e1a6edb2266451ca
Author: Campbell Barton
Date: Thu Mar 9 05:46:37 2017 +1100
Branches: temp-select-pick
https://developer.blender.org/rB74ac91d511cd6c034df90d40e1a6edb2266451ca
Minor cleanup
===================================================================
M source/blender/gpu/intern/gpu_select_pick.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index 19c430a0f1d..31f82fd002d 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -34,16 +34,12 @@
#include "GPU_select.h"
#include "GPU_extensions.h"
#include "GPU_glew.h"
-#include "GPU_debug.h"
#include "MEM_guardedalloc.h"
#include "BLI_rect.h"
-
#include "BLI_listbase.h"
-
#include "BLI_math_vector.h"
-
#include "BLI_utildefines.h"
#include "gpu_select_private.h"
@@ -303,16 +299,13 @@ void gpu_select_pick_begin(
/* disable writing to the framebuffer */
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-
- /* Without this orthographic mode doesn't give enough precision between objects */
glEnable(GL_DEPTH_TEST);
+ glDepthMask(GL_TRUE);
if (mode == GPU_SELECT_PICK_ALL) {
- glDepthMask(GL_TRUE);
- glDepthFunc(GL_NOTEQUAL);
+ glDepthFunc(GL_ALWAYS);
}
else {
- glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
}
@@ -336,7 +329,6 @@ void gpu_select_pick_begin(
/* It's possible we don't want to clear depth buffer,
* so existing elements are masked by current z-buffer. */
glClear(GL_DEPTH_BUFFER_BIT);
- /* glClearDepth((float)DEPTH_MAX); */
/* scratch buffer (read new values here) */
ps->gl.rect_depth_test = depth_buf_malloc(rect_len);
@@ -344,9 +336,7 @@ void gpu_select_pick_begin(
/* set initial 'far' value */
#if 0
- GPU_ASSERT_NO_GL_ERRORS(__func__);
glReadPixels(UNPACK4(ps->gl.clip_readpixels), GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, ps->gl.rect_depth->buf);
- GPU_ASSERT_NO_GL_ERRORS(__func__);
#else
for (unsigned int i = 0; i < rect_len; i++) {
ps->gl.rect_depth->buf[i] = DEPTH_MAX;
@@ -470,9 +460,7 @@ bool gpu_select_pick_load_id(unsigned int id)
GPUPickState *ps = &g_pick_state;
if (ps->gl.is_init) {
const unsigned int rect_len = ps->src.rect_len;
- GPU_ASSERT_NO_GL_ERRORS(__func__);
glReadPixels(UNPACK4(ps->gl.clip_readpixels), GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, ps->gl.rect_depth_test->buf);
- GPU_ASSERT_NO_GL_ERRORS(__func__);
/* perform initial check since most cases the array remains unchanged */
bool do_pass = false;
More information about the Bf-blender-cvs
mailing list