diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-05 12:41:53 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-05 12:41:53 +0400 |
commit | 0adf252c9b92dac4bc56e92c531464c59b71d91c (patch) | |
tree | db0efae5b37c4a50bd678a8ea3760a70e8db7661 /source/blender/gpu | |
parent | 67ba133b19c20b83d06c9c2dd5f2fb5bea5463b5 (diff) |
Fix #31593: Every time I switch between edit and object mode, it crashes
Crash was caused by incorrect restoring OpenGL context due to some
weird bit operations used to indicate whether stuff like color arrays
is initialized resulting in some unpredictable results on different
platforms and drivers.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 4c6ead3d3f4..75ed7d7eb19 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -1151,7 +1151,7 @@ void GPU_buffer_unbind(void) glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); } } - GLStates &= !(GPU_BUFFER_VERTEX_STATE | GPU_BUFFER_NORMAL_STATE | + GLStates &= ~(GPU_BUFFER_VERTEX_STATE | GPU_BUFFER_NORMAL_STATE | GPU_BUFFER_TEXCOORD_STATE | GPU_BUFFER_COLOR_STATE | GPU_BUFFER_ELEMENT_STATE); @@ -1191,7 +1191,7 @@ void GPU_color_switch(int mode) else { if (GLStates & GPU_BUFFER_COLOR_STATE) glDisableClientState(GL_COLOR_ARRAY); - GLStates &= (!GPU_BUFFER_COLOR_STATE); + GLStates &= ~GPU_BUFFER_COLOR_STATE; } } |