zink: move compute pipeline cache update to caller
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 12 Aug 2022 15:29:15 +0000 (11:29 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 Aug 2022 04:11:16 +0000 (04:11 +0000)
this is more flexible

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

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

index 1cdc78b..7ded655 100644 (file)
@@ -413,7 +413,6 @@ zink_create_compute_pipeline(struct zink_screen *screen, struct zink_compute_pro
       mesa_loge("ZINK: vkCreateComputePipelines failed (%s)", vk_Result_to_str(result));
       return VK_NULL_HANDLE;
    }
-   zink_screen_update_pipeline_cache(screen, &comp->base);
 
    return pipeline;
 }
index 519e7d0..7be6e4b 100644 (file)
@@ -993,6 +993,7 @@ zink_get_compute_pipeline(struct zink_screen *screen,
       if (pipeline == VK_NULL_HANDLE)
          return VK_NULL_HANDLE;
 
+      zink_screen_update_pipeline_cache(screen, &comp->base);
       if (!comp->use_local_size && !comp->curr->num_uniforms && !comp->curr->has_nonseamless) {
          /* don't add base pipeline to cache */
          state->pipeline = comp->base_pipeline = pipeline;