zink: change zink_gfx_program::last_pipeline -> struct zink_gfx_pipeline_cache_entry
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sun, 2 Oct 2022 12:13:45 +0000 (08:13 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 11 Oct 2022 17:02:14 +0000 (17:02 +0000)
this ensures that the latest version of the pipeline pointer in the cache
entry will always be used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>

src/gallium/drivers/zink/zink_program_state.hpp
src/gallium/drivers/zink/zink_types.h

index fe6ab93..3f41561 100644 (file)
@@ -208,7 +208,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
    const int rp_idx = state->render_pass ? 1 : 0;
    if (DYNAMIC_STATE == ZINK_DYNAMIC_VERTEX_INPUT || DYNAMIC_STATE == ZINK_DYNAMIC_VERTEX_INPUT2) {
       if (prog->last_finalized_hash[rp_idx][idx] == state->final_hash && !prog->inline_variants && likely(prog->last_pipeline[rp_idx][idx])) {
-         state->pipeline = prog->last_pipeline[rp_idx][idx];
+         state->pipeline = prog->last_pipeline[rp_idx][idx]->pipeline;
          return state->pipeline;
       }
    }
@@ -260,7 +260,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
    state->pipeline = cache_entry->pipeline;
    if (DYNAMIC_STATE >= ZINK_DYNAMIC_VERTEX_INPUT) {
       prog->last_finalized_hash[rp_idx][idx] = state->final_hash;
-      prog->last_pipeline[rp_idx][idx] = state->pipeline;
+      prog->last_pipeline[rp_idx][idx] = cache_entry;
    }
    return state->pipeline;
 }
index 3c5b431..b2e25cf 100644 (file)
@@ -859,7 +859,7 @@ struct zink_gfx_program {
    uint8_t inline_variants; //which stages are using inlined uniforms
 
    uint32_t last_finalized_hash[2][4]; //[dynamic, renderpass][primtype idx]
-   VkPipeline last_pipeline[2][4]; //[dynamic, renderpass][primtype idx]
+   struct zink_gfx_pipeline_cache_entry *last_pipeline[2][4]; //[dynamic, renderpass][primtype idx]
 
    struct set libs; //zink_gfx_library_key -> VkPipeline
 };