[Bf-blender-cvs] [a3d258b] master: fix for potential pitfall with glMatrixMode
Mike Erwin
noreply at git.blender.org
Wed Sep 21 17:49:20 CEST 2016
Commit: a3d258bfb49c4560bdb91fbedbfa8536641e2133
Author: Mike Erwin
Date: Wed Sep 21 17:41:34 2016 +0200
Branches: master
https://developer.blender.org/rBa3d258bfb49c4560bdb91fbedbfa8536641e2133
fix for potential pitfall with glMatrixMode
close D696 by @jwilkins
The matrix mode should always be left in modelview mode, since a lot of code assumes it is before setting a matrix.
===================================================================
M source/blender/gpu/intern/gpu_framebuffer.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index c0400cd..f62ef67 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -401,13 +401,13 @@ void GPU_framebuffer_blur(
GPU_shader_uniform_texture(blur_shader, texture_source_uniform, tex);
glViewport(0, 0, GPU_texture_width(blurtex), GPU_texture_height(blurtex));
- /* Peparing to draw quad */
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ /* Preparing to draw quad */
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
glDisable(GL_DEPTH_TEST);
More information about the Bf-blender-cvs
mailing list