intel: Clarify the depthRb == stencilRb logic.
authorEric Anholt <eric@anholt.net>
Tue, 12 Jul 2011 17:01:32 +0000 (10:01 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 18 Jul 2011 18:26:33 +0000 (11:26 -0700)
Reviewed-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_fbo.c

index 1669af2c2a7e1d25b2171974b5d728cfa1cf9288..55bcc7578733fc2922bd0adadde45e8959c1a78d 100644 (file)
@@ -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++) {