Drop deprecated rowsPerImage/bytesPerRow behavior

Removes the last remaining code paths supporting the old rowsPerImage
and bytesPerRow defaulting behavior, and updates all related tests to
strictly expect the spec-complaint behavior.

Change-Id: I022db0b142939d82e33d5989460488881e5a1ab3
Bug: dawn:520
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56803
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Brandon Jones
2021-07-04 18:31:29 +00:00
committed by Dawn LUCI CQ
parent fc37b32c55
commit aeff235dc3
9 changed files with 37 additions and 132 deletions

View File

@@ -580,9 +580,8 @@ TEST_F(CopyCommandTest_B2T, BytesPerRowConstraints) {
{0, 1, 4});
// copyHeight = 1 and copyDepth = 1
// TODO(crbug.com/dawn/520): Change to ::Failure.
EXPECT_DEPRECATION_WARNING(TestB2TCopy(utils::Expectation::Success, source, 0, 0, 1,
destination, 0, {0, 0, 0}, {64, 1, 1}));
TestB2TCopy(utils::Expectation::Failure, source, 0, 0, 1, destination, 0, {0, 0, 0},
{64, 1, 1});
}
// bytes per row is not 256-byte aligned
@@ -613,9 +612,8 @@ TEST_F(CopyCommandTest_B2T, BytesPerRowConstraints) {
{65, 1, 0});
// copyHeight = 1 and copyDepth = 1
// TODO(crbug.com/dawn/520): Change to ::Failure.
EXPECT_DEPRECATION_WARNING(TestB2TCopy(utils::Expectation::Success, source, 0, 256, 1,
destination, 0, {0, 0, 0}, {65, 1, 1}));
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, 1, destination, 0, {0, 0, 0},
{65, 1, 1});
}
}
@@ -626,11 +624,10 @@ TEST_F(CopyCommandTest_B2T, RowsPerImageConstraints) {
Create2DTexture(16, 16, 1, 5, wgpu::TextureFormat::RGBA8Unorm, wgpu::TextureUsage::CopyDst);
// rowsPerImage is zero
// TODO(crbug.com/dawn/520): Change to ::Failure.
EXPECT_DEPRECATION_WARNING(TestB2TCopy(utils::Expectation::Success, source, 0, 256, 0,
destination, 0, {0, 0, 0}, {1, 1, 1}));
EXPECT_DEPRECATION_WARNING(TestB2TCopy(utils::Expectation::Success, source, 0, 256, 0,
destination, 0, {0, 0, 0}, {4, 4, 1}));
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, 0, destination, 0, {0, 0, 0},
{1, 1, 1});
TestB2TCopy(utils::Expectation::Failure, source, 0, 256, 0, destination, 0, {0, 0, 0},
{4, 4, 1});
// rowsPerImage is undefined
TestB2TCopy(utils::Expectation::Success, source, 0, 256, wgpu::kCopyStrideUndefined,
@@ -1198,9 +1195,8 @@ TEST_F(CopyCommandTest_T2B, BytesPerRowConstraints) {
{0, 1, 4});
// copyHeight = 1 and copyDepth = 1
// TODO(crbug.com/dawn/520): Change to ::Failure.
EXPECT_DEPRECATION_WARNING(TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0},
destination, 0, 0, 1, {64, 1, 1}));
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0, 0, 1,
{64, 1, 1});
}
// bytes per row is not 256-byte aligned
@@ -1231,9 +1227,8 @@ TEST_F(CopyCommandTest_T2B, BytesPerRowConstraints) {
{65, 1, 0});
// copyHeight = 1 and copyDepth = 1
// TODO(crbug.com/dawn/520): Change to ::Failure.
EXPECT_DEPRECATION_WARNING(TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0},
destination, 0, 256, 1, {65, 1, 1}));
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0, 256, 1,
{65, 1, 1});
}
}
@@ -1244,11 +1239,10 @@ TEST_F(CopyCommandTest_T2B, RowsPerImageConstraints) {
wgpu::Buffer destination = CreateBuffer(bufferSize, wgpu::BufferUsage::CopyDst);
// rowsPerImage is zero (Valid)
// TODO(crbug.com/dawn/520): Change to ::Failure.
EXPECT_DEPRECATION_WARNING(TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0},
destination, 0, 256, 0, {1, 1, 1}));
EXPECT_DEPRECATION_WARNING(TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0},
destination, 0, 256, 0, {4, 4, 1}));
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0, 256, 0,
{1, 1, 1});
TestT2BCopy(utils::Expectation::Failure, source, 0, {0, 0, 0}, destination, 0, 256, 0,
{4, 4, 1});
// rowsPerImage is undefined
TestT2BCopy(utils::Expectation::Success, source, 0, {0, 0, 0}, destination, 0, 256,

View File

@@ -254,8 +254,7 @@ namespace {
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(
ASSERT_DEVICE_ERROR(
TestWriteTexture(128, 0, 0, 1, destination, 0, {0, 0, 0}, {3, 1, 1}));
TestWriteTexture(128, 0, wgpu::kCopyStrideUndefined, 1, destination, 0, {0, 0, 0},
{3, 1, 1});
@@ -278,9 +277,7 @@ namespace {
TestWriteTexture(128, 0, 11, 1, destination, 0, {0, 0, 0}, {3, 1, 0}));
// copyHeight = 1 and copyDepth = 1
// TODO(crbug.com/dawn/520): Change to ASSERT_DEVICE_ERROR. bytesPerRow used to be only
// validated if height > 1 || depth > 1.
EXPECT_DEPRECATION_WARNING(
ASSERT_DEVICE_ERROR(
TestWriteTexture(128, 0, 11, 1, destination, 0, {0, 0, 0}, {3, 1, 1}));
}
@@ -312,7 +309,7 @@ namespace {
// rowsPerImage is less than copy height (Invalid)
ASSERT_DEVICE_ERROR(
TestWriteTexture(dataSize, 0, 256, 3, destination, 0, {0, 0, 0}, {4, 4, 1}));
EXPECT_DEPRECATION_WARNING(
ASSERT_DEVICE_ERROR(
TestWriteTexture(dataSize, 0, 256, 0, destination, 0, {0, 0, 0}, {4, 4, 1}));
}