From 474f6f60c0d598a994584b9d9edfc73a5d3c297b Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 17 Jan 2023 10:13:00 +0100 Subject: [PATCH] vbo: remove bogus assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grow_vertex_storage may call wrap_filled_vertex, which will trigger the assert incorrectly because the new size will be smaller than 'new_size' but it's correct because 'vertex_store->used' has been reset to 0. Fixes: a08baaff976 ("vbo/dlist: fix indentation in vbo_save_api.c") Reviewed-by: Marek Olšák Part-of: (cherry picked from commit 491f6b138ecbe938471f7ee1bc339b32c61eed07) --- .pick_status.json | 2 +- src/mesa/vbo/vbo_save_api.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 793209a11a0..c9d9a231a05 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2947,7 +2947,7 @@ "description": "vbo: remove bogus assert", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a08baaff9764372c29d89886bc1331343d4273bf" }, diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index a41d518a5db..a782e210563 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1336,11 +1336,8 @@ do { \ save->vertex_store->used += save->vertex_size; \ unsigned used_next = (save->vertex_store->used + \ save->vertex_size) * sizeof(float); \ - if (used_next > save->vertex_store->buffer_in_ram_size) { \ + if (used_next > save->vertex_store->buffer_in_ram_size) \ grow_vertex_storage(ctx, get_vertex_count(save)); \ - assert(used_next <= \ - save->vertex_store->buffer_in_ram_size); \ - } \ } \ } while (0)