mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +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
@@ -30,7 +30,7 @@ struct CopyConfig {
|
||||
uint32_t viewMipmapLevel = 0;
|
||||
uint32_t bufferOffset = 0;
|
||||
uint32_t bytesPerRowAlignment = kTextureBytesPerRowAlignment;
|
||||
uint32_t rowsPerImage = wgpu::kStrideUndefined;
|
||||
uint32_t rowsPerImage = wgpu::kCopyStrideUndefined;
|
||||
};
|
||||
|
||||
class CompressedTextureBCFormatTest : public DawnTest {
|
||||
@@ -60,7 +60,7 @@ class CompressedTextureBCFormatTest : public DawnTest {
|
||||
utils::GetTexelBlockSizeInBytes(copyConfig.textureDescriptor.format);
|
||||
}
|
||||
uint32_t copyRowsPerImage = copyConfig.rowsPerImage;
|
||||
if (copyRowsPerImage == wgpu::kStrideUndefined) {
|
||||
if (copyRowsPerImage == wgpu::kCopyStrideUndefined) {
|
||||
copyRowsPerImage = copyHeightInBlock;
|
||||
}
|
||||
uint32_t copyBytesPerImage = copyBytesPerRow * copyRowsPerImage;
|
||||
|
||||
@@ -61,7 +61,7 @@ class CopyTests : public DawnTest {
|
||||
|
||||
static BufferSpec MinimumBufferSpec(uint32_t width, uint32_t height, uint32_t depth = 1) {
|
||||
return MinimumBufferSpec({width, height, depth}, kStrideComputeDefault,
|
||||
depth == 1 ? wgpu::kStrideUndefined : kStrideComputeDefault);
|
||||
depth == 1 ? wgpu::kCopyStrideUndefined : kStrideComputeDefault);
|
||||
}
|
||||
|
||||
static BufferSpec MinimumBufferSpec(wgpu::Extent3D copyExtent,
|
||||
@@ -722,7 +722,7 @@ TEST_P(CopyTests_T2B, BytesPerRowWithOneRowCopy) {
|
||||
EXPECT_DEPRECATION_WARNING(DoTest(textureSpec, bufferSpec, {5, 1, 1}));
|
||||
|
||||
// bytesPerRow undefined
|
||||
bufferSpec.bytesPerRow = wgpu::kStrideUndefined;
|
||||
bufferSpec.bytesPerRow = wgpu::kCopyStrideUndefined;
|
||||
DoTest(textureSpec, bufferSpec, {5, 1, 1});
|
||||
}
|
||||
|
||||
@@ -750,7 +750,8 @@ TEST_P(CopyTests_T2B, StrideSpecialCases) {
|
||||
// bytesPerRow undefined
|
||||
for (const wgpu::Extent3D copyExtent :
|
||||
{wgpu::Extent3D{2, 1, 1}, {2, 0, 1}, {2, 1, 0}, {2, 0, 0}}) {
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, wgpu::kStrideUndefined, 2), copyExtent);
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, wgpu::kCopyStrideUndefined, 2),
|
||||
copyExtent);
|
||||
}
|
||||
|
||||
// rowsPerImage 0
|
||||
@@ -761,7 +762,8 @@ TEST_P(CopyTests_T2B, StrideSpecialCases) {
|
||||
|
||||
// rowsPerImage undefined
|
||||
for (const wgpu::Extent3D copyExtent : {wgpu::Extent3D{2, 2, 1}, {2, 2, 0}}) {
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, 256, wgpu::kStrideUndefined), copyExtent);
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, 256, wgpu::kCopyStrideUndefined),
|
||||
copyExtent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1209,7 +1211,7 @@ TEST_P(CopyTests_B2T, BytesPerRowWithOneRowCopy) {
|
||||
EXPECT_DEPRECATION_WARNING(DoTest(textureSpec, bufferSpec, {5, 1, 1}));
|
||||
|
||||
// bytesPerRow undefined
|
||||
bufferSpec.bytesPerRow = wgpu::kStrideUndefined;
|
||||
bufferSpec.bytesPerRow = wgpu::kCopyStrideUndefined;
|
||||
DoTest(textureSpec, bufferSpec, {5, 1, 1});
|
||||
}
|
||||
|
||||
@@ -1237,7 +1239,8 @@ TEST_P(CopyTests_B2T, StrideSpecialCases) {
|
||||
// bytesPerRow undefined
|
||||
for (const wgpu::Extent3D copyExtent :
|
||||
{wgpu::Extent3D{2, 1, 1}, {2, 0, 1}, {2, 1, 0}, {2, 0, 0}}) {
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, wgpu::kStrideUndefined, 2), copyExtent);
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, wgpu::kCopyStrideUndefined, 2),
|
||||
copyExtent);
|
||||
}
|
||||
|
||||
// rowsPerImage 0
|
||||
@@ -1248,7 +1251,8 @@ TEST_P(CopyTests_B2T, StrideSpecialCases) {
|
||||
|
||||
// rowsPerImage undefined
|
||||
for (const wgpu::Extent3D copyExtent : {wgpu::Extent3D{2, 2, 1}, {2, 2, 0}}) {
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, 256, wgpu::kStrideUndefined), copyExtent);
|
||||
DoTest(textureSpec, MinimumBufferSpec(copyExtent, 256, wgpu::kCopyStrideUndefined),
|
||||
copyExtent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -486,4 +486,4 @@ DAWN_INSTANTIATE_TEST(LineStripPrimitiveRestartTests,
|
||||
D3D12Backend(),
|
||||
MetalBackend(),
|
||||
OpenGLBackend(),
|
||||
VulkanBackend());
|
||||
VulkanBackend());
|
||||
|
||||
@@ -292,7 +292,7 @@ class QueueWriteTextureTests : public DawnTest {
|
||||
textureSpec.textureSize.height >> textureSpec.level,
|
||||
textureSpec.textureSize.depth};
|
||||
uint32_t bytesPerRow = dataSpec.bytesPerRow;
|
||||
if (bytesPerRow == wgpu::kStrideUndefined) {
|
||||
if (bytesPerRow == wgpu::kCopyStrideUndefined) {
|
||||
bytesPerRow = mipSize.width * bytesPerTexel;
|
||||
}
|
||||
uint32_t alignedBytesPerRow = Align(bytesPerRow, bytesPerTexel);
|
||||
@@ -526,7 +526,7 @@ TEST_P(QueueWriteTextureTests, BytesPerRowWithOneRowCopy) {
|
||||
EXPECT_DEPRECATION_WARNING(DoTest(textureSpec, dataSpec, copyExtent));
|
||||
|
||||
// bytesPerRow undefined
|
||||
dataSpec.bytesPerRow = wgpu::kStrideUndefined;
|
||||
dataSpec.bytesPerRow = wgpu::kCopyStrideUndefined;
|
||||
DoTest(textureSpec, dataSpec, copyExtent);
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ TEST_P(QueueWriteTextureTests, StrideSpecialCases) {
|
||||
// bytesPerRow undefined
|
||||
for (const wgpu::Extent3D copyExtent :
|
||||
{wgpu::Extent3D{2, 1, 1}, {2, 0, 1}, {2, 1, 0}, {2, 0, 0}}) {
|
||||
DoTest(textureSpec, MinimumDataSpec(copyExtent, wgpu::kStrideUndefined, 2), copyExtent);
|
||||
DoTest(textureSpec, MinimumDataSpec(copyExtent, wgpu::kCopyStrideUndefined, 2), copyExtent);
|
||||
}
|
||||
|
||||
// rowsPerImage 0
|
||||
@@ -597,7 +597,8 @@ TEST_P(QueueWriteTextureTests, StrideSpecialCases) {
|
||||
|
||||
// rowsPerImage undefined
|
||||
for (const wgpu::Extent3D copyExtent : {wgpu::Extent3D{2, 2, 1}, {2, 2, 0}}) {
|
||||
DoTest(textureSpec, MinimumDataSpec(copyExtent, 256, wgpu::kStrideUndefined), copyExtent);
|
||||
DoTest(textureSpec, MinimumDataSpec(copyExtent, 256, wgpu::kCopyStrideUndefined),
|
||||
copyExtent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -457,4 +457,4 @@ TEST(BuddyMemoryAllocatorTests, DestroyHeaps) {
|
||||
// Make sure we can destroy the remaining heaps.
|
||||
poolAllocator.DestroyPool();
|
||||
ASSERT_EQ(poolAllocator.GetPoolSizeForTesting(), 0u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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