OpenGL: clean up use of old extensions
authorMike Erwin <significant.bit@gmail.com>
Tue, 24 Nov 2015 07:20:38 +0000 (02:20 -0500)
committerMike Erwin <significant.bit@gmail.com>
Tue, 24 Nov 2015 07:21:07 +0000 (02:21 -0500)
15 files changed:
intern/cycles/device/device_cuda.cpp
release/scripts/startup/bl_ui/space_userpref.py
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/gpu/GPU_extensions.h
source/blender/gpu/GPU_select.h
source/blender/gpu/intern/gpu_compositing.c
source/blender/gpu/intern/gpu_debug.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_select.c
source/blender/makesrna/intern/rna_userdef.c

index ea023b4af66463841e96850b4efb5721b479dec7..eea82b1f102d90714907da767dec7daed436812c 100644 (file)
@@ -928,13 +928,13 @@ public:
                        else
                                offset *= sizeof(uint8_t);
 
-                       glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pmem.cuPBO);
+                       glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pmem.cuPBO);
                        glBindTexture(GL_TEXTURE_2D, pmem.cuTexId);
                        if(mem.data_type == TYPE_HALF)
                                glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_HALF_FLOAT, (void*)offset);
                        else
                                glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, (void*)offset);
-                       glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
+                       glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
                        
                        glEnable(GL_TEXTURE_2D);
                        
index cb8c35176b557e2bc626d78ad7aa6e608edc222c..d8b033b94e36b070a2644e9b43b00a36db442e3e 100644 (file)
@@ -451,10 +451,9 @@ class USERPREF_PT_system(Panel):
         col.prop(system, "use_gpu_mipmap")
         col.prop(system, "use_16bit_textures")
 
-        if system.is_occlusion_query_supported():
-            col.separator()
-            col.label(text="Selection")
-            col.prop(system, "select_method", text="")
+        col.separator()
+        col.label(text="Selection")
+        col.prop(system, "select_method", text="")
 
         col.separator()
 
index 0c10a40e4324200a932662a492a0e4a02bee240a..c705c7adedbeab734660c61fcb06d74efc4280cf 100644 (file)
@@ -3431,7 +3431,7 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert,
                if (attribs->orco.gl_texco)
                        glTexCoord3fv(orco);
                else
-                       glVertexAttrib3fvARB(attribs->orco.gl_index, orco);
+                       glVertexAttrib3fv(attribs->orco.gl_index, orco);
        }
 
        /* uv texture coordinates */
@@ -3449,7 +3449,7 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert,
                if (attribs->tface[b].gl_texco)
                        glTexCoord2fv(uv);
                else
-                       glVertexAttrib2fvARB(attribs->tface[b].gl_index, uv);
+                       glVertexAttrib2fv(attribs->tface[b].gl_index, uv);
        }
 
        /* vertex colors */
@@ -3464,14 +3464,14 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert,
                        col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
                }
 
-               glVertexAttrib4ubvARB(attribs->mcol[b].gl_index, col);
+               glVertexAttrib4ubv(attribs->mcol[b].gl_index, col);
        }
 
        /* tangent for normal mapping */
        if (attribs->tottang) {
                /*const*/ float (*array)[4] = attribs->tang.array;
                const float *tang = (array) ? array[loop] : zero;
-               glVertexAttrib4fvARB(attribs->tang.gl_index, tang);
+               glVertexAttrib4fv(attribs->tang.gl_index, tang);
        }
 }
 
index 88ae279050c7465f9561eb8ffc7442f88b0fd678..7fd241eb8e39bf845a6749172f2743dca690de9c 100644 (file)
@@ -1226,7 +1226,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
                if (attribs->orco.gl_texco)
                        glTexCoord3fv(orco);
                else
-                       glVertexAttrib3fvARB(attribs->orco.gl_index, orco);
+                       glVertexAttrib3fv(attribs->orco.gl_index, orco);
        }
        for (i = 0; i < attribs->tottface; i++) {
                const float *uv;
@@ -1242,7 +1242,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
                if (attribs->tface[i].gl_texco)
                        glTexCoord2fv(uv);
                else
-                       glVertexAttrib2fvARB(attribs->tface[i].gl_index, uv);
+                       glVertexAttrib2fv(attribs->tface[i].gl_index, uv);
        }
        for (i = 0; i < attribs->totmcol; i++) {
                GLubyte col[4];
@@ -1253,7 +1253,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
                else {
                        col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
                }
-               glVertexAttrib4ubvARB(attribs->mcol[i].gl_index, col);
+               glVertexAttrib4ubv(attribs->mcol[i].gl_index, col);
        }
        if (attribs->tottang) {
                const float *tang;
@@ -1263,7 +1263,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
                else {
                        tang = zero;
                }
-               glVertexAttrib4fvARB(attribs->tang.gl_index, tang);
+               glVertexAttrib4fv(attribs->tang.gl_index, tang);
        }
 }
 
index 5ad8acb46ab715fbcff82d585f0ae4bc3cf5f49a..e03273aa474a6620cc9130b6cae3c03ec4e3a26d 100644 (file)
@@ -1344,9 +1344,9 @@ void UI_block_draw(const bContext *C, uiBlock *block)
                UI_block_end(C, block);
 
        /* disable AA, makes widgets too blurry */
-       multisample_enabled = glIsEnabled(GL_MULTISAMPLE_ARB);
+       multisample_enabled = glIsEnabled(GL_MULTISAMPLE);
        if (multisample_enabled)
-               glDisable(GL_MULTISAMPLE_ARB);
+               glDisable(GL_MULTISAMPLE);
 
        /* we set this only once */
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1396,7 +1396,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
        glPopMatrix();
 
        if (multisample_enabled)
-               glEnable(GL_MULTISAMPLE_ARB);
+               glEnable(GL_MULTISAMPLE);
        
        ui_draw_links(block);
 }
index f394240c4110f3e10a2db0769987163b6185cd65..3a24625c36cecef77ce530f36af56b3198aaeb75 100644 (file)
@@ -238,9 +238,9 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
        int i, multisample_enabled;
 
        /* disable AA, makes widgets too blurry */
-       multisample_enabled = glIsEnabled(GL_MULTISAMPLE_ARB);
+       multisample_enabled = glIsEnabled(GL_MULTISAMPLE);
        if (multisample_enabled)
-               glDisable(GL_MULTISAMPLE_ARB);
+               glDisable(GL_MULTISAMPLE);
 
        wmOrtho2_region_ui(ar);
 
@@ -342,7 +342,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
        BLF_disable(blf_mono_font, BLF_WORD_WRAP);
 
        if (multisample_enabled)
-               glEnable(GL_MULTISAMPLE_ARB);
+               glEnable(GL_MULTISAMPLE);
 }
 
 static void ui_tooltip_region_free_cb(ARegion *ar)
index 7079ad04a8baf23cbf48d44ab664d916e291cc4b..784c7bef7f77f3e30ec88eb3f7e36b68fdd50efe 100644 (file)
@@ -1360,9 +1360,9 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
        /* dithering and AA break color coding, so disable */
        glDisable(GL_DITHER);
 
-       multisample_enabled = glIsEnabled(GL_MULTISAMPLE_ARB);
+       multisample_enabled = glIsEnabled(GL_MULTISAMPLE);
        if (multisample_enabled)
-               glDisable(GL_MULTISAMPLE_ARB);
+               glDisable(GL_MULTISAMPLE);
 
        if (U.ogl_multisamples != USER_MULTISAMPLE_NONE) {
                /* for multisample we use an offscreen FBO. multisample drawing can fail
@@ -1424,7 +1424,7 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
        glDisable(GL_DEPTH_TEST);
        glEnable(GL_DITHER);
        if (multisample_enabled)
-               glEnable(GL_MULTISAMPLE_ARB);
+               glEnable(GL_MULTISAMPLE);
 
        if (rv3d->rflag & RV3D_CLIPPING)
                ED_view3d_clipping_disable();
@@ -3886,7 +3886,7 @@ static void view3d_main_area_draw_objects(const bContext *C, Scene *scene, View3
 
        /* enables anti-aliasing for 3D view drawing */
        if (U.ogl_multisamples != USER_MULTISAMPLE_NONE) {
-               glEnable(GL_MULTISAMPLE_ARB);
+               glEnable(GL_MULTISAMPLE);
        }
 
        /* main drawing call */
@@ -3899,7 +3899,7 @@ static void view3d_main_area_draw_objects(const bContext *C, Scene *scene, View3
 
        /* Disable back anti-aliasing */
        if (U.ogl_multisamples != USER_MULTISAMPLE_NONE) {
-               glDisable(GL_MULTISAMPLE_ARB);
+               glDisable(GL_MULTISAMPLE);
        }
 
        if (v3d->lay_used != lay_used) { /* happens when loading old files or loading with UI load */
index 685ae59c47b00e0a3e0601d9f6d57aee60037742..e07f90250900e3ec815b3378b6827cc9437faf6b 100644 (file)
@@ -61,7 +61,6 @@ void GPU_extensions_disable(void);
 
 bool GPU_glsl_support(void);
 bool GPU_non_power_of_two_support(void);
-bool GPU_vertex_buffer_support(void);
 bool GPU_display_list_support(void);
 bool GPU_bicubic_bump_support(void);
 bool GPU_geometry_shader_support(void);
@@ -195,7 +194,7 @@ typedef enum GPUProgramType {
        GPU_PROGRAM_TYPE_FRAGMENT = 0
 } GPUProgramType;
 
-
+/* TODO: remove ARB program support (recode smoke shader in GLSL) */
 GPUProgram *GPU_program_shader_create(GPUProgramType type, const char *code);
 void GPU_program_free(GPUProgram *program);
 void GPU_program_parameter_4f(GPUProgram *program, unsigned int location, float x, float y, float z, float w);
index 09137fc998b018731989a12389f2d62d74ba5016..5dff711633644a9a2a3bfa1da8df21505feeb3c6 100644 (file)
@@ -52,10 +52,7 @@ bool GPU_select_load_id(unsigned int id);
  * if dopass is true, we will do a second pass with occlusion queries to get the closest hit */
 unsigned int GPU_select_end(void);
 
-/* does the GPU support occlusion queries? */
-bool GPU_select_query_check_support(void);
-
-/* is occlusion query supported and user activated? */
+/* has user activated? */
 bool GPU_select_query_check_active(void);
 
 #endif
index e8795a0e00e86f5f5b286b6d038e4c58980632ec..1ad35c1edae072b50ee6a2e7b4c1adabe06347f0 100644 (file)
@@ -179,14 +179,13 @@ GPUFX *GPU_fx_compositor_create(void)
 {
        GPUFX *fx = MEM_callocN(sizeof(GPUFX), "GPUFX compositor");
 
-       if (GLEW_ARB_vertex_buffer_object) {
-               glGenBuffersARB(1, &fx->vbuffer);
-               glBindBuffer(GL_ARRAY_BUFFER, fx->vbuffer);
-               glBufferDataARB(GL_ARRAY_BUFFER_ARB, 16 * sizeof(float), NULL, GL_STATIC_DRAW);
-               glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, 8 * sizeof(float), fullscreencos);
-               glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 8 * sizeof(float), 8 * sizeof(float), fullscreenuvs);
-               glBindBuffer(GL_ARRAY_BUFFER, 0);
-       }
+       glGenBuffers(1, &fx->vbuffer);
+       glBindBuffer(GL_ARRAY_BUFFER, fx->vbuffer);
+       glBufferData(GL_ARRAY_BUFFER, 16 * sizeof(float), NULL, GL_STATIC_DRAW);
+       glBufferSubData(GL_ARRAY_BUFFER, 0, 8 * sizeof(float), fullscreencos);
+       glBufferSubData(GL_ARRAY_BUFFER, 8 * sizeof(float), 8 * sizeof(float), fullscreenuvs);
+       glBindBuffer(GL_ARRAY_BUFFER, 0);
+
        return fx;
 }
 
@@ -275,8 +274,7 @@ static void cleanup_fx_gl_data(GPUFX *fx, bool do_fbo)
 void GPU_fx_compositor_destroy(GPUFX *fx)
 {
        cleanup_fx_gl_data(fx, true);
-       if (GLEW_ARB_vertex_buffer_object)
-               glDeleteBuffersARB(1, &fx->vbuffer);
+       glDeleteBuffers(1, &fx->vbuffer);
        MEM_freeN(fx);
 }
 
@@ -306,7 +304,7 @@ bool GPU_fx_compositor_initialize_passes(
 
        fx->effects = 0;
 
-       if (!GPU_non_power_of_two_support() || !GLEW_EXT_framebuffer_object || !GLEW_ARB_fragment_shader)
+       if (!GPU_non_power_of_two_support() || !GLEW_EXT_framebuffer_object)
                return false;
 
        if (!fx_settings) {
index 29b7ff11586ca4f5d1f6bd91c9bffb64e22eae06..ce1ddafa3e4944fca71e24a463ddd71fefb5c05f 100644 (file)
@@ -457,7 +457,7 @@ void GPU_state_print(void)
        gpu_state_print_fl(GL_FOG_INDEX);
        gpu_state_print_fl(GL_FOG_MODE);
        gpu_state_print_fl(GL_FOG_START);
-       gpu_state_print_fl(GL_FRAGMENT_PROGRAM_ARB);
+       gpu_state_print_fl(GL_FRAGMENT_PROGRAM_ARB); /* TODO: remove ARB program support */
        gpu_state_print_fl(GL_FRAGMENT_SHADER_DERIVATIVE_HINT);
        gpu_state_print_fl(GL_FRONT_FACE);
        gpu_state_print_fl(GL_GENERATE_MIPMAP_HINT);
@@ -560,7 +560,6 @@ void GPU_state_print(void)
        gpu_state_print_fl(GL_MODELVIEW_MATRIX);
        gpu_state_print_fl(GL_MODELVIEW_STACK_DEPTH);
        gpu_state_print_fl(GL_MULTISAMPLE);
-       gpu_state_print_fl(GL_MULTISAMPLE_ARB);
        gpu_state_print_fl(GL_NAME_STACK_DEPTH);
        gpu_state_print_fl(GL_NORMALIZE);
        gpu_state_print_fl(GL_NORMAL_ARRAY);
@@ -686,7 +685,6 @@ void GPU_state_print(void)
        gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY_STRIDE);
        gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY_TYPE);
        gpu_state_print_fl(GL_TEXTURE_CUBE_MAP);
-       gpu_state_print_fl(GL_TEXTURE_CUBE_MAP_ARB);
        gpu_state_print_fl(GL_TEXTURE_GEN_Q);
        gpu_state_print_fl(GL_TEXTURE_GEN_R);
        gpu_state_print_fl(GL_TEXTURE_GEN_S);
index 3ad396a532c63d3ecd38433a8747e9222085686e..f71733064c4d88f87cd469b026fccfff66a238c9 100644 (file)
@@ -182,17 +182,17 @@ void GPU_render_text(
                        uv[2][1] = (uv_quad[2][1] - centery) * sizey + transy;
                        
                        glBegin(GL_POLYGON);
-                       if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[0]);
+                       if (glattrib >= 0) glVertexAttrib2fv(glattrib, uv[0]);
                        else glTexCoord2fv(uv[0]);
                        if (col) gpu_mcol(col[0]);
                        glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]);
                        
-                       if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[1]);
+                       if (glattrib >= 0) glVertexAttrib2fv(glattrib, uv[1]);
                        else glTexCoord2fv(uv[1]);
                        if (col) gpu_mcol(col[1]);
                        glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]);
 
-                       if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[2]);
+                       if (glattrib >= 0) glVertexAttrib2fv(glattrib, uv[2]);
                        else glTexCoord2fv(uv[2]);
                        if (col) gpu_mcol(col[2]);
                        glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]);
@@ -201,7 +201,7 @@ void GPU_render_text(
                                uv[3][0] = (uv_quad[3][0] - centerx) * sizex + transx;
                                uv[3][1] = (uv_quad[3][1] - centery) * sizey + transy;
 
-                               if (glattrib >= 0) glVertexAttrib2fvARB(glattrib, uv[3]);
+                               if (glattrib >= 0) glVertexAttrib2fv(glattrib, uv[3]);
                                else glTexCoord2fv(uv[3]);
                                if (col) gpu_mcol(col[3]);
                                glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]);
@@ -2039,33 +2039,31 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[4][
 
 static void gpu_multisample(bool enable)
 {
-       if (GLEW_VERSION_1_3 || GLEW_ARB_multisample) {
 #ifdef __linux__
-               /* changing multisample from the default (enabled) causes problems on some
-                * systems (NVIDIA/Linux) when the pixel format doesn't have a multisample buffer */
-               bool toggle_ok = true;
+       /* changing multisample from the default (enabled) causes problems on some
+        * systems (NVIDIA/Linux) when the pixel format doesn't have a multisample buffer */
+       bool toggle_ok = true;
 
-               if (GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_UNIX, GPU_DRIVER_ANY)) {
-                       int samples = 0;
-                       glGetIntegerv(GL_SAMPLES, &samples);
+       if (GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_UNIX, GPU_DRIVER_ANY)) {
+               int samples = 0;
+               glGetIntegerv(GL_SAMPLES, &samples);
 
-                       if (samples == 0)
-                               toggle_ok = false;
-               }
+               if (samples == 0)
+                       toggle_ok = false;
+       }
 
-               if (toggle_ok) {
-                       if (enable)
-                               glEnable(GL_MULTISAMPLE);
-                       else
-                               glDisable(GL_MULTISAMPLE);
-               }
-#else
+       if (toggle_ok) {
                if (enable)
                        glEnable(GL_MULTISAMPLE);
                else
                        glDisable(GL_MULTISAMPLE);
-#endif
        }
+#else
+       if (enable)
+               glEnable(GL_MULTISAMPLE);
+       else
+               glDisable(GL_MULTISAMPLE);
+#endif
 }
 
 /* Default OpenGL State */
index 270cf6c70d794463edd1862b1c8aa0d63806cc5a..3ff8ab5b4c87f6ea8c3f508351d17ee1efdf3afe 100644 (file)
@@ -283,11 +283,6 @@ bool GPU_non_power_of_two_support(void)
        return !GG.npotdisabled;
 }
 
-bool GPU_vertex_buffer_support(void)
-{
-       return true;
-}
-
 bool GPU_display_list_support(void)
 {
        return !GG.dlistsdisabled;
@@ -1780,7 +1775,7 @@ void GPU_program_unbind(GPUProgram *program)
 
 GPUProgram *GPU_program_shader_create(GPUProgramType type, const char *code)
 {
-       /* TODO(merwin): remove ARB shader support (recode smoke shader in GLSL) */
+       /* TODO(merwin): remove ARB program support (recode smoke shader in GLSL) */
 
        GPUProgram *program;
        GLint error_pos, is_native;
index 4978229a350d6a0ba3d197fdd1163d673a435fa0..44847dd5a480043097eff38653cfe009974664cb 100644 (file)
@@ -95,7 +95,7 @@ void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, rctf *input, c
 
                g_query_state.queries = MEM_mallocN(g_query_state.num_of_queries * sizeof(*g_query_state.queries), "gpu selection queries");
                g_query_state.id = MEM_mallocN(g_query_state.num_of_queries * sizeof(*g_query_state.id), "gpu selection ids");
-               glGenQueriesARB(g_query_state.num_of_queries, g_query_state.queries);
+               glGenQueries(g_query_state.num_of_queries, g_query_state.queries);
 
                glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_VIEWPORT_BIT);
                /* disable writing to the framebuffer */
@@ -144,17 +144,17 @@ bool GPU_select_load_id(unsigned int id)
        }
        else {
                if (g_query_state.query_issued) {
-                       glEndQueryARB(GL_SAMPLES_PASSED_ARB);
+                       glEndQuery(GL_SAMPLES_PASSED);
                }
                /* if required, allocate extra queries */
                if (g_query_state.active_query == g_query_state.num_of_queries) {
                        g_query_state.num_of_queries += ALLOC_QUERIES;
                        g_query_state.queries = MEM_reallocN(g_query_state.queries, g_query_state.num_of_queries * sizeof(*g_query_state.queries));
                        g_query_state.id = MEM_reallocN(g_query_state.id, g_query_state.num_of_queries * sizeof(*g_query_state.id));
-                       glGenQueriesARB(ALLOC_QUERIES, &g_query_state.queries[g_query_state.active_query]);
+                       glGenQueries(ALLOC_QUERIES, &g_query_state.queries[g_query_state.active_query]);
                }
 
-               glBeginQueryARB(GL_SAMPLES_PASSED_ARB, g_query_state.queries[g_query_state.active_query]);
+               glBeginQuery(GL_SAMPLES_PASSED, g_query_state.queries[g_query_state.active_query]);
                g_query_state.id[g_query_state.active_query] = id;
                g_query_state.active_query++;
                g_query_state.query_issued = true;
@@ -184,12 +184,12 @@ unsigned int GPU_select_end(void)
                int i;
 
                if (g_query_state.query_issued) {
-                       glEndQueryARB(GL_SAMPLES_PASSED_ARB);
+                       glEndQuery(GL_SAMPLES_PASSED);
                }
 
                for (i = 0; i < g_query_state.active_query; i++) {
                        unsigned int result;
-                       glGetQueryObjectuivARB(g_query_state.queries[i], GL_QUERY_RESULT_ARB, &result);
+                       glGetQueryObjectuiv(g_query_state.queries[i], GL_QUERY_RESULT, &result);
                        if (result > 0) {
                                if (g_query_state.mode != GPU_SELECT_NEAREST_SECOND_PASS) {
                                        int maxhits = g_query_state.bufsize / 4;
@@ -221,7 +221,7 @@ unsigned int GPU_select_end(void)
                        }
                }
 
-               glDeleteQueriesARB(g_query_state.num_of_queries, g_query_state.queries);
+               glDeleteQueries(g_query_state.num_of_queries, g_query_state.queries);
                MEM_freeN(g_query_state.queries);
                MEM_freeN(g_query_state.id);
                glPopAttrib();
@@ -233,16 +233,8 @@ unsigned int GPU_select_end(void)
        return hits;
 }
 
-
-bool GPU_select_query_check_support(void)
-{
-       return GLEW_ARB_occlusion_query;
-}
-
-
 bool GPU_select_query_check_active(void)
 {
-       return GLEW_ARB_occlusion_query &&
-              ((U.gpu_select_method == USER_SELECT_USE_OCCLUSION_QUERY) ||
+       return ((U.gpu_select_method == USER_SELECT_USE_OCCLUSION_QUERY) ||
                ((U.gpu_select_method == USER_SELECT_AUTO) && GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY)));
 }
index 83c159a46dd1286344cf721b94bee2640d381c1f..73d46fc7e457fef5ff236e45e4089f17d8cdf16e 100644 (file)
@@ -381,11 +381,6 @@ static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, Pointe
        rna_userdef_update(bmain, scene, ptr);
 }
 
-static int rna_Scene_GPU_selection_supported(UserDef *UNUSED(U))
-{
-       return GPU_select_query_check_support();
-}
-
 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        wmWindowManager *wm = bmain->wm.first;
@@ -4219,11 +4214,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
        RNA_def_property_update(prop, 0, "rna_userdef_text_update");
 
-       func = RNA_def_function(srna, "is_occlusion_query_supported", "rna_Scene_GPU_selection_supported");
-       parm = RNA_def_boolean(func, "is_supported", 0, "Occlusion Query Support",
-                              "Check if GPU supports Occlusion Queries");
-       RNA_def_function_return(func, parm);
-
        prop = RNA_def_property(srna, "select_method", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "gpu_select_method");
        RNA_def_property_enum_items(prop, gpu_select_method_items);