i965: Test original vertex array pointer to skip array upload.
authorMathias Fröhlich <mathias.froehlich@web.de>
Sat, 20 Apr 2019 05:39:56 +0000 (07:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 14:28:37 +0000 (14:28 +0000)
Rather than do a NULL pointer check on a pointer that may be offset by the
min-max index range of an GL draw operation, execute the NULL test on the
original vertex array pointer.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>

src/mesa/drivers/dri/i965/brw_draw_upload.c

index 221713ebd73a70a51983492a3c6dfd3c0ac92435..ee581fc9696c5f56979bb84c883686485f15dff1 100644 (file)
@@ -418,7 +418,7 @@ copy_array_to_vbo_array(struct brw_context *brw,
     *
     * In this case, let's the dst with undefined values
     */
-   if (src != NULL) {
+   if (ptr != NULL) {
       if (dst_stride == src_stride) {
          memcpy(dst, src, size);
       } else {