mesa: don't use memset in glDrawArrays
authorMarek Olšák <marek.olsak@amd.com>
Wed, 12 Feb 2020 20:32:50 +0000 (15:32 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 18 Feb 2020 21:46:55 +0000 (16:46 -0500)
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3861>

src/mesa/main/draw.c

index 9f314dadebe2ec8ea8c5923dcf597116bba3ddc4..2062f99dc0e529e8cc9aa24d8caefc3b3a2febeb 100644 (file)
@@ -360,7 +360,6 @@ _mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
    /* OpenGL 4.5 says that primitive restart is ignored with non-indexed
     * draws.
     */
-   memset(&prim, 0, sizeof(prim));
    prim.begin = 1;
    prim.end = 1;
    prim.mode = mode;
@@ -369,6 +368,7 @@ _mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
    prim.draw_id = drawID;
    prim.start = start;
    prim.count = count;
+   prim.basevertex = 0;
 
    ctx->Driver.Draw(ctx, &prim, 1, NULL,
                     GL_TRUE, start, start + count - 1, NULL, 0, NULL);