Module: Mesa
Branch: main
Commit: be8b7980e66f3526d7c1eb9b137772fb6fc90a96
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=be8b7980e66f3526d7c1eb9b137772fb6fc90a96

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Feb  6 14:53:56 2023 -0500

zink: store last pipeline directly for zink_gfx_program::last_pipeline

Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>

---

 src/gallium/drivers/zink/zink_program_state.hpp | 4 ++--
 src/gallium/drivers/zink/zink_types.h           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_program_state.hpp 
b/src/gallium/drivers/zink/zink_program_state.hpp
index 70514ae93bf..b83d227a4a2 100644
--- a/src/gallium/drivers/zink/zink_program_state.hpp
+++ b/src/gallium/drivers/zink/zink_program_state.hpp
@@ -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;
 }
diff --git a/src/gallium/drivers/zink/zink_types.h 
b/src/gallium/drivers/zink/zink_types.h
index f5badd5630c..c6b708978c8 100644
--- a/src/gallium/drivers/zink/zink_types.h
+++ b/src/gallium/drivers/zink/zink_types.h
@@ -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
 };

Reply via email to