mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 18:00:10 +01:00
lavapipe: delete unused pipelines immediately
deferring these can cause memory ballooning and oom Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
This commit is contained in:
parent
408606af02
commit
59af3b4ad4
3 changed files with 9 additions and 3 deletions
|
|
@ -1051,6 +1051,7 @@ static void handle_pipeline(struct vk_cmd_queue_entry *cmd,
|
|||
struct rendering_state *state)
|
||||
{
|
||||
LVP_FROM_HANDLE(lvp_pipeline, pipeline, cmd->u.bind_pipeline.pipeline);
|
||||
pipeline->used = true;
|
||||
if (pipeline->is_compute_pipeline) {
|
||||
handle_compute_pipeline(cmd, state);
|
||||
handle_pipeline_access(state, MESA_SHADER_COMPUTE);
|
||||
|
|
|
|||
|
|
@ -79,9 +79,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_DestroyPipeline(
|
|||
if (!_pipeline)
|
||||
return;
|
||||
|
||||
simple_mtx_lock(&device->queue.pipeline_lock);
|
||||
util_dynarray_append(&device->queue.pipeline_destroys, struct lvp_pipeline*, pipeline);
|
||||
simple_mtx_unlock(&device->queue.pipeline_lock);
|
||||
if (pipeline->used) {
|
||||
simple_mtx_lock(&device->queue.pipeline_lock);
|
||||
util_dynarray_append(&device->queue.pipeline_destroys, struct lvp_pipeline*, pipeline);
|
||||
simple_mtx_unlock(&device->queue.pipeline_lock);
|
||||
} else {
|
||||
lvp_pipeline_destroy(device, pipeline);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ struct lvp_pipeline {
|
|||
bool library;
|
||||
bool noop_fs;
|
||||
bool compiled;
|
||||
bool used;
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue