zink: store last pipeline directly for zink_gfx_program::last_pipeline
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 6 Feb 2023 19:53:56 +0000 (14:53 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Feb 2023 02:35:36 +0000 (02:35 +0000)
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>

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

index 70514ae..b83d227 100644 (file)
@@ -230,7 +230,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
           !prog->inline_variants && likely(prog->last_pipeline[rp_idx][idx]) &&
           /* this data is too big to compare in the fast-path */
           likely(!prog->shaders[MESA_SHADER_FRAGMENT]->fs.legacy_shadow_mask)) {
-         state->pipeline = prog->last_pipeline[rp_idx][idx]->pipeline;
+         state->pipeline = prog->last_pipeline[rp_idx][idx];
          return state->pipeline;
       }
    }
@@ -290,7 +290,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx,
    /* update states for fastpath */
    if (DYNAMIC_STATE >= ZINK_DYNAMIC_VERTEX_INPUT) {
       prog->last_finalized_hash[rp_idx][idx] = state->final_hash;
-      prog->last_pipeline[rp_idx][idx] = cache_entry;
+      prog->last_pipeline[rp_idx][idx] = cache_entry->pipeline;
    }
    return state->pipeline;
 }
index f5badd5..c6b7089 100644 (file)
@@ -994,7 +994,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]
-   struct zink_gfx_pipeline_cache_entry *last_pipeline[2][4]; //[dynamic, renderpass][primtype idx]
+   VkPipeline last_pipeline[2][4]; //[dynamic, renderpass][primtype idx]
 
    struct set libs; //zink_gfx_library_key -> VkPipeline
 };