Deprecation of using 0 as default size in buffer mapAsync

For size parameter in mapAsync, use wgpu::kWholeMapSize rather than 0 to
indicate using the default size, i.e. remaining buffer size after
offset. Using size=0 is still available but will cause a deprecation
warning.

Bug: dawn:1159
Change-Id: I474d87ecae4a54ceb28d636f883a6233c91f16fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66284
Auto-Submit: Zhaoming Jiang <zhaoming.jiang@intel.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Zhaoming Jiang
2021-10-18 05:30:39 +00:00
committed by Dawn LUCI CQ
parent 180ec459ea
commit 2a5b981a87
9 changed files with 66 additions and 14 deletions

View File

@@ -166,7 +166,7 @@ namespace dawn_wire { namespace client {
}
// Handle the defaulting of size required by WebGPU.
if (size == 0 && offset < mSize) {
if ((size == WGPU_WHOLE_MAP_SIZE) && (offset <= mSize)) {
size = mSize - offset;
}