mesa: Fix detection of invalidating both depth and stencil.
authorEric Anholt <eric@anholt.net>
Mon, 13 Jan 2020 21:06:01 +0000 (13:06 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jan 2020 23:37:54 +0000 (23:37 +0000)
Fixes an extra 1024x1024x4 MSAA Z/S store on WebGL fishtank on cheza.

Reported-by: Dave Airlie <airlied@redhat.com>
Fixes: db2ae5112106 ("mesa: Skip partial InvalidateFramebuffer of packed depth/stencil.")
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3370>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3370>

src/mesa/main/fbobject.c

index ea89565cfe2a4ee45f8ed5e8fafc9f0e90cfdba1..a34d5099688410f3804745d910b6484089934802 100644 (file)
@@ -5070,9 +5070,10 @@ discard_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
                                 GL_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT);
          bool has_both = false;
          for (int j = 0; j < numAttachments; j++) {
-            if (attachments[j] == other_format)
+            if (attachments[j] == other_format) {
                has_both = true;
-            break;
+               break;
+            }
          }
 
          if (fb->Attachment[BUFFER_DEPTH].Renderbuffer !=