Re-enable depth mask when unbinding depth test
if(current()==this)
{
GLenum color_buf = GL_NONE;
- bool has_depth = false;
for(unsigned i=0; i<attachments.size(); ++i)
{
const Attachment &attch = attachments[i];
if(attch.attachment>=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;
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)