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:
authorDalai Felinto <dfelinto@gmail.com>2017-05-09 16:09:39 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-05-09 16:23:33 +0300
commit65ebb668ec8d1fed282d59eea47da6dd47b699db (patch)
tree69fd13e5ae63bfd400112c8b954b586c8a5ae496 /source/blender/gpu/intern/gpu_select_sample_query.c
parent86c299c6a48036258096eb0c3447cad86369d4de (diff)
glPushAttrib/Pop change implementation to use a stack
The original implementation (cbd78c81268f) broke depth of field.
Diffstat (limited to 'source/blender/gpu/intern/gpu_select_sample_query.c')
-rw-r--r--source/blender/gpu/intern/gpu_select_sample_query.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_select_sample_query.c b/source/blender/gpu/intern/gpu_select_sample_query.c
index 96fd2595584..a7374604379 100644
--- a/source/blender/gpu/intern/gpu_select_sample_query.c
+++ b/source/blender/gpu/intern/gpu_select_sample_query.c
@@ -69,8 +69,6 @@ typedef struct GPUQueryState {
char mode;
unsigned int index;
int oldhits;
- /* OpenGL attrib bits */
- struct GPUStateValues attribs;
} GPUQueryState;
static GPUQueryState g_query_state = {0};
@@ -98,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);
- gpuSaveState(&g_query_state.attribs, GPU_DEPTH_BUFFER_BIT | GPU_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 +204,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);
- gpuRestoreState(&g_query_state.attribs);
+ gpuPopAttrib();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
return hits;