[cogl] gl: ensure depth isn't masked during clear
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] gl: ensure depth isn't masked during clear
- Date: Wed, 6 Mar 2013 16:36:14 +0000 (UTC)
commit 3cf497042897d1aa6918bc55b71a36ff67e560b9
Author: Robert Bragg <robert linux intel com>
Date: Mon Mar 4 21:46:08 2013 +0000
gl: ensure depth isn't masked during clear
If a pipeline has been flushed that disables depth writing and then we
try to clear the framebuffer with cogl_framebuffer_clear4f, passing
COGL_BUFFER_BIT_DEPTH then we need to make sure that depth writing is
re-enabled before issuing the glClear call. We also need to make sure
that when the next primitive is flushed that we re-check what state the
depth mask should be in.
Reviewed-by: Neil Roberts <neil linux intel com>
cogl/driver/gl/cogl-framebuffer-gl.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/driver/gl/cogl-framebuffer-gl.c
index d367556..b30b3cd 100644
--- a/cogl/driver/gl/cogl-framebuffer-gl.c
+++ b/cogl/driver/gl/cogl-framebuffer-gl.c
@@ -890,7 +890,21 @@ _cogl_framebuffer_gl_clear (CoglFramebuffer *framebuffer,
}
if (buffers & COGL_BUFFER_BIT_DEPTH)
- gl_buffers |= GL_DEPTH_BUFFER_BIT;
+ {
+ gl_buffers |= GL_DEPTH_BUFFER_BIT;
+
+ if (ctx->depth_writing_enabled_cache != TRUE)
+ {
+ GE( ctx, glDepthMask (TRUE));
+
+ ctx->depth_writing_enabled_cache = TRUE;
+
+ /* Make sure the DepthMask is updated when the next primitive is drawn */
+ ctx->current_pipeline_changes_since_flush |=
+ COGL_PIPELINE_STATE_DEPTH;
+ ctx->current_pipeline_age--;
+ }
+ }
if (buffers & COGL_BUFFER_BIT_STENCIL)
gl_buffers |= GL_STENCIL_BUFFER_BIT;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]