mesa: don't unroll glMultiDrawElements if one count is 0
authorMarek Olšák <marek.olsak@amd.com>
Wed, 12 Feb 2020 22:21:35 +0000 (17:21 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Feb 2020 00:53:45 +0000 (00:53 +0000)
let the driver skip or submit an empty draw call.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>

src/mesa/main/draw.c

index 3a7c390784dead57a6549b7186c5e6187ab08f9e..aa4934fdb27b75c02ffb8e0fc5fd480241338830 100644 (file)
@@ -1212,16 +1212,6 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
       }
    }
 
-   /* Draw primitives individually if one count is zero, so we can easily skip
-    * that primitive.
-    */
-   for (i = 0; i < primcount; i++) {
-      if (count[i] == 0) {
-         fallback = GL_TRUE;
-         break;
-      }
-   }
-
    /* If the index buffer isn't in a VBO, then treating the application's
     * subranges of the index buffer as one large index buffer may lead to
     * us reading unmapped memory.