From 9fbc538ac6441fb305d5963e09c70890fec0216b Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 26 Jan 2021 19:04:48 +0100 Subject: [PATCH] vrend: move program only into front of queue of it is not already there Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Chia-I Wu --- src/vrend_renderer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index a58e845..7b25c3c 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -1733,9 +1733,10 @@ static struct vrend_linked_shader_program *lookup_shader_program(struct vrend_su ent->ss[PIPE_SHADER_TESS_EVAL]->id != tes_id) continue; /* put the entry in front */ - list_del(&ent->head); - list_add(&ent->head, programs); - + if (programs->next != &ent->head) { + list_del(&ent->head); + list_add(&ent->head, programs); + } return ent; }