[Bf-blender-cvs] [bf6b875a20] temp-select-pick: Minor tweaks

Campbell Barton noreply at git.blender.org
Mon Mar 6 08:41:43 CET 2017


Commit: bf6b875a20612d1847b90cc9da0694ef3dcc094f
Author: Campbell Barton
Date:   Fri Mar 3 22:58:56 2017 +1100
Branches: temp-select-pick
https://developer.blender.org/rBbf6b875a20612d1847b90cc9da0694ef3dcc094f

Minor tweaks

===================================================================

M	source/blender/gpu/intern/gpu_select.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index 88826897fd..8e822504bb 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -105,8 +105,6 @@ typedef struct GPUQueryStateDepth {
 } GPUQueryStateDepth;
 
 typedef struct GPUQueryState {
-	GPUQueryStateDepth depth;
-
 	/* To ignore selection id calls when not initialized */
 	bool select_is_active;
 	/* Tracks whether a query has been issued so that gpu_load_id can end the previous one */
@@ -129,6 +127,8 @@ typedef struct GPUQueryState {
 	char mode;
 	unsigned int index;
 	int oldhits;
+
+	GPUQueryStateDepth depth;
 } GPUQueryState;
 
 static GPUQueryState g_query_state = {0};
@@ -149,7 +149,6 @@ void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const rctf *in
 	g_query_state.index = 0;
 	g_query_state.oldhits = oldhits;
 
-
 	if (!g_query_state.use_gpu_select) {
 		glSelectBuffer(bufsize, (GLuint *)buffer);
 		glRenderMode(GL_SELECT);
@@ -188,12 +187,12 @@ void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const rctf *in
 		qsd->rect_id = MEM_mallocN(sizeof(unsigned int) * rect_len, __func__);
 		memset(qsd->rect_id, 0xff, sizeof(unsigned int) * rect_len);
 
-		qsd->rect_depth = MEM_callocN(sizeof(unsigned int) * rect_len, __func__);
+		qsd->rect_depth = MEM_mallocN(sizeof(unsigned int) * rect_len, __func__);
 
 		glReadPixels(UNPACK4(qsd->clip_readpixels), GL_DEPTH_COMPONENT, GL_FLOAT, qsd->rect_depth);
 
 		/* scratch buffer (read new values here) */
-		qsd->rect_depth_test = MEM_callocN(sizeof(unsigned int) * rect_len, __func__);
+		qsd->rect_depth_test = MEM_mallocN(sizeof(unsigned int) * rect_len, __func__);
 
 		qsd->prev_id = 0;
 		qsd->is_init = false;




More information about the Bf-blender-cvs mailing list