mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Remove deprecated zero default size of buffer mapAsync
In this patch the deprecated usage of size=0 as default size is removed. Using size=0 in buffer.mapAsync now result in a zero size mapping, instead of the default size. Bug: dawn:1159 Change-Id: Ie8badc5eb7440980d0df3d3d27867e710e77f44b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67743 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
12e51f6efa
commit
c38c4d32f4
@@ -219,21 +219,13 @@ TEST_F(BufferValidationTest, MapAsync_OffsetSizeOOB) {
|
||||
// Valid case: empty range at the end of the buffer is ok.
|
||||
{
|
||||
wgpu::Buffer buffer = CreateMapReadBuffer(8);
|
||||
// Currently using size=0 will cause a deprecation warning, and result in default size.
|
||||
// After the deprecation is finished, size=0 will result in a mapping with zero size
|
||||
// exactly.
|
||||
// TODO(dawn:1058): Remove the deprecation warning expection after the removal.
|
||||
EXPECT_DEPRECATION_WARNING(buffer.MapAsync(wgpu::MapMode::Read, 8, 0, nullptr, nullptr));
|
||||
buffer.MapAsync(wgpu::MapMode::Read, 8, 0, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// Error case, offset is larger than the buffer size (even if size is 0).
|
||||
{
|
||||
wgpu::Buffer buffer = CreateMapReadBuffer(12);
|
||||
// Currently using size=0 will cause a deprecation warning, and result in default size.
|
||||
// After the deprecation is finished, size=0 will result in a mapping with zero size
|
||||
// exactly.
|
||||
// TODO(dawn:1058): Remove the deprecation warning expection after the removal.
|
||||
EXPECT_DEPRECATION_WARNING(AssertMapAsyncError(buffer, wgpu::MapMode::Read, 16, 0));
|
||||
AssertMapAsyncError(buffer, wgpu::MapMode::Read, 16, 0);
|
||||
}
|
||||
|
||||
// Error case, offset + size is larger than the buffer
|
||||
|
||||
Reference in New Issue
Block a user