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
This commit is contained in:
Mike Erwin 2017-03-27 01:43:12 -04:00
parent b95ee78ed3
commit 271471bbe6
Notes: blender-bot 2023-02-14 09:24:53 +01:00
Referenced by issue #51078, Thumbnail Previews broken in recent matrix changes
1 changed files with 2 additions and 18 deletions

View File

@ -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();
}