From a5877b17f8ab17116a9a4d26dfb4d6c6f608b5d2 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 29 Jul 2024 17:25:37 -0700 Subject: [PATCH] nv2a/vk: Fix compute pipeline finalize --- hw/xbox/nv2a/pgraph/vk/surface-compute.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/vk/surface-compute.c b/hw/xbox/nv2a/pgraph/vk/surface-compute.c index ebbaca65a8..104f91d468 100644 --- a/hw/xbox/nv2a/pgraph/vk/surface-compute.c +++ b/hw/xbox/nv2a/pgraph/vk/surface-compute.c @@ -545,15 +545,9 @@ static void pipeline_cache_release_node_resources(PGRAPHVkState *r, ComputePipel snode->pipeline = VK_NULL_HANDLE; } -static bool pipeline_cache_entry_pre_evict(Lru *lru, LruNode *node) -{ - // FIXME: Check pipeline not in use - return false; -} - static void pipeline_cache_entry_post_evict(Lru *lru, LruNode *node) { - PGRAPHVkState *r = container_of(lru, PGRAPHVkState, pipeline_cache); + PGRAPHVkState *r = container_of(lru, PGRAPHVkState, compute.pipeline_cache); ComputePipeline *snode = container_of(node, ComputePipeline, node); pipeline_cache_release_node_resources(r, snode); } @@ -575,7 +569,6 @@ static void pipeline_cache_init(PGRAPHVkState *r) } r->compute.pipeline_cache.init_node = pipeline_cache_entry_init; r->compute.pipeline_cache.compare_nodes = pipeline_cache_entry_compare; - r->compute.pipeline_cache.pre_node_evict = pipeline_cache_entry_pre_evict; r->compute.pipeline_cache.post_node_evict = pipeline_cache_entry_post_evict; } @@ -601,6 +594,8 @@ void pgraph_vk_finalize_compute(PGRAPHState *pg) { PGRAPHVkState *r = pg->vk_renderer_state; + assert(!r->in_command_buffer); + pipeline_cache_finalize(r); destroy_compute_pipeline_layout(r); destroy_descriptor_sets(pg);