mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Rename STRIDE_UNDEFINED to COPY_STRIDE_UNDEFINED
Per https://github.com/webgpu-native/webgpu-headers/pull/71 Keeps but deprecates WGPU_STRIDE_UNDEFINED/wgpu::kStrideUndefined. Bug: dawn:520 Change-Id: Ied162ec39454fac3d16a3782c9ed6d2f68c1d41d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34926 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Auto-Submit: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
fea4c14580
commit
cf820d79ef
@@ -379,7 +379,7 @@ TEST_F(CopyCommandTest_B2T, Success) {
|
||||
TestB2TCopy(utils::Expectation::Success, source, bufferSize - 4, 256, 1, destination, 0,
|
||||
{0, 0, 0}, {1, 1, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, bufferSize - 4, 256,
|
||||
wgpu::kStrideUndefined, destination, 0, {0, 0, 0}, {1, 1, 1});
|
||||
wgpu::kCopyStrideUndefined, destination, 0, {0, 0, 0}, {1, 1, 1});
|
||||
}
|
||||
|
||||
// Copies with a 256-byte aligned bytes per row but unaligned texture region
|
||||
@@ -397,15 +397,15 @@ TEST_F(CopyCommandTest_B2T, Success) {
|
||||
|
||||
// bytesPerRow is undefined
|
||||
{
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kStrideUndefined, 2, destination,
|
||||
0, {0, 0, 0}, {1, 1, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kStrideUndefined, 2, destination,
|
||||
0, {0, 0, 0}, {3, 1, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kCopyStrideUndefined, 2,
|
||||
destination, 0, {0, 0, 0}, {1, 1, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kCopyStrideUndefined, 2,
|
||||
destination, 0, {0, 0, 0}, {3, 1, 1});
|
||||
// Fail because height or depth is greater than 1:
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, wgpu::kStrideUndefined, 2, destination,
|
||||
0, {0, 0, 0}, {1, 2, 1});
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, wgpu::kStrideUndefined, 2, destination,
|
||||
0, {0, 0, 0}, {1, 1, 2});
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, wgpu::kCopyStrideUndefined, 2,
|
||||
destination, 0, {0, 0, 0}, {1, 2, 1});
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, wgpu::kCopyStrideUndefined, 2,
|
||||
destination, 0, {0, 0, 0}, {1, 1, 2});
|
||||
}
|
||||
|
||||
// Empty copies are valid
|
||||
@@ -413,23 +413,23 @@ TEST_F(CopyCommandTest_B2T, Success) {
|
||||
// An empty copy
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 0, 0, destination, 0, {0, 0, 0},
|
||||
{0, 0, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kStrideUndefined, 0, destination,
|
||||
0, {0, 0, 0}, {0, 0, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kCopyStrideUndefined, 0,
|
||||
destination, 0, {0, 0, 0}, {0, 0, 1});
|
||||
// An empty copy with depth = 0
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 0, 0, destination, 0, {0, 0, 0},
|
||||
{0, 0, 0});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kStrideUndefined, 0, destination,
|
||||
0, {0, 0, 0}, {0, 0, 0});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kCopyStrideUndefined, 0,
|
||||
destination, 0, {0, 0, 0}, {0, 0, 0});
|
||||
// An empty copy touching the end of the buffer
|
||||
TestB2TCopy(utils::Expectation::Success, source, bufferSize, 0, 0, destination, 0,
|
||||
{0, 0, 0}, {0, 0, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, bufferSize, wgpu::kStrideUndefined, 0,
|
||||
TestB2TCopy(utils::Expectation::Success, source, bufferSize, wgpu::kCopyStrideUndefined, 0,
|
||||
destination, 0, {0, 0, 0}, {0, 0, 1});
|
||||
// An empty copy touching the side of the texture
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 0, 0, destination, 0, {16, 16, 0},
|
||||
{0, 0, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kStrideUndefined, 0, destination,
|
||||
0, {16, 16, 0}, {0, 0, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, wgpu::kCopyStrideUndefined, 0,
|
||||
destination, 0, {16, 16, 0}, {0, 0, 1});
|
||||
|
||||
// An empty copy with depth = 1 and bytesPerRow > 0
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, kTextureBytesPerRowAlignment, 0,
|
||||
@@ -599,11 +599,11 @@ TEST_F(CopyCommandTest_B2T, RowsPerImageConstraints) {
|
||||
destination, 0, {0, 0, 0}, {4, 4, 1}));
|
||||
|
||||
// rowsPerImage is undefined
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 256, wgpu::kStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {4, 4, 1});
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 256, wgpu::kCopyStrideUndefined,
|
||||
destination, 0, {0, 0, 0}, {4, 4, 1});
|
||||
// Fail because depth > 1:
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, wgpu::kStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {4, 4, 2});
|
||||
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, wgpu::kCopyStrideUndefined,
|
||||
destination, 0, {0, 0, 0}, {4, 4, 2});
|
||||
|
||||
// rowsPerImage is equal to copy height (Valid)
|
||||
TestB2TCopy(utils::Expectation::Success, source, 0, 256, 4, destination, 0, {0, 0, 0},
|
||||
@@ -942,7 +942,7 @@ TEST_F(CopyCommandTest_T2B, Success) {
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, bufferSize - 4,
|
||||
256, 1, {1, 1, 1});
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, bufferSize - 4,
|
||||
256, wgpu::kStrideUndefined, {1, 1, 1});
|
||||
256, wgpu::kCopyStrideUndefined, {1, 1, 1});
|
||||
}
|
||||
|
||||
// Copies with a 256-byte aligned bytes per row but unaligned texture region
|
||||
@@ -961,14 +961,14 @@ TEST_F(CopyCommandTest_T2B, Success) {
|
||||
// bytesPerRow is undefined
|
||||
{
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 2, {1, 1, 1});
|
||||
wgpu::kCopyStrideUndefined, 2, {1, 1, 1});
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 2, {3, 1, 1});
|
||||
wgpu::kCopyStrideUndefined, 2, {3, 1, 1});
|
||||
// Fail because height or depth is greater than 1:
|
||||
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 2, {1, 2, 1});
|
||||
wgpu::kCopyStrideUndefined, 2, {1, 2, 1});
|
||||
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 2, {1, 1, 2});
|
||||
wgpu::kCopyStrideUndefined, 2, {1, 1, 2});
|
||||
}
|
||||
|
||||
// Empty copies are valid
|
||||
@@ -977,22 +977,22 @@ TEST_F(CopyCommandTest_T2B, Success) {
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0, 0, 0,
|
||||
{0, 0, 1});
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 0, {0, 0, 1});
|
||||
wgpu::kCopyStrideUndefined, 0, {0, 0, 1});
|
||||
// An empty copy with depth = 0
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0, 0, 0,
|
||||
{0, 0, 0});
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 0, {0, 0, 0});
|
||||
wgpu::kCopyStrideUndefined, 0, {0, 0, 0});
|
||||
// An empty copy touching the end of the buffer
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, bufferSize, 0,
|
||||
0, {0, 0, 1});
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, bufferSize,
|
||||
wgpu::kStrideUndefined, 0, {0, 0, 1});
|
||||
wgpu::kCopyStrideUndefined, 0, {0, 0, 1});
|
||||
// An empty copy touching the side of the texture
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {16, 16, 0}, destination, 0, 0, 0,
|
||||
{0, 0, 1});
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {16, 16, 0}, destination, 0,
|
||||
wgpu::kStrideUndefined, 0, {0, 0, 1});
|
||||
wgpu::kCopyStrideUndefined, 0, {0, 0, 1});
|
||||
|
||||
// An empty copy with depth = 1 and bytesPerRow > 0
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0,
|
||||
@@ -1191,10 +1191,10 @@ TEST_F(CopyCommandTest_T2B, RowsPerImageConstraints) {
|
||||
|
||||
// rowsPerImage is undefined
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0, 256,
|
||||
wgpu::kStrideUndefined, {4, 4, 1});
|
||||
wgpu::kCopyStrideUndefined, {4, 4, 1});
|
||||
// Fail because depth > 1:
|
||||
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0, 256,
|
||||
wgpu::kStrideUndefined, {4, 4, 2});
|
||||
wgpu::kCopyStrideUndefined, {4, 4, 2});
|
||||
|
||||
// rowsPerImage is equal to copy height (Valid)
|
||||
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0, 256, 4,
|
||||
|
||||
@@ -106,8 +106,8 @@ namespace {
|
||||
TestWriteTexture(dataSize, 0, 256, 4, destination, 2, {0, 0, 0}, {4, 4, 1});
|
||||
// Copy with a data offset
|
||||
TestWriteTexture(dataSize, dataSize - 4, 256, 1, destination, 0, {0, 0, 0}, {1, 1, 1});
|
||||
TestWriteTexture(dataSize, dataSize - 4, 256, wgpu::kStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {1, 1, 1});
|
||||
TestWriteTexture(dataSize, dataSize - 4, 256, wgpu::kCopyStrideUndefined, destination,
|
||||
0, {0, 0, 0}, {1, 1, 1});
|
||||
}
|
||||
|
||||
// Copies with a 256-byte aligned bytes per row but unaligned texture region
|
||||
@@ -124,27 +124,27 @@ namespace {
|
||||
{
|
||||
// An empty copy
|
||||
TestWriteTexture(dataSize, 0, 0, 0, destination, 0, {0, 0, 0}, {0, 0, 1});
|
||||
TestWriteTexture(dataSize, 0, 0, wgpu::kStrideUndefined, destination, 0, {0, 0, 0},
|
||||
TestWriteTexture(dataSize, 0, 0, wgpu::kCopyStrideUndefined, destination, 0, {0, 0, 0},
|
||||
{0, 0, 1});
|
||||
// An empty copy with depth = 0
|
||||
TestWriteTexture(dataSize, 0, 0, 0, destination, 0, {0, 0, 0}, {0, 0, 0});
|
||||
TestWriteTexture(dataSize, 0, 0, wgpu::kStrideUndefined, destination, 0, {0, 0, 0},
|
||||
TestWriteTexture(dataSize, 0, 0, wgpu::kCopyStrideUndefined, destination, 0, {0, 0, 0},
|
||||
{0, 0, 0});
|
||||
// An empty copy touching the end of the data
|
||||
TestWriteTexture(dataSize, dataSize, 0, 0, destination, 0, {0, 0, 0}, {0, 0, 1});
|
||||
TestWriteTexture(dataSize, dataSize, 0, wgpu::kStrideUndefined, destination, 0,
|
||||
TestWriteTexture(dataSize, dataSize, 0, wgpu::kCopyStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {0, 0, 1});
|
||||
// An empty copy touching the side of the texture
|
||||
TestWriteTexture(dataSize, 0, 0, 0, destination, 0, {16, 16, 0}, {0, 0, 1});
|
||||
TestWriteTexture(dataSize, 0, 0, wgpu::kStrideUndefined, destination, 0, {16, 16, 0},
|
||||
{0, 0, 1});
|
||||
TestWriteTexture(dataSize, 0, 0, wgpu::kCopyStrideUndefined, destination, 0,
|
||||
{16, 16, 0}, {0, 0, 1});
|
||||
// An empty copy with depth = 1 and bytesPerRow > 0
|
||||
TestWriteTexture(dataSize, 0, 256, 0, destination, 0, {0, 0, 0}, {0, 0, 1});
|
||||
TestWriteTexture(dataSize, 0, 256, wgpu::kStrideUndefined, destination, 0, {0, 0, 0},
|
||||
{0, 0, 1});
|
||||
TestWriteTexture(dataSize, 0, 256, wgpu::kCopyStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {0, 0, 1});
|
||||
// An empty copy with height > 0, depth = 0, bytesPerRow > 0 and rowsPerImage > 0
|
||||
TestWriteTexture(dataSize, 0, 256, wgpu::kStrideUndefined, destination, 0, {0, 0, 0},
|
||||
{0, 1, 0});
|
||||
TestWriteTexture(dataSize, 0, 256, wgpu::kCopyStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {0, 1, 0});
|
||||
TestWriteTexture(dataSize, 0, 256, 1, destination, 0, {0, 0, 0}, {0, 1, 0});
|
||||
TestWriteTexture(dataSize, 0, 256, 16, destination, 0, {0, 0, 0}, {0, 1, 0});
|
||||
}
|
||||
@@ -237,27 +237,27 @@ namespace {
|
||||
wgpu::Texture destination = Create2DTexture({3, 7, 2}, 1, wgpu::TextureFormat::RGBA8Unorm,
|
||||
wgpu::TextureUsage::CopyDst);
|
||||
|
||||
// bytesPerRow = 0 or wgpu::kStrideUndefined
|
||||
// bytesPerRow = 0 or wgpu::kCopyStrideUndefined
|
||||
{
|
||||
// copyHeight > 1
|
||||
ASSERT_DEVICE_ERROR(
|
||||
TestWriteTexture(128, 0, 0, 7, destination, 0, {0, 0, 0}, {3, 7, 1}));
|
||||
TestWriteTexture(128, 0, 0, 7, destination, 0, {0, 0, 0}, {0, 7, 1});
|
||||
ASSERT_DEVICE_ERROR(TestWriteTexture(128, 0, wgpu::kStrideUndefined, 7, destination, 0,
|
||||
{0, 0, 0}, {0, 7, 1}));
|
||||
ASSERT_DEVICE_ERROR(TestWriteTexture(128, 0, wgpu::kCopyStrideUndefined, 7, destination,
|
||||
0, {0, 0, 0}, {0, 7, 1}));
|
||||
|
||||
// copyDepth > 1
|
||||
ASSERT_DEVICE_ERROR(
|
||||
TestWriteTexture(128, 0, 0, 1, destination, 0, {0, 0, 0}, {3, 1, 2}));
|
||||
TestWriteTexture(128, 0, 0, 1, destination, 0, {0, 0, 0}, {0, 1, 2});
|
||||
ASSERT_DEVICE_ERROR(TestWriteTexture(128, 0, wgpu::kStrideUndefined, 1, destination, 0,
|
||||
{0, 0, 0}, {0, 1, 2}));
|
||||
ASSERT_DEVICE_ERROR(TestWriteTexture(128, 0, wgpu::kCopyStrideUndefined, 1, destination,
|
||||
0, {0, 0, 0}, {0, 1, 2}));
|
||||
|
||||
// copyHeight = 1 and copyDepth = 1
|
||||
// TODO(crbug.com/dawn/520): Change to ASSERT_DEVICE_ERROR.
|
||||
EXPECT_DEPRECATION_WARNING(
|
||||
TestWriteTexture(128, 0, 0, 1, destination, 0, {0, 0, 0}, {3, 1, 1}));
|
||||
TestWriteTexture(128, 0, wgpu::kStrideUndefined, 1, destination, 0, {0, 0, 0},
|
||||
TestWriteTexture(128, 0, wgpu::kCopyStrideUndefined, 1, destination, 0, {0, 0, 0},
|
||||
{3, 1, 1});
|
||||
}
|
||||
|
||||
@@ -298,8 +298,8 @@ namespace {
|
||||
wgpu::Texture destination = Create2DTexture({16, 16, 2}, 1, wgpu::TextureFormat::RGBA8Unorm,
|
||||
wgpu::TextureUsage::CopyDst);
|
||||
|
||||
// rowsPerImage is wgpu::kStrideUndefined
|
||||
TestWriteTexture(dataSize, 0, 256, wgpu::kStrideUndefined, destination, 0, {0, 0, 0},
|
||||
// rowsPerImage is wgpu::kCopyStrideUndefined
|
||||
TestWriteTexture(dataSize, 0, 256, wgpu::kCopyStrideUndefined, destination, 0, {0, 0, 0},
|
||||
{4, 4, 1});
|
||||
|
||||
// rowsPerImage is equal to copy height (Valid)
|
||||
@@ -532,7 +532,7 @@ namespace {
|
||||
{4, 4, 1}, 1, wgpu::TextureFormat::Depth24PlusStencil8,
|
||||
wgpu::TextureUsage::CopyDst);
|
||||
|
||||
TestWriteTexture(dataSize, 0, bytesPerRow, wgpu::kStrideUndefined, destination, 0,
|
||||
TestWriteTexture(dataSize, 0, bytesPerRow, wgpu::kCopyStrideUndefined, destination, 0,
|
||||
{0, 0, 0}, {4, 4, 1}, wgpu::TextureAspect::StencilOnly);
|
||||
|
||||
// And that it fails if the buffer is one byte too small
|
||||
|
||||
Reference in New Issue
Block a user