zink: flag renderpass change when toggling fbfetch
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 29 Oct 2021 15:35:01 +0000 (11:35 -0400)
committerMarge Bot <emma+marge@anholt.net>
Sun, 31 Oct 2021 14:56:51 +0000 (14:56 +0000)
ensure the input attachment gets updated

fixes running
KHR-GL46.blend_equation_advanced.blend_all.GL_MULTIPLY_KHR_all_qualifier
after
KHR-GL46.blend_equation_advanced.BlendEquationSeparate

cc: mesa-stable

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13598>

src/gallium/drivers/zink/zink_context.c

index 2d9a1a6..606ebe9 100644 (file)
@@ -1832,6 +1832,8 @@ zink_update_fbfetch(struct zink_context *ctx)
        !ctx->gfx_stages[PIPE_SHADER_FRAGMENT]->nir->info.fs.uses_fbfetch_output) {
       if (!had_fbfetch)
          return;
+      ctx->rp_changed = true;
+      zink_batch_no_rp(ctx);
       ctx->di.fbfetch.imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
       ctx->di.fbfetch.imageView = zink_screen(ctx->base.screen)->info.rb2_feats.nullDescriptor ?
                                   VK_NULL_HANDLE :
@@ -1847,8 +1849,11 @@ zink_update_fbfetch(struct zink_context *ctx)
       ctx->di.fbfetch.imageView = zink_csurface(ctx->fb_state.cbufs[0])->image_view;
    }
    ctx->di.fbfetch.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
-   if (changed)
+   if (changed) {
       zink_screen(ctx->base.screen)->context_invalidate_descriptor_state(ctx, PIPE_SHADER_FRAGMENT, ZINK_DESCRIPTOR_TYPE_UBO, 0, 1);
+      ctx->rp_changed = true;
+      zink_batch_no_rp(ctx);
+   }
 }
 
 static size_t