zink: only update gfx pipeline cache after creating a real pipeline
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 1 Sep 2021 17:58:31 +0000 (13:58 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 16 Sep 2021 03:52:32 +0000 (23:52 -0400)
async pipelines may not require updates here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12842>

src/gallium/drivers/zink/zink_pipeline.c
src/gallium/drivers/zink/zink_program.c

index 0e86950..b16b647 100644 (file)
@@ -276,7 +276,6 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
       debug_printf("vkCreateGraphicsPipelines failed\n");
       return VK_NULL_HANDLE;
    }
-   zink_screen_update_pipeline_cache(screen, &prog->base);
 
    return pipeline;
 }
index 3e467ad..8d75ad8 100644 (file)
@@ -853,6 +853,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
       if (pipeline == VK_NULL_HANDLE)
          return VK_NULL_HANDLE;
 
+      zink_screen_update_pipeline_cache(screen, &prog->base);
       struct gfx_pipeline_cache_entry *pc_entry = CALLOC_STRUCT(gfx_pipeline_cache_entry);
       if (!pc_entry)
          return VK_NULL_HANDLE;