Implementing Queue::WriteTexture in Metal

Added implementation of writeTexture in Metal. It's using a
staging buffer instead of writing directly from the CPU to
the texture, because Dawn uses the private storage mode for
most of the Metal textures.

Bug: dawn:483
Change-Id: I6b85ee8bbe343881337bdb203a122dc1f1523177
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24581
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/CommandValidation.h b/src/dawn_native/CommandValidation.h
index cee2b13..72d876d 100644
--- a/src/dawn_native/CommandValidation.h
+++ b/src/dawn_native/CommandValidation.h
@@ -40,6 +40,11 @@
 
     MaybeError ValidateTimestampQuery(QuerySetBase* querySet, uint32_t queryIndex);
 
+    uint32_t ComputeRequiredBytesInCopy(const Format& textureFormat,
+                                        const Extent3D& copySize,
+                                        uint32_t bytesPerRow,
+                                        uint32_t rowsPerImage);
+
     MaybeError ValidateLinearTextureData(const TextureDataLayout& layout,
                                          uint64_t byteSize,
                                          const Format& format,