Roll third_party/gpuweb/ a118ba5f2..4e4692ab9 (22 commits)

- Add experimental copyBufferToBuffer overloads
- Remove GPUAdapter isFallbackAdapter attribute

https://github.com/gpuweb/gpuweb/compare/a118ba5f2afa...4e4692ab9d92

Created with:
  roll-dep third_party/gpuweb

Bug: 405883444
Change-Id: I3cbaea0c39efcfda2b67e609e2d25281619681f4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/233334
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Fr <beaufort.francois@gmail.com>
diff --git a/DEPS b/DEPS
index 7a81314..ef434d9 100644
--- a/DEPS
+++ b/DEPS
@@ -373,7 +373,7 @@
     'condition': 'dawn_node',
   },
   'third_party/gpuweb': {
-    'url': '{github_git}/gpuweb/gpuweb.git@a118ba5f2afaad9f763fe09c3a53f96cd9106cb1',
+    'url': '{github_git}/gpuweb/gpuweb.git@4e4692ab9d920c0a50a09533d5bb58e02babb0b2',
     'condition': 'dawn_node',
   },
 
diff --git a/src/dawn/node/binding/GPUAdapter.cpp b/src/dawn/node/binding/GPUAdapter.cpp
index ceeaae8..a38775d 100644
--- a/src/dawn/node/binding/GPUAdapter.cpp
+++ b/src/dawn/node/binding/GPUAdapter.cpp
@@ -133,12 +133,6 @@
     return interop::GPUAdapterInfo::Create<GPUAdapterInfo>(env, info);
 }
 
-bool GPUAdapter::getIsFallbackAdapter(Napi::Env) {
-    wgpu::AdapterInfo adapterInfo = {};
-    adapter_.GetInfo(&adapterInfo);
-    return adapterInfo.adapterType == wgpu::AdapterType::CPU;
-}
-
 namespace {
 // Returns a string representation of the wgpu::ErrorType
 const char* str(wgpu::ErrorType ty) {
diff --git a/src/dawn/node/binding/GPUAdapter.h b/src/dawn/node/binding/GPUAdapter.h
index 1d88a92..f6b0dc0 100644
--- a/src/dawn/node/binding/GPUAdapter.h
+++ b/src/dawn/node/binding/GPUAdapter.h
@@ -52,7 +52,6 @@
     interop::Interface<interop::GPUSupportedFeatures> getFeatures(Napi::Env) override;
     interop::Interface<interop::GPUSupportedLimits> getLimits(Napi::Env) override;
     interop::Interface<interop::GPUAdapterInfo> getInfo(Napi::Env) override;
-    bool getIsFallbackAdapter(Napi::Env) override;
 
   private:
     wgpu::Adapter adapter_;
diff --git a/src/dawn/node/binding/GPUCommandEncoder.cpp b/src/dawn/node/binding/GPUCommandEncoder.cpp
index 167dee3..f2aacfb 100644
--- a/src/dawn/node/binding/GPUCommandEncoder.cpp
+++ b/src/dawn/node/binding/GPUCommandEncoder.cpp
@@ -102,10 +102,17 @@
 
 void GPUCommandEncoder::copyBufferToBuffer(Napi::Env env,
                                            interop::Interface<interop::GPUBuffer> source,
+                                           interop::Interface<interop::GPUBuffer> destination,
+                                           std::optional<interop::GPUSize64> size) {
+    copyBufferToBuffer(env, source, 0, destination, 0, size);
+}
+
+void GPUCommandEncoder::copyBufferToBuffer(Napi::Env env,
+                                           interop::Interface<interop::GPUBuffer> source,
                                            interop::GPUSize64 sourceOffset,
                                            interop::Interface<interop::GPUBuffer> destination,
                                            interop::GPUSize64 destinationOffset,
-                                           interop::GPUSize64 size) {
+                                           std::optional<interop::GPUSize64> size) {
     Converter conv(env);
 
     wgpu::Buffer src{};
@@ -115,7 +122,17 @@
         return;
     }
 
-    enc_.CopyBufferToBuffer(src, sourceOffset, dst, destinationOffset, size);
+    // Underflow in the size calculation is acceptable because a GPU validation
+    // error will be fired if the resulting size is a very large positive
+    // integer. The offset is validated to be less than the buffer size before
+    // we compute the remaining size in the buffer.
+    uint64_t rangeSize = size.has_value() ? size.value().value : (src.GetSize() - sourceOffset);
+    uint64_t s = wgpu::kWholeSize;
+    if (!conv(s, rangeSize)) {
+        return;
+    }
+
+    enc_.CopyBufferToBuffer(src, sourceOffset, dst, destinationOffset, s);
 }
 
 void GPUCommandEncoder::copyBufferToTexture(Napi::Env env,
diff --git a/src/dawn/node/binding/GPUCommandEncoder.h b/src/dawn/node/binding/GPUCommandEncoder.h
index 14fc2c2..4c08140 100644
--- a/src/dawn/node/binding/GPUCommandEncoder.h
+++ b/src/dawn/node/binding/GPUCommandEncoder.h
@@ -57,12 +57,16 @@
                      interop::Interface<interop::GPUBuffer> buffer,
                      interop::GPUSize64 offset,
                      std::optional<interop::GPUSize64> size) override;
+    void copyBufferToBuffer(Napi::Env env,
+                            interop::Interface<interop::GPUBuffer> source,
+                            interop::Interface<interop::GPUBuffer> destination,
+                            std::optional<interop::GPUSize64> size) override;
     void copyBufferToBuffer(Napi::Env,
                             interop::Interface<interop::GPUBuffer> source,
                             interop::GPUSize64 sourceOffset,
                             interop::Interface<interop::GPUBuffer> destination,
                             interop::GPUSize64 destinationOffset,
-                            interop::GPUSize64 size) override;
+                            std::optional<interop::GPUSize64> size) override;
     void copyBufferToTexture(Napi::Env,
                              interop::GPUTexelCopyBufferInfo source,
                              interop::GPUTexelCopyTextureInfo destination,
diff --git a/src/dawn/node/interop/DawnExtensions.idl b/src/dawn/node/interop/DawnExtensions.idl
index 2d535f2..39ed74a 100644
--- a/src/dawn/node/interop/DawnExtensions.idl
+++ b/src/dawn/node/interop/DawnExtensions.idl
@@ -53,7 +53,6 @@
 };
 
 interface GPUAdapterInfo {
-    readonly attribute boolean isFallbackAdapter;
     [SameObject] readonly attribute FrozenArray<GPUSubgroupMatrixConfig> subgroupMatrixConfigs;
 };
 
diff --git a/third_party/gpuweb b/third_party/gpuweb
index a118ba5..4e4692a 160000
--- a/third_party/gpuweb
+++ b/third_party/gpuweb
@@ -1 +1 @@
-Subproject commit a118ba5f2afaad9f763fe09c3a53f96cd9106cb1
+Subproject commit 4e4692ab9d920c0a50a09533d5bb58e02babb0b2