Rename draw commands to match WebGPU IDL

BUG=dawn:51

Change-Id: I2a78f4e77c54aeae48d3fb78bf4701352ff40529
Reviewed-on: https://dawn-review.googlesource.com/c/3040
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/dawn.json b/dawn.json
index 1a076ee..617e2c0 100644
--- a/dawn.json
+++ b/dawn.json
@@ -797,7 +797,7 @@
                 ]
             },
             {
-                "name": "draw arrays",
+                "name": "draw",
                 "args": [
                     {"name": "vertex count", "type": "uint32_t"},
                     {"name": "instance count", "type": "uint32_t"},
@@ -806,7 +806,7 @@
                 ]
             },
             {
-                "name": "draw elements",
+                "name": "draw indexed",
                 "args": [
                     {"name": "index count", "type": "uint32_t"},
                     {"name": "instance count", "type": "uint32_t"},
diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp
index 9e0eff9..afe3853 100644
--- a/examples/Animometer.cpp
+++ b/examples/Animometer.cpp
@@ -145,7 +145,7 @@
         for (int k = 0; k < 10000; k++) {
             shaderData[i].time = f / 60.0f;
             pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, 6, reinterpret_cast<uint32_t*>(&shaderData[i]));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             i++;
         }
 
diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp
index 1d87073..8fc4cee 100644
--- a/examples/CHelloTriangle.cpp
+++ b/examples/CHelloTriangle.cpp
@@ -87,7 +87,7 @@
 
         dawnRenderPassEncoder pass = dawnCommandBufferBuilderBeginRenderPass(builder, renderpassInfo);
         dawnRenderPassEncoderSetRenderPipeline(pass, pipeline);
-        dawnRenderPassEncoderDrawArrays(pass, 3, 1, 0, 0);
+        dawnRenderPassEncoderDraw(pass, 3, 1, 0, 0);
         dawnRenderPassEncoderEndPass(pass);
         dawnRenderPassEncoderRelease(pass);
 
diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp
index 9c5f2fc..a6a032e 100644
--- a/examples/ComputeBoids.cpp
+++ b/examples/ComputeBoids.cpp
@@ -264,7 +264,7 @@
         pass.SetRenderPipeline(renderPipeline);
         pass.SetVertexBuffers(0, 1, &bufferDst, zeroOffsets);
         pass.SetVertexBuffers(1, 1, &modelBuffer, zeroOffsets);
-        pass.DrawArrays(3, kNumParticles, 0, 0);
+        pass.Draw(3, kNumParticles, 0, 0);
         pass.EndPass();
     }
 
diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp
index bf14e1a..5bd7d67 100644
--- a/examples/CppHelloTriangle.cpp
+++ b/examples/CppHelloTriangle.cpp
@@ -161,7 +161,7 @@
         pass.SetBindGroup(0, bindGroup);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
         pass.SetIndexBuffer(indexBuffer, 0);
-        pass.DrawElements(3, 1, 0, 0);
+        pass.DrawIndexed(3, 1, 0, 0);
         pass.EndPass();
     }
 
diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp
index 45348aa..c9df401 100644
--- a/examples/CubeReflection.cpp
+++ b/examples/CubeReflection.cpp
@@ -269,18 +269,18 @@
         pass.SetBindGroup(0, bindGroup[0]);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
         pass.SetIndexBuffer(indexBuffer, 0);
-        pass.DrawElements(36, 1, 0, 0);
+        pass.DrawIndexed(36, 1, 0, 0);
 
         pass.SetStencilReference(0x1);
         pass.SetRenderPipeline(planePipeline);
         pass.SetBindGroup(0, bindGroup[0]);
         pass.SetVertexBuffers(0, 1, &planeBuffer, vertexBufferOffsets);
-        pass.DrawElements(6, 1, 0, 0);
+        pass.DrawIndexed(6, 1, 0, 0);
 
         pass.SetRenderPipeline(reflectionPipeline);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
         pass.SetBindGroup(0, bindGroup[1]);
-        pass.DrawElements(36, 1, 0, 0);
+        pass.DrawIndexed(36, 1, 0, 0);
 
         pass.EndPass();
     }
diff --git a/examples/glTFViewer/glTFViewer.cpp b/examples/glTFViewer/glTFViewer.cpp
index 9b02bb3..389305b 100644
--- a/examples/glTFViewer/glTFViewer.cpp
+++ b/examples/glTFViewer/glTFViewer.cpp
@@ -531,10 +531,10 @@
                 }
                 const auto& oIndicesBuffer = buffers.at(iIndices.bufferView);
                 pass.SetIndexBuffer(oIndicesBuffer, static_cast<uint32_t>(iIndices.byteOffset));
-                pass.DrawElements(static_cast<uint32_t>(iIndices.count), 1, 0, 0);
+                pass.DrawIndexed(static_cast<uint32_t>(iIndices.count), 1, 0, 0);
             } else {
                 // DrawArrays
-                pass.DrawArrays(vertexCount, 1, 0, 0);
+                pass.Draw(vertexCount, 1, 0, 0);
             }
         }
     }
diff --git a/src/dawn_native/CommandBuffer.cpp b/src/dawn_native/CommandBuffer.cpp
index 6fdfb71..88a013e 100644
--- a/src/dawn_native/CommandBuffer.cpp
+++ b/src/dawn_native/CommandBuffer.cpp
@@ -515,14 +515,14 @@
                     return {};
                 } break;
 
-                case Command::DrawArrays: {
-                    mIterator.NextCommand<DrawArraysCmd>();
-                    DAWN_TRY(persistentState.ValidateCanDrawArrays());
+                case Command::Draw: {
+                    mIterator.NextCommand<DrawCmd>();
+                    DAWN_TRY(persistentState.ValidateCanDraw());
                 } break;
 
-                case Command::DrawElements: {
-                    mIterator.NextCommand<DrawElementsCmd>();
-                    DAWN_TRY(persistentState.ValidateCanDrawElements());
+                case Command::DrawIndexed: {
+                    mIterator.NextCommand<DrawIndexedCmd>();
+                    DAWN_TRY(persistentState.ValidateCanDrawIndexed());
                 } break;
 
                 case Command::SetRenderPipeline: {
diff --git a/src/dawn_native/CommandBufferStateTracker.cpp b/src/dawn_native/CommandBufferStateTracker.cpp
index 44799ac..9a7fdd9 100644
--- a/src/dawn_native/CommandBufferStateTracker.cpp
+++ b/src/dawn_native/CommandBufferStateTracker.cpp
@@ -38,11 +38,11 @@
     static constexpr CommandBufferStateTracker::ValidationAspects kDispatchAspects =
         1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS;
 
-    static constexpr CommandBufferStateTracker::ValidationAspects kDrawArraysAspects =
+    static constexpr CommandBufferStateTracker::ValidationAspects kDrawAspects =
         1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS |
         1 << VALIDATION_ASPECT_VERTEX_BUFFERS;
 
-    static constexpr CommandBufferStateTracker::ValidationAspects kDrawElementsAspects =
+    static constexpr CommandBufferStateTracker::ValidationAspects kDrawIndexedAspects =
         1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS |
         1 << VALIDATION_ASPECT_VERTEX_BUFFERS | 1 << VALIDATION_ASPECT_INDEX_BUFFER;
 
@@ -53,12 +53,12 @@
         return ValidateOperation(kDispatchAspects);
     }
 
-    MaybeError CommandBufferStateTracker::ValidateCanDrawArrays() {
-        return ValidateOperation(kDrawArraysAspects);
+    MaybeError CommandBufferStateTracker::ValidateCanDraw() {
+        return ValidateOperation(kDrawAspects);
     }
 
-    MaybeError CommandBufferStateTracker::ValidateCanDrawElements() {
-        return ValidateOperation(kDrawElementsAspects);
+    MaybeError CommandBufferStateTracker::ValidateCanDrawIndexed() {
+        return ValidateOperation(kDrawIndexedAspects);
     }
 
     MaybeError CommandBufferStateTracker::ValidateOperation(ValidationAspects requiredAspects) {
diff --git a/src/dawn_native/CommandBufferStateTracker.h b/src/dawn_native/CommandBufferStateTracker.h
index 9dd1edb..2419ded 100644
--- a/src/dawn_native/CommandBufferStateTracker.h
+++ b/src/dawn_native/CommandBufferStateTracker.h
@@ -29,8 +29,8 @@
       public:
         // Non-state-modifying validation functions
         MaybeError ValidateCanDispatch();
-        MaybeError ValidateCanDrawArrays();
-        MaybeError ValidateCanDrawElements();
+        MaybeError ValidateCanDraw();
+        MaybeError ValidateCanDrawIndexed();
 
         // State-modifying methods
         void SetComputePipeline(ComputePipelineBase* pipeline);
diff --git a/src/dawn_native/Commands.cpp b/src/dawn_native/Commands.cpp
index 455675a..6443fc8 100644
--- a/src/dawn_native/Commands.cpp
+++ b/src/dawn_native/Commands.cpp
@@ -53,13 +53,13 @@
                     DispatchCmd* dispatch = commands->NextCommand<DispatchCmd>();
                     dispatch->~DispatchCmd();
                 } break;
-                case Command::DrawArrays: {
-                    DrawArraysCmd* draw = commands->NextCommand<DrawArraysCmd>();
-                    draw->~DrawArraysCmd();
+                case Command::Draw: {
+                    DrawCmd* draw = commands->NextCommand<DrawCmd>();
+                    draw->~DrawCmd();
                 } break;
-                case Command::DrawElements: {
-                    DrawElementsCmd* draw = commands->NextCommand<DrawElementsCmd>();
-                    draw->~DrawElementsCmd();
+                case Command::DrawIndexed: {
+                    DrawIndexedCmd* draw = commands->NextCommand<DrawIndexedCmd>();
+                    draw->~DrawIndexedCmd();
                 } break;
                 case Command::EndComputePass: {
                     EndComputePassCmd* cmd = commands->NextCommand<EndComputePassCmd>();
@@ -142,12 +142,12 @@
                 commands->NextCommand<DispatchCmd>();
                 break;
 
-            case Command::DrawArrays:
-                commands->NextCommand<DrawArraysCmd>();
+            case Command::Draw:
+                commands->NextCommand<DrawCmd>();
                 break;
 
-            case Command::DrawElements:
-                commands->NextCommand<DrawElementsCmd>();
+            case Command::DrawIndexed:
+                commands->NextCommand<DrawIndexedCmd>();
                 break;
 
             case Command::EndComputePass:
diff --git a/src/dawn_native/Commands.h b/src/dawn_native/Commands.h
index 6ddf58d..4625774 100644
--- a/src/dawn_native/Commands.h
+++ b/src/dawn_native/Commands.h
@@ -33,8 +33,8 @@
         CopyBufferToTexture,
         CopyTextureToBuffer,
         Dispatch,
-        DrawArrays,
-        DrawElements,
+        Draw,
+        DrawIndexed,
         EndComputePass,
         EndRenderPass,
         SetComputePipeline,
@@ -93,14 +93,14 @@
         uint32_t z;
     };
 
-    struct DrawArraysCmd {
+    struct DrawCmd {
         uint32_t vertexCount;
         uint32_t instanceCount;
         uint32_t firstVertex;
         uint32_t firstInstance;
     };
 
-    struct DrawElementsCmd {
+    struct DrawIndexedCmd {
         uint32_t indexCount;
         uint32_t instanceCount;
         uint32_t firstIndex;
diff --git a/src/dawn_native/RenderPassEncoder.cpp b/src/dawn_native/RenderPassEncoder.cpp
index e8f8ac5..ad94bc1 100644
--- a/src/dawn_native/RenderPassEncoder.cpp
+++ b/src/dawn_native/RenderPassEncoder.cpp
@@ -29,32 +29,32 @@
         : ProgrammablePassEncoder(device, topLevelBuilder, allocator) {
     }
 
-    void RenderPassEncoderBase::DrawArrays(uint32_t vertexCount,
-                                           uint32_t instanceCount,
-                                           uint32_t firstVertex,
-                                           uint32_t firstInstance) {
+    void RenderPassEncoderBase::Draw(uint32_t vertexCount,
+                                     uint32_t instanceCount,
+                                     uint32_t firstVertex,
+                                     uint32_t firstInstance) {
         if (mTopLevelBuilder->ConsumedError(ValidateCanRecordCommands())) {
             return;
         }
 
-        DrawArraysCmd* draw = mAllocator->Allocate<DrawArraysCmd>(Command::DrawArrays);
-        new (draw) DrawArraysCmd;
+        DrawCmd* draw = mAllocator->Allocate<DrawCmd>(Command::Draw);
+        new (draw) DrawCmd;
         draw->vertexCount = vertexCount;
         draw->instanceCount = instanceCount;
         draw->firstVertex = firstVertex;
         draw->firstInstance = firstInstance;
     }
 
-    void RenderPassEncoderBase::DrawElements(uint32_t indexCount,
-                                             uint32_t instanceCount,
-                                             uint32_t firstIndex,
-                                             uint32_t firstInstance) {
+    void RenderPassEncoderBase::DrawIndexed(uint32_t indexCount,
+                                            uint32_t instanceCount,
+                                            uint32_t firstIndex,
+                                            uint32_t firstInstance) {
         if (mTopLevelBuilder->ConsumedError(ValidateCanRecordCommands())) {
             return;
         }
 
-        DrawElementsCmd* draw = mAllocator->Allocate<DrawElementsCmd>(Command::DrawElements);
-        new (draw) DrawElementsCmd;
+        DrawIndexedCmd* draw = mAllocator->Allocate<DrawIndexedCmd>(Command::DrawIndexed);
+        new (draw) DrawIndexedCmd;
         draw->indexCount = indexCount;
         draw->instanceCount = instanceCount;
         draw->firstIndex = firstIndex;
diff --git a/src/dawn_native/RenderPassEncoder.h b/src/dawn_native/RenderPassEncoder.h
index c2bdad8..d8b618f 100644
--- a/src/dawn_native/RenderPassEncoder.h
+++ b/src/dawn_native/RenderPassEncoder.h
@@ -30,14 +30,14 @@
                               CommandBufferBuilder* topLevelBuilder,
                               CommandAllocator* allocator);
 
-        void DrawArrays(uint32_t vertexCount,
-                        uint32_t instanceCount,
-                        uint32_t firstVertex,
-                        uint32_t firstInstance);
-        void DrawElements(uint32_t vertexCount,
-                          uint32_t instanceCount,
-                          uint32_t firstIndex,
-                          uint32_t firstInstance);
+        void Draw(uint32_t vertexCount,
+                  uint32_t instanceCount,
+                  uint32_t firstVertex,
+                  uint32_t firstInstance);
+        void DrawIndexed(uint32_t vertexCount,
+                         uint32_t instanceCount,
+                         uint32_t firstIndex,
+                         uint32_t firstInstance);
 
         void SetRenderPipeline(RenderPipelineBase* pipeline);
 
diff --git a/src/dawn_native/d3d12/CommandBufferD3D12.cpp b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
index 8b90046..2044097 100644
--- a/src/dawn_native/d3d12/CommandBufferD3D12.cpp
+++ b/src/dawn_native/d3d12/CommandBufferD3D12.cpp
@@ -540,14 +540,14 @@
                     return;
                 } break;
 
-                case Command::DrawArrays: {
-                    DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
+                case Command::Draw: {
+                    DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
                     commandList->DrawInstanced(draw->vertexCount, draw->instanceCount,
                                                draw->firstVertex, draw->firstInstance);
                 } break;
 
-                case Command::DrawElements: {
-                    DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
+                case Command::DrawIndexed: {
+                    DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
                     commandList->DrawIndexedInstanced(draw->indexCount, draw->instanceCount,
                                                       draw->firstIndex, 0, draw->firstInstance);
                 } break;
diff --git a/src/dawn_native/metal/CommandBufferMTL.mm b/src/dawn_native/metal/CommandBufferMTL.mm
index 472277f..03066ed 100644
--- a/src/dawn_native/metal/CommandBufferMTL.mm
+++ b/src/dawn_native/metal/CommandBufferMTL.mm
@@ -403,8 +403,8 @@
                     return;
                 } break;
 
-                case Command::DrawArrays: {
-                    DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
+                case Command::Draw: {
+                    DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
 
                     [encoder drawPrimitives:lastPipeline->GetMTLPrimitiveTopology()
                                 vertexStart:draw->firstVertex
@@ -413,8 +413,8 @@
                                baseInstance:draw->firstInstance];
                 } break;
 
-                case Command::DrawElements: {
-                    DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
+                case Command::DrawIndexed: {
+                    DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
                     size_t formatSize = IndexFormatSize(lastPipeline->GetIndexFormat());
 
                     [encoder
diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp
index 080c4a4..7ac7bdf 100644
--- a/src/dawn_native/opengl/CommandBufferGL.cpp
+++ b/src/dawn_native/opengl/CommandBufferGL.cpp
@@ -583,8 +583,8 @@
                     return;
                 } break;
 
-                case Command::DrawArrays: {
-                    DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
+                case Command::Draw: {
+                    DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
                     pushConstants.Apply(lastPipeline, lastPipeline);
                     inputBuffers.Apply();
 
@@ -600,8 +600,8 @@
                     }
                 } break;
 
-                case Command::DrawElements: {
-                    DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
+                case Command::DrawIndexed: {
+                    DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
                     pushConstants.Apply(lastPipeline, lastPipeline);
                     inputBuffers.Apply();
 
diff --git a/src/dawn_native/vulkan/CommandBufferVk.cpp b/src/dawn_native/vulkan/CommandBufferVk.cpp
index 23dfd55..9ebdb70 100644
--- a/src/dawn_native/vulkan/CommandBufferVk.cpp
+++ b/src/dawn_native/vulkan/CommandBufferVk.cpp
@@ -320,16 +320,16 @@
                     return;
                 } break;
 
-                case Command::DrawArrays: {
-                    DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
+                case Command::Draw: {
+                    DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
 
                     descriptorSets.Flush(device, commands, VK_PIPELINE_BIND_POINT_GRAPHICS);
                     device->fn.CmdDraw(commands, draw->vertexCount, draw->instanceCount,
                                        draw->firstVertex, draw->firstInstance);
                 } break;
 
-                case Command::DrawElements: {
-                    DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
+                case Command::DrawIndexed: {
+                    DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
 
                     descriptorSets.Flush(device, commands, VK_PIPELINE_BIND_POINT_GRAPHICS);
                     uint32_t vertexOffset = 0;
diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp
index 06b2af0..706cb9c 100644
--- a/src/tests/end2end/BindGroupTests.cpp
+++ b/src/tests/end2end/BindGroupTests.cpp
@@ -143,7 +143,7 @@
     dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
     pass.SetRenderPipeline(pipeline);
     pass.SetBindGroup(0, bindGroup);
-    pass.DrawArrays(3, 1, 0, 0);
+    pass.Draw(3, 1, 0, 0);
     pass.EndPass();
 
     dawn::CommandBuffer commands = builder.GetResult();
@@ -257,7 +257,7 @@
     dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
     pass.SetRenderPipeline(pipeline);
     pass.SetBindGroup(0, bindGroup);
-    pass.DrawArrays(3, 1, 0, 0);
+    pass.Draw(3, 1, 0, 0);
     pass.EndPass();
 
     dawn::CommandBuffer commands = builder.GetResult();
diff --git a/src/tests/end2end/BlendStateTests.cpp b/src/tests/end2end/BlendStateTests.cpp
index e93fec4..09d4f62 100644
--- a/src/tests/end2end/BlendStateTests.cpp
+++ b/src/tests/end2end/BlendStateTests.cpp
@@ -107,13 +107,13 @@
                 // First use the base pipeline to draw a triangle with no blending
                 pass.SetRenderPipeline(basePipeline);
                 pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { base } })));
-                pass.DrawArrays(3, 1, 0, 0);
+                pass.Draw(3, 1, 0, 0);
 
                 // Then use the test pipeline to draw the test triangle with blending
                 pass.SetRenderPipeline(testPipeline);
                 pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { triangle.color } })));
                 pass.SetBlendColor(triangle.blendFactor[0], triangle.blendFactor[1], triangle.blendFactor[2], triangle.blendFactor[3]);
-                pass.DrawArrays(3, 1, 0, 0);
+                pass.Draw(3, 1, 0, 0);
                 pass.EndPass();
             }
 
@@ -690,7 +690,7 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
             pass.SetRenderPipeline(testPipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { base } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.EndPass();
         }
 
@@ -826,11 +826,11 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
             pass.SetRenderPipeline(basePipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 4>({ { base, base, base, base } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
 
             pass.SetRenderPipeline(testPipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 4>({ { color0, color1, color2, color3 } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.EndPass();
         }
 
@@ -892,10 +892,10 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
             pass.SetRenderPipeline(basePipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.SetRenderPipeline(testPipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.EndPass();
         }
 
@@ -912,11 +912,11 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
             pass.SetRenderPipeline(basePipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.SetRenderPipeline(testPipeline);
             pass.SetBlendColor(1, 1, 1, 1);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.EndPass();
         }
 
@@ -933,21 +933,21 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
             pass.SetRenderPipeline(basePipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.SetRenderPipeline(testPipeline);
             pass.SetBlendColor(1, 1, 1, 1);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.EndPass();
         }
         {
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
             pass.SetRenderPipeline(basePipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.SetRenderPipeline(testPipeline);
             pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
-            pass.DrawArrays(3, 1, 0, 0);
+            pass.Draw(3, 1, 0, 0);
             pass.EndPass();
         }
 
diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp
index 4a72600..e6a339c 100644
--- a/src/tests/end2end/DepthStencilStateTests.cpp
+++ b/src/tests/end2end/DepthStencilStateTests.cpp
@@ -225,7 +225,7 @@
                 pass.SetRenderPipeline(pipeline);
                 pass.SetStencilReference(test.stencil);  // Set the stencil reference
                 pass.SetBindGroup(0, bindGroup);         // Set the bind group which contains color and depth data
-                pass.DrawArrays(6, 1, 0, 0);
+                pass.Draw(6, 1, 0, 0);
             }
             pass.EndPass();
 
diff --git a/src/tests/end2end/DrawElementsTests.cpp b/src/tests/end2end/DrawElementsTests.cpp
index c26b44c..69f7538 100644
--- a/src/tests/end2end/DrawElementsTests.cpp
+++ b/src/tests/end2end/DrawElementsTests.cpp
@@ -80,7 +80,7 @@
                 pass.SetRenderPipeline(pipeline);
                 pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
                 pass.SetIndexBuffer(indexBuffer, 0);
-                pass.DrawElements(indexCount, instanceCount, firstIndex, firstInstance);
+                pass.DrawIndexed(indexCount, instanceCount, firstIndex, firstInstance);
                 pass.EndPass();
             }
 
diff --git a/src/tests/end2end/IndexFormatTests.cpp b/src/tests/end2end/IndexFormatTests.cpp
index ae60663..2dbfb45 100644
--- a/src/tests/end2end/IndexFormatTests.cpp
+++ b/src/tests/end2end/IndexFormatTests.cpp
@@ -84,7 +84,7 @@
         pass.SetRenderPipeline(pipeline);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
         pass.SetIndexBuffer(indexBuffer, 0);
-        pass.DrawElements(3, 1, 0, 0);
+        pass.DrawIndexed(3, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -115,7 +115,7 @@
         pass.SetRenderPipeline(pipeline);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
         pass.SetIndexBuffer(indexBuffer, 0);
-        pass.DrawElements(3, 1, 0, 0);
+        pass.DrawIndexed(3, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -159,7 +159,7 @@
         pass.SetRenderPipeline(pipeline);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
         pass.SetIndexBuffer(indexBuffer, 0);
-        pass.DrawElements(7, 1, 0, 0);
+        pass.DrawIndexed(7, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -193,7 +193,7 @@
         pass.SetRenderPipeline(pipeline);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
         pass.SetIndexBuffer(indexBuffer, 0);
-        pass.DrawElements(7, 1, 0, 0);
+        pass.DrawIndexed(7, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -233,7 +233,7 @@
         pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
         pass.SetIndexBuffer(indexBuffer, 0);
         pass.SetRenderPipeline(pipeline32);
-        pass.DrawElements(3, 1, 0, 0);
+        pass.DrawIndexed(3, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -267,7 +267,7 @@
         pass.SetIndexBuffer(indexBuffer, 0);
         pass.SetRenderPipeline(pipeline);
         pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
-        pass.DrawElements(3, 1, 0, 0);
+        pass.DrawIndexed(3, 1, 0, 0);
         pass.EndPass();
     }
 
diff --git a/src/tests/end2end/InputStateTests.cpp b/src/tests/end2end/InputStateTests.cpp
index 5abe632..5454220 100644
--- a/src/tests/end2end/InputStateTests.cpp
+++ b/src/tests/end2end/InputStateTests.cpp
@@ -176,7 +176,7 @@
                 pass.SetVertexBuffers(buffer.location, 1, buffer.buffer, &zeroOffset);
             }
 
-            pass.DrawArrays(triangles * 3, instances, 0, 0);
+            pass.Draw(triangles * 3, instances, 0, 0);
             pass.EndPass();
 
             dawn::CommandBuffer commands = builder.GetResult();
diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp
index 696077b..e71e43e 100644
--- a/src/tests/end2end/PrimitiveTopologyTests.cpp
+++ b/src/tests/end2end/PrimitiveTopologyTests.cpp
@@ -199,7 +199,7 @@
                 dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
                 pass.SetRenderPipeline(pipeline);
                 pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
-                pass.DrawArrays(6, 1, 0, 0);
+                pass.Draw(6, 1, 0, 0);
                 pass.EndPass();
             }
 
diff --git a/src/tests/end2end/PushConstantTests.cpp b/src/tests/end2end/PushConstantTests.cpp
index e101fcd..668dbdb 100644
--- a/src/tests/end2end/PushConstantTests.cpp
+++ b/src/tests/end2end/PushConstantTests.cpp
@@ -258,7 +258,7 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         // Test render push constants are set to zero by default.
         pass.SetRenderPipeline(pipeline);
-        pass.DrawArrays(1, 1, 0, 0);
+        pass.Draw(1, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -386,7 +386,7 @@
         pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, 1, &one);
         pass.SetPushConstants(dawn::ShaderStageBit::Fragment, 0, 1, &two);
         pass.SetRenderPipeline(pipeline);
-        pass.DrawArrays(1, 1, 0, 0);
+        pass.Draw(1, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -411,7 +411,7 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetPushConstants(dawn::ShaderStageBit::Vertex | dawn::ShaderStageBit::Fragment, 0, 1, &two);
         pass.SetRenderPipeline(pipeline);
-        pass.DrawArrays(1, 1, 0, 0);
+        pass.Draw(1, 1, 0, 0);
         pass.EndPass();
     }
 
diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp
index d8efd8e..a4f25ae 100644
--- a/src/tests/end2end/RenderPassLoadOpTests.cpp
+++ b/src/tests/end2end/RenderPassLoadOpTests.cpp
@@ -40,7 +40,7 @@
                 .GetResult();
 
             pass->SetRenderPipeline(renderPipeline);
-            pass->DrawArrays(6, 1, 0, 0);
+            pass->Draw(6, 1, 0, 0);
         }
 
     private:
diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp
index 2bdad06..1d93783 100644
--- a/src/tests/end2end/SamplerTests.cpp
+++ b/src/tests/end2end/SamplerTests.cpp
@@ -136,7 +136,7 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(mRenderPass.renderPassInfo);
             pass.SetRenderPipeline(mPipeline);
             pass.SetBindGroup(0, bindGroup);
-            pass.DrawArrays(6, 1, 0, 0);
+            pass.Draw(6, 1, 0, 0);
             pass.EndPass();
         }
 
diff --git a/src/tests/end2end/ScissorTests.cpp b/src/tests/end2end/ScissorTests.cpp
index 5052c4c..f75eb4f 100644
--- a/src/tests/end2end/ScissorTests.cpp
+++ b/src/tests/end2end/ScissorTests.cpp
@@ -55,7 +55,7 @@
     {
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetRenderPipeline(pipeline);
-        pass.DrawArrays(6, 1, 0, 0);
+        pass.Draw(6, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -78,7 +78,7 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetRenderPipeline(pipeline);
         pass.SetScissorRect(0, 0, 200, 200);
-        pass.DrawArrays(6, 1, 0, 0);
+        pass.Draw(6, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -104,7 +104,7 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetRenderPipeline(pipeline);
         pass.SetScissorRect(0, 0, 0, 0);
-        pass.DrawArrays(6, 1, 0, 0);
+        pass.Draw(6, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -132,7 +132,7 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetRenderPipeline(pipeline);
         pass.SetScissorRect(kX, kY, kW, kH);
-        pass.DrawArrays(6, 1, 0, 0);
+        pass.Draw(6, 1, 0, 0);
         pass.EndPass();
     }
 
@@ -163,7 +163,7 @@
     {
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetRenderPipeline(pipeline);
-        pass.DrawArrays(6, 1, 0, 0);
+        pass.Draw(6, 1, 0, 0);
         pass.EndPass();
     }
 
diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp
index 01f2a00..7485c4f 100644
--- a/src/tests/end2end/TextureViewTests.cpp
+++ b/src/tests/end2end/TextureViewTests.cpp
@@ -175,7 +175,7 @@
             dawn::RenderPassEncoder pass = builder.BeginRenderPass(mRenderPass.renderPassInfo);
             pass.SetRenderPipeline(pipeline);
             pass.SetBindGroup(0, bindGroup);
-            pass.DrawArrays(6, 1, 0, 0);
+            pass.Draw(6, 1, 0, 0);
             pass.EndPass();
         }
 
@@ -512,7 +512,7 @@
             dawn::RenderPassEncoder pass =
                 commandBufferBuilder.BeginRenderPass(renderPassInfo);
             pass.SetRenderPipeline(oneColorPipeline);
-            pass.DrawArrays(6, 1, 0, 0);
+            pass.Draw(6, 1, 0, 0);
             pass.EndPass();
         }
 
diff --git a/src/tests/end2end/ViewportOrientationTests.cpp b/src/tests/end2end/ViewportOrientationTests.cpp
index e85f5ac..366763d 100644
--- a/src/tests/end2end/ViewportOrientationTests.cpp
+++ b/src/tests/end2end/ViewportOrientationTests.cpp
@@ -46,7 +46,7 @@
     {
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
         pass.SetRenderPipeline(pipeline);
-        pass.DrawArrays(1, 1, 0, 0);
+        pass.Draw(1, 1, 0, 0);
         pass.EndPass();
     }
 
diff --git a/src/tests/unittests/validation/VertexBufferValidationTests.cpp b/src/tests/unittests/validation/VertexBufferValidationTests.cpp
index 014e7b0..63b9a56 100644
--- a/src/tests/unittests/validation/VertexBufferValidationTests.cpp
+++ b/src/tests/unittests/validation/VertexBufferValidationTests.cpp
@@ -108,7 +108,7 @@
     {
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
         pass.SetRenderPipeline(pipeline1);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.EndPass();
     }
     builder.GetResult();
@@ -119,9 +119,9 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
         pass.SetRenderPipeline(pipeline2);
         pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.SetRenderPipeline(pipeline1);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.EndPass();
     }
     builder.GetResult();
@@ -146,14 +146,14 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
         pass.SetRenderPipeline(pipeline2);
         pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.EndPass();
     }
     {
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
         pass.SetRenderPipeline(pipeline1);
         pass.SetVertexBuffers(0, 1, vertexBuffers.data(), offsets);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.EndPass();
     }
     builder.GetResult();
@@ -164,13 +164,13 @@
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
         pass.SetRenderPipeline(pipeline2);
         pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.EndPass();
     }
     {
         dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
         pass.SetRenderPipeline(pipeline1);
-        pass.DrawArrays(3, 1, 0, 0);
+        pass.Draw(3, 1, 0, 0);
         pass.EndPass();
     }
     builder.GetResult();