[Bf-blender-cvs] [271471bbe6a] blender2.8: OpenGL: remove matrix manip from framebuffer setup

Mike Erwin noreply at git.blender.org
Mon Mar 27 07:50:30 CEST 2017


Commit: 271471bbe6ad26a1b96b9bc76dfba4e5f70b2d89
Author: Mike Erwin
Date:   Mon Mar 27 01:43:12 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB271471bbe6ad26a1b96b9bc76dfba4e5f70b2d89

OpenGL: remove matrix manip from framebuffer setup

It doesn't really belong here... Any code using framebuffers will set up its own matrices.

Part of T49450

===================================================================

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 e807c5523a6..5b3ffe9a93f 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -220,14 +220,9 @@ void GPU_texture_bind_as_framebuffer(GPUTexture *tex)
 		glEnable(GL_MULTISAMPLE);
 	}
 
-	/* push matrices and set default viewport and matrix */
+	/* set default viewport */
 	glViewport(0, 0, GPU_texture_width(tex), GPU_texture_height(tex));
 	GG.currentfb = fb->object;
-
-	glMatrixMode(GL_PROJECTION);
-	gpuPushMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	gpuPushMatrix();
 }
 
 void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot)
@@ -258,14 +253,9 @@ void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot)
 	glDrawBuffers(numslots, attachments);
 	glReadBuffer(GL_COLOR_ATTACHMENT0 + slot);
 
-	/* push matrices and set default viewport and matrix */
+	/* set default viewport */
 	glViewport(0, 0, GPU_texture_width(fb->colortex[slot]), GPU_texture_height(fb->colortex[slot]));
 	GG.currentfb = fb->object;
-
-	glMatrixMode(GL_PROJECTION);
-	gpuPushMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	gpuPushMatrix();
 }
 
 void GPU_framebuffer_bind(GPUFrameBuffer *fb)
@@ -308,12 +298,6 @@ void GPU_framebuffer_bind(GPUFrameBuffer *fb)
 
 void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUSED(tex))
 {
-	/* restore matrix */
-	glMatrixMode(GL_PROJECTION);
-	gpuPopMatrix();
-	glMatrixMode(GL_MODELVIEW);
-	gpuPopMatrix();
-
 	/* restore attributes */
 	glPopAttrib();
 }




More information about the Bf-blender-cvs mailing list