Make max number of vertex attributes be checked dynamically
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1822343002

Review URL: https://codereview.chromium.org/1822343002
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index f3f00f1..ce15b41 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -492,12 +492,16 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-void GrGpu::draw(const GrPipeline& pipeline,
+bool GrGpu::draw(const GrPipeline& pipeline,
                  const GrPrimitiveProcessor& primProc,
                  const GrMesh* meshes,
                  int meshCount) {
+    if (primProc.numAttribs() > this->caps()->maxVertexAttributes()) {
+        return false;
+    }
     this->handleDirtyContext();
 
     this->onDraw(pipeline, primProc, meshes, meshCount);
+    return true;
 }