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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-16 17:18:44 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-16 18:16:42 +0300
commitece72e15d5789bcb5e9a140131768863d724cff4 (patch)
tree9f6b7885312be62fb0640dbf65f2bae844f1b24f /source/blender/gpu/intern
parent49562da98d81a0a3d2a4c94b1138be9272587c91 (diff)
Preferences: remove OpenGL select method preference.
Deprecated GL_SELECT no longer works in OpenGL core profile, so there is no reason to have this.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_select.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index 1c0e7ed4c1c..1eae90ff2a5 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -26,8 +26,8 @@
/** \file blender/gpu/intern/gpu_select.c
* \ingroup gpu
*
- * Interface for accessing gpu-related methods for selection. The semantics will be
- * similar to glRenderMode(GL_SELECT) since the goal is to maintain compatibility.
+ * Interface for accessing gpu-related methods for selection. The semantics are
+ * similar to glRenderMode(GL_SELECT) from older OpenGL versions.
*/
#include <stdlib.h>
@@ -45,21 +45,17 @@
/* Internal algorithm used */
enum {
- /** GL_SELECT, legacy OpenGL selection */
- ALGO_GL_LEGACY = 1,
/** glBegin/EndQuery(GL_SAMPLES_PASSED... ), `gpu_select_query.c`
* Only sets 4th component (ID) correctly. */
- ALGO_GL_QUERY = 2,
+ ALGO_GL_QUERY = 1,
/** Read depth buffer for every drawing pass and extract depths, `gpu_select_pick.c`
* Only sets 4th component (ID) correctly. */
- ALGO_GL_PICK = 3,
+ ALGO_GL_PICK = 2,
};
typedef struct GPUSelectState {
/* To ignore selection id calls when not initialized */
bool select_is_active;
- /* flag to cache user preference for occlusion based selection */
- bool use_gpu_select;
/* mode of operation */
char mode;
/* internal algorithm for selection */
@@ -82,29 +78,16 @@ void GPU_select_begin(uint *buffer, uint bufsize, const rcti *input, char mode,
}
g_select_state.select_is_active = true;
- g_select_state.use_gpu_select = GPU_select_query_check_active();
g_select_state.mode = mode;
if (ELEM(g_select_state.mode, GPU_SELECT_PICK_ALL, GPU_SELECT_PICK_NEAREST)) {
g_select_state.algorithm = ALGO_GL_PICK;
}
- else if (!g_select_state.use_gpu_select) {
- g_select_state.algorithm = ALGO_GL_LEGACY;
- }
else {
g_select_state.algorithm = ALGO_GL_QUERY;
}
switch (g_select_state.algorithm) {
- case ALGO_GL_LEGACY:
- {
- g_select_state.use_cache = false;
- glSelectBuffer(bufsize, (GLuint *)buffer);
- glRenderMode(GL_SELECT);
- glInitNames();
- glPushName(-1);
- break;
- }
case ALGO_GL_QUERY:
{
g_select_state.use_cache = false;
@@ -133,11 +116,6 @@ bool GPU_select_load_id(uint id)
return true;
switch (g_select_state.algorithm) {
- case ALGO_GL_LEGACY:
- {
- glLoadName(id);
- return true;
- }
case ALGO_GL_QUERY:
{
return gpu_select_query_load_id(id);
@@ -159,12 +137,6 @@ uint GPU_select_end(void)
uint hits = 0;
switch (g_select_state.algorithm) {
- case ALGO_GL_LEGACY:
- {
- glPopName();
- hits = glRenderMode(GL_RENDER);
- break;
- }
case ALGO_GL_QUERY:
{
hits = gpu_select_query_end();
@@ -182,14 +154,6 @@ uint GPU_select_end(void)
return hits;
}
-/**
- * has user activated?
- */
-bool GPU_select_query_check_active(void)
-{
- return ELEM(U.gpu_select_method, USER_SELECT_USE_OCCLUSION_QUERY, USER_SELECT_AUTO);
-}
-
/* ----------------------------------------------------------------------------
* Caching
*