Mesa (master): intel: Clarify the depthRb == stencilRb logic.

Eric Anholt anholt at kemper.freedesktop.org
Mon Jul 18 18:43:58 UTC 2011


Module: Mesa
Branch: master
Commit: 8cf2741d2b05fd9f41eca35f0f43e6e0684d57f2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8cf2741d2b05fd9f41eca35f0f43e6e0684d57f2

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jul 12 10:01:32 2011 -0700

intel: Clarify the depthRb == stencilRb logic.

Reviewed-by: Chad Versace <chad at chad-versace.us>

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 1669af2..55bcc75 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -783,22 +783,21 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
     * The depth and stencil renderbuffers are the same renderbuffer or wrap
     * the same texture.
     */
-   bool depth_stencil_are_same;
-   if (depthRb && stencilRb && depthRb == stencilRb)
-      depth_stencil_are_same = true;
-   else if (depthRb && stencilRb && depthRb != stencilRb
-	    && (fb->Attachment[BUFFER_DEPTH].Type == GL_TEXTURE)
-	    && (fb->Attachment[BUFFER_STENCIL].Type == GL_TEXTURE)
-	    && (fb->Attachment[BUFFER_DEPTH].Texture->Name
-		== fb->Attachment[BUFFER_STENCIL].Texture->Name))
-      depth_stencil_are_same = true;
-   else
-      depth_stencil_are_same = false;
-
-   if (!intel->has_separate_stencil
-       && depthRb && stencilRb
-       && !depth_stencil_are_same) {
-      fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+   if (depthRb && stencilRb) {
+      bool depth_stencil_are_same;
+      if (depthRb == stencilRb)
+	 depth_stencil_are_same = true;
+      else if ((fb->Attachment[BUFFER_DEPTH].Type == GL_TEXTURE) &&
+	       (fb->Attachment[BUFFER_STENCIL].Type == GL_TEXTURE) &&
+	       (fb->Attachment[BUFFER_DEPTH].Texture->Name ==
+		fb->Attachment[BUFFER_STENCIL].Texture->Name))
+	 depth_stencil_are_same = true;
+      else
+	 depth_stencil_are_same = false;
+
+      if (!intel->has_separate_stencil && !depth_stencil_are_same) {
+	 fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+      }
    }
 
    for (i = 0; i < Elements(fb->Attachment); i++) {




More information about the mesa-commit mailing list