From: Mikko Rasa Date: Thu, 9 Dec 2010 20:56:22 +0000 (+0000) Subject: Setting depth mask off in Framebuffer is not required X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=6fa59eb26c39443eb44feecd17b7a8ea45411730 Setting depth mask off in Framebuffer is not required Re-enable depth mask when unbinding depth test --- diff --git a/source/framebuffer.cpp b/source/framebuffer.cpp index a0fcbc47..ea28d5db 100644 --- a/source/framebuffer.cpp +++ b/source/framebuffer.cpp @@ -53,7 +53,6 @@ void Framebuffer::update_attachment(unsigned mask) const if(current()==this) { GLenum color_buf = GL_NONE; - bool has_depth = false; for(unsigned i=0; i=COLOR_ATTACHMENT0 && attch.attachment<=COLOR_ATTACHMENT3) color_buf = attch.attachment; - if(attch.attachment==DEPTH_ATTACHMENT) - has_depth = true; } glDrawBuffer(color_buf); - glDepthMask(has_depth); } else dirty |= mask; diff --git a/source/tests.cpp b/source/tests.cpp index a741b268..1a2a5835 100644 --- a/source/tests.cpp +++ b/source/tests.cpp @@ -70,7 +70,11 @@ const DepthTest &DepthTest::lequal() void DepthTest::unbind() { if(set_current(0)) + { glDisable(GL_DEPTH_TEST); + // Allow glClear(GL_DEPTH_BUFFER_BIT) to work + glDepthMask(true); + } } void depth_func(Predicate func)