You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- : The offset, in bytes, into the `source` to begin copying from.
28
30
-`destination`
29
31
- : The {{domxref("GPUBuffer")}} to copy to.
30
-
-`destinationOffset`
32
+
-`destinationOffset` {{optional_inline}}
31
33
- : The offset, in bytes, into the `destination` to begin copying to.
32
-
-`size`
34
+
-`size` {{optional_inline}}
33
35
- : The number of bytes to copy.
34
36
37
+
> [!NOTE]
38
+
> The `sourceOffset` and `destinationOffset` can be omitted if you are copying part of the source buffer at a `0` offset in both the source and destination buffers. The `sourceOffset`, `destinationOffset`, and `size` can be omitted if you are copying the entire source buffer to the destination buffer.
39
+
35
40
### Return value
36
41
37
42
None ({{jsxref("Undefined")}}).
@@ -49,14 +54,14 @@ The following criteria must be met when calling **`copyBufferToBuffer()`**, othe
49
54
50
55
## Examples
51
56
52
-
In our [basic compute demo](https://mdn.github.io/dom-examples/webgpu-compute-demo/), we use `copyBufferToBuffer()` to copy the contents of our `output` buffer to the `stagingBuffer`.
57
+
In our [basic compute demo](https://mdn.github.io/dom-examples/webgpu-compute-demo/), we use `copyBufferToBuffer()` to copy the contents of our `outputBuffer` to the `stagingBuffer`.
53
58
54
59
```js
55
60
// …
56
61
57
62
// Create an output buffer to read GPU calculations to, and a staging buffer to be mapped for JavaScript access
Copy file name to clipboardExpand all lines: files/en-us/web/api/gpudevice/createbindgroup/index.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ createBindGroup(descriptor)
32
32
-`GPUBufferBinding` (which wraps a {{domxref("GPUBuffer")}}; see [GPUBufferBinding objects](#gpubufferbinding_objects) for a definition)
33
33
- {{domxref("GPUExternalTexture")}}
34
34
- {{domxref("GPUSampler")}}
35
-
- {{domxref("GPUTextureView")}}
35
+
- {{domxref("GPUTextureView")}}; can be used in place of a `GPUExternalTexture` provided it is compatible (a 2D format with a single subresource, that is, [`dimension: "2d"`](/en-US/docs/Web/API/GPUTexture/createView#dimension)).
36
36
-`label` {{optional_inline}}
37
37
- : A string providing a label that can be used to identify the object, for example in {{domxref("GPUError")}} messages or console warnings.
0 commit comments