anv: break out of the loop when the first color attachment is found
authorRohan Garg <rohan.garg@intel.com>
Tue, 14 Mar 2023 10:12:06 +0000 (11:12 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 15 Mar 2023 10:52:50 +0000 (10:52 +0000)
Fixes: 2bd304bc ("anv: Skip the RT flush when doing depth-only rendering")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21903>

src/intel/vulkan/genX_cmd_buffer.c

index 875c32a..b1c7696 100644 (file)
@@ -7478,8 +7478,10 @@ void genX(CmdBeginRendering)(
 #if GFX_VER >= 11
    bool has_color_att = false;
    for (uint32_t i = 0; i < gfx->color_att_count; i++) {
-      if (pRenderingInfo->pColorAttachments[i].imageView != VK_NULL_HANDLE)
+      if (pRenderingInfo->pColorAttachments[i].imageView != VK_NULL_HANDLE) {
          has_color_att = true;
+         break;
+      }
    }
    if (has_color_att) {
       /* The PIPE_CONTROL command description says: