From: Roland Scheidegger Date: Thu, 25 Jan 2007 15:39:02 +0000 (+0100) Subject: allocate larger minimum dstelt buffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78b64d911b4b50ab744f250522a88b3952859f98;p=mesa.git allocate larger minimum dstelt buffer increase the minimum dstelt buffer size to avoid triggering an assertion later because the split is triggered before the buffer is full. This fixes cases where the vbo_split_copy path is hit because of maximum index limit, where the dstelt buffer size needed could be very small (doom3 hit that assertion with a vertex count of just 3) --- diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index df69e4ca28f..d9c58537821 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -466,7 +466,7 @@ static void replay_init( struct copy_context *copy ) /* Allocate an output element list: */ copy->dstelt_size = MIN2(65536, - copy->ib->count * 2); + copy->ib->count * 2 + 3); copy->dstelt_size = MIN2(copy->dstelt_size, copy->limits->max_indices); copy->dstelt = _mesa_malloc(sizeof(GLuint) * copy->dstelt_size);