From cbd78c81268f06e7b658ae042f3ab6a3816149b0 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 4 Apr 2017 20:33:23 +0200 Subject: Immediate Mode: replacing glPushAttrib/glPopAttrib Reference document: http://docs.gl/gl3/glPushAttrib This patch only tackles the bits that are set by Blender with the following exceptions: 1) Deprecated states (e.g., GL_STIPPLE) are not saved/restored 2) The exception being GL_ALPHA_TEST, which will be removed, but it may affect drawing too much now. To be removed once we no longer set GL_ALPHA_TEST elsewhere. 3) paint_cursor will be tackled separated, since it was abusing glPush/PopAttrib in the first place. 4) Despite what the glPushAttrib page above may suggest, GL_DEPTH_WRITEMASK needs glGet, not glIsEnabled 5) BGE is still a problem since it relies on GL_ALL_ATTRIB_BITS which would lead to a way more complete/lenghty solution. Since the BGE has other (OpenGL deprecated) problems anyways, it can be handled on its own time. Finally, the original design for 2.8 was to implement a proper stack system. However we need to move to core profile sooner than later. So this is a pragmatic temporary (that may be permanent) solution. Reviewers: merwin, campbellbarton Differential Revision: https://developer.blender.org/D2600 --- source/blender/gpu/intern/gpu_viewport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/gpu/intern/gpu_viewport.c') diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index 7c2cb8cd4bb..bcfe4f38f3e 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -285,7 +285,7 @@ void GPU_viewport_unbind(GPUViewport *viewport) DefaultFramebufferList *dfbl = (DefaultFramebufferList *)viewport->fbl; if (dfbl->default_fb) { - GPU_framebuffer_texture_unbind(NULL, NULL); + GPU_framebuffer_texture_unbind(dfbl->default_fb, NULL); GPU_framebuffer_restore(); glEnable(GL_SCISSOR_TEST); -- cgit v1.2.3