GPU_select: remove unused finalize function
authorCampbell Barton <ideasman42@gmail.com>
Thu, 1 Mar 2018 05:41:50 +0000 (16:41 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 1 Mar 2018 05:43:45 +0000 (16:43 +1100)
Changed 2.8x code so this is no longer needed.

source/blender/gpu/intern/gpu_select.c
source/blender/gpu/intern/gpu_select_pick.c
source/blender/gpu/intern/gpu_select_private.h

index ff377ac703a34f11348c248063a1e68dc776db61..291a552a041ee4d19ff0cd9553c4e5d75f938844 100644 (file)
@@ -149,29 +149,6 @@ bool GPU_select_load_id(uint id)
        }
 }
 
-/**
- * Needed when GL context of #GPU_select_end
- * can't be used to finalize selection operations
- * (because of context changes).
- */
-void GPU_select_finalize(void)
-{
-       if (!g_select_state.select_is_active)
-               return;
-
-       switch (g_select_state.algorithm) {
-               case ALGO_GL_LEGACY:
-               case ALGO_GL_QUERY:
-               {
-                       break;
-               }
-               default:  /* ALGO_GL_PICK */
-               {
-                       gpu_select_pick_finalize();
-               }
-       }
-}
-
 /**
  * Cleanup and flush selection results to buffer.
  * Return number of hits and hits in buffer.
index 703035483dd14325215fd0187da9a39290f02df7..3e65e2987e6e87ee786ef04a0c68a6194654f8be 100644 (file)
@@ -255,7 +255,6 @@ typedef struct GPUPickState {
 
                /* Set after first draw */
                bool is_init;
-               bool is_finalized;
                uint prev_id;
        } gl;
 
@@ -370,7 +369,6 @@ void gpu_select_pick_begin(
 #endif
 
                ps->gl.is_init = false;
-               ps->gl.is_finalized = false;
                ps->gl.prev_id = 0;
        }
        else {
@@ -531,20 +529,6 @@ bool gpu_select_pick_load_id(uint id)
        return true;
 }
 
- /**
-  * (Optional), call before 'gpu_select_pick_end' if GL context is not kept.
-  * is not compatible with regular select case.
-  * */
-void gpu_select_pick_finalize(void)
-{
-       GPUPickState *ps = &g_pick_state;
-       if (ps->gl.is_init) {
-               /* force finishing last pass */
-               gpu_select_pick_load_id(ps->gl.prev_id);
-       }
-       ps->gl.is_finalized = true;
-}
-
 uint gpu_select_pick_end(void)
 {
        GPUPickState *ps = &g_pick_state;
@@ -554,10 +538,10 @@ uint gpu_select_pick_end(void)
 #endif
 
        if (ps->is_cached == false) {
-               if (ps->gl.is_finalized == false) {
-                       gpu_select_pick_finalize();
+               if (ps->gl.is_init) {
+                       /* force finishing last pass */
+                       gpu_select_pick_load_id(ps->gl.prev_id);
                }
-
                glPopAttrib();
                glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
        }
index 8368aaa9edcc5a71b9337400ee94cd21e465a9d6..8935bd7b25326b5799f09185f5a90e1e31a7246b 100644 (file)
@@ -35,7 +35,6 @@
 /* gpu_select_pick */
 void gpu_select_pick_begin(unsigned int (*buffer)[4], unsigned int bufsize, const rcti *input, char mode);
 bool gpu_select_pick_load_id(unsigned int id);
-void gpu_select_pick_finalize(void);
 unsigned int gpu_select_pick_end(void);
 
 void gpu_select_pick_cache_begin(void);