[Mesa-dev] [PATCH] mesa: fix display list corner case assertion

Marek Olšák maraeo at gmail.com
Tue Feb 26 01:42:40 UTC 2019


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Feb 25, 2019 at 5:03 PM Brian Paul <brianp at vmware.com> wrote:

> This fixes a failed assertion in glDeleteLists() for the following
> case:
>
> list = glGenLists(1);
> glDeleteLists(list, 1);
>
> when those are the first display list commands issued by the
> application.
>
> When we generate display lists, we plug in empty lists created with
> the make_list() helper.  This function uses the OPCODE_END_OF_LIST
> opcode but does not call dlist_alloc() which would set the
> InstSize[OPCODE_END_OF_LIST] element to non-zero.
>
> When the empty list was deleted, we failed the InstSize[opcode] > 0
> assertion.
>
> Typically, display lists are created with glNewList/glEndList so we
> set InstSize[OPCODE_END_OF_LIST] = 1 in dlist_alloc().  That's why
> this bug wasn't found before.
>
> To fix this failure, simply initialize the InstSize[OPCODE_END_OF_LIST]
> element in make_list().
>
> The game oolite was hitting this.
>
> Fixes: https://github.com/OoliteProject/oolite/issues/325
> ---
>  src/mesa/main/dlist.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
> index 97461ce..8dcf8bd 100644
> --- a/src/mesa/main/dlist.c
> +++ b/src/mesa/main/dlist.c
> @@ -962,6 +962,8 @@ make_list(GLuint name, GLuint count)
>     dlist->Name = name;
>     dlist->Head = malloc(sizeof(Node) * count);
>     dlist->Head[0].opcode = OPCODE_END_OF_LIST;
> +   /* All InstSize[] entries must be non-zero */
> +   InstSize[OPCODE_END_OF_LIST] = 1;
>     return dlist;
>  }
>
> --
> 1.8.5.6
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190225/74953f82/attachment.html>


More information about the mesa-dev mailing list