Merge branch 'master' into blender2.8
[blender.git] / source / blender / gpu / intern / gpu_select_sample_query.c
index 3d5899862817b2d736962053058419727e4c6e73..e3bd20f3776450b2ce6feb6c3bf71d5eb4505f8d 100644 (file)
@@ -32,6 +32,8 @@
 
 #include <stdlib.h>
 
+#include "GPU_immediate.h"
+#include "GPU_draw.h"
 #include "GPU_select.h"
 #include "GPU_extensions.h"
 #include "GPU_glew.h"
@@ -94,7 +96,7 @@ void gpu_select_query_begin(
        g_query_state.id = MEM_mallocN(g_query_state.num_of_queries * sizeof(*g_query_state.id), "gpu selection ids");
        glGenQueries(g_query_state.num_of_queries, g_query_state.queries);
 
-       glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_VIEWPORT_BIT);
+       gpuPushAttrib(GPU_DEPTH_BUFFER_BIT | GPU_VIEWPORT_BIT);
        /* disable writing to the framebuffer */
        glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
 
@@ -206,7 +208,7 @@ unsigned int gpu_select_query_end(void)
        glDeleteQueries(g_query_state.num_of_queries, g_query_state.queries);
        MEM_freeN(g_query_state.queries);
        MEM_freeN(g_query_state.id);
-       glPopAttrib();
+       gpuPopAttrib();
        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 
        return hits;