Remove parameter layer in EXPECT_TEXTURE_RGBA8_EQ
BGU: dawn:748
Change-Id: Id4b6e7915659938e7474f81d186cfe2128684042
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46727
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
diff --git a/src/tests/DawnTest.h b/src/tests/DawnTest.h
index d7f72ec..3b5dbab 100644
--- a/src/tests/DawnTest.h
+++ b/src/tests/DawnTest.h
@@ -67,9 +67,9 @@
#define EXPECT_PIXEL_RGBA8_EQ(expected, texture, x, y) \
AddTextureExpectation(__FILE__, __LINE__, expected, texture, {x, y})
-#define EXPECT_TEXTURE_RGBA8_EQ(expected, texture, origin, extent, level, layer) \
+#define EXPECT_TEXTURE_RGBA8_EQ(expected, texture, origin, extent, level) \
AddTextureExpectation(__FILE__, __LINE__, expected, texture, utils::MakeOrigin origin, \
- utils::MakeExtent extent, level, layer)
+ utils::MakeExtent extent, level)
#define EXPECT_PIXEL_FLOAT_EQ(expected, texture, x, y) \
AddTextureExpectation(__FILE__, __LINE__, expected, texture, {x, y})
diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp
index b217a1c..e4889a2 100644
--- a/src/tests/end2end/CompressedTextureFormatTests.cpp
+++ b/src/tests/end2end/CompressedTextureFormatTests.cpp
@@ -199,7 +199,7 @@
EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color,
(expectedOrigin.x, expectedOrigin.y),
- (expectedExtent.width, expectedExtent.height), 0, 0);
+ (expectedExtent.width, expectedExtent.height), 0);
}
// Run the tests that copies pre-prepared BC format data into a BC texture and verifies if we
diff --git a/src/tests/end2end/CopyTests.cpp b/src/tests/end2end/CopyTests.cpp
index 631dfd9..92230d6 100644
--- a/src/tests/end2end/CopyTests.cpp
+++ b/src/tests/end2end/CopyTests.cpp
@@ -291,10 +291,11 @@
copySize.width, copySize.height, copyDepth, bufferSpec.bytesPerRow,
expected.data(), copySize.width * bytesPerTexel);
- EXPECT_TEXTURE_RGBA8_EQ(
- expected.data(), texture,
- (textureSpec.copyOrigin.x, textureSpec.copyOrigin.y, textureSpec.copyOrigin.z),
- (copySize.width, copySize.height, copyDepth), textureSpec.copyLevel, layer)
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture,
+ (textureSpec.copyOrigin.x, textureSpec.copyOrigin.y,
+ textureSpec.copyOrigin.z + layer),
+ (copySize.width, copySize.height, copyDepth),
+ textureSpec.copyLevel)
<< "Buffer to Texture copy failed copying " << bufferSpec.size
<< "-byte buffer with offset " << bufferSpec.offset << " and bytes per row "
<< bufferSpec.bytesPerRow << " to [(" << textureSpec.copyOrigin.x << ", "
diff --git a/src/tests/end2end/DepthBiasTests.cpp b/src/tests/end2end/DepthBiasTests.cpp
index 61360e0..6d5729e 100644
--- a/src/tests/end2end/DepthBiasTests.cpp
+++ b/src/tests/end2end/DepthBiasTests.cpp
@@ -324,7 +324,7 @@
RGBA8::kRed, RGBA8::kRed, //
};
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), mRenderTarget, (0, 0), (kRTSize, kRTSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), mRenderTarget, (0, 0), (kRTSize, kRTSize), 0);
}
// Test adding positive bias to output with a clamp
@@ -345,7 +345,7 @@
RGBA8::kZero, RGBA8::kZero, //
};
- EXPECT_TEXTURE_RGBA8_EQ(zero.data(), mRenderTarget, (0, 0), (kRTSize, kRTSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(zero.data(), mRenderTarget, (0, 0), (kRTSize, kRTSize), 0);
}
// Test adding positive bias to output
@@ -360,7 +360,7 @@
RGBA8::kZero, RGBA8::kZero, //
};
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), mRenderTarget, (0, 0), (kRTSize, kRTSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), mRenderTarget, (0, 0), (kRTSize, kRTSize), 0);
}
DAWN_INSTANTIATE_TEST(DepthBiasTests,
diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp
index 2abe6b2..548caf9 100644
--- a/src/tests/end2end/MultisampledRenderingTests.cpp
+++ b/src/tests/end2end/MultisampledRenderingTests.cpp
@@ -180,8 +180,8 @@
constexpr uint32_t kMiddleY = (kHeight - 1) / 2;
RGBA8 expectedColor = ExpectedMSAAColor(inputColor, msaaCoverage);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, resolveTexture, (kMiddleX, kMiddleY), (1, 1),
- mipmapLevel, arrayLayer);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, resolveTexture, (kMiddleX, kMiddleY, arrayLayer),
+ (1, 1), mipmapLevel);
}
constexpr static uint32_t kWidth = 3;
@@ -800,7 +800,7 @@
queue.Submit(1, &commandBuffer);
RGBA8 expectedColor = ExpectedMSAAColor(kGreen, kMSAACoverage);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0);
}
// Test doing MSAA resolve into multiple resolve targets works correctly with a non-default
@@ -909,7 +909,7 @@
}
RGBA8 expectedColor = ExpectedMSAAColor(kGreen, msaaCoverage);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0);
}
}
@@ -962,8 +962,8 @@
// using only the first one.
RGBA8 expectedRed = ExpectedMSAAColor(kRed, kMSAACoverage);
RGBA8 expectedGreen = ExpectedMSAAColor(kGreen, kMSAACoverage);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedRed, mResolveTexture, (1, 0), (1, 1), 0, 0);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedGreen, resolveTexture2, (1, 0), (1, 1), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedRed, mResolveTexture, (1, 0), (1, 1), 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedGreen, resolveTexture2, (1, 0), (1, 1), 0);
}
}
@@ -1024,7 +1024,7 @@
(kGreen.a + kRed.a) / 2.0};
RGBA8 expectedColor = ExpectedMSAAColor(kHalfGreenHalfRed, 1.0f);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0);
}
// Test using one multisampled color attachment with resolve target can render correctly
@@ -1068,7 +1068,7 @@
queue.Submit(1, &commandBuffer);
RGBA8 expectedColor = ExpectedMSAAColor(kGreen, kMSAACoverage * alpha);
- EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&expectedColor, mResolveTexture, (1, 0), (1, 1), 0);
}
}
diff --git a/src/tests/end2end/NonzeroTextureCreationTests.cpp b/src/tests/end2end/NonzeroTextureCreationTests.cpp
index 2e74674..57ba601 100644
--- a/src/tests/end2end/NonzeroTextureCreationTests.cpp
+++ b/src/tests/end2end/NonzeroTextureCreationTests.cpp
@@ -88,7 +88,7 @@
expected.push_back(filled);
}
uint32_t mipSize = kSize >> 2;
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0), (mipSize, mipSize), 2, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0), (mipSize, mipSize), 2);
}
// Test that non-zero array layers clears 0xFF because toggle is enabled.
@@ -112,7 +112,7 @@
expected.push_back(filled);
}
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0), (kSize, kSize), 0, 2);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0, 2), (kSize, kSize), 0);
}
// Test that nonrenderable texture formats clear 0x01 because toggle is enabled
@@ -212,7 +212,7 @@
wgpu::Texture texture = device.CreateTexture(&descriptor);
for (uint32_t i = 0; i < descriptor.size.depthOrArrayLayers; ++i) {
- EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), 0, i);
+ EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0, i), (1, 1), 0);
}
}
@@ -222,7 +222,7 @@
wgpu::Texture texture = device.CreateTexture(&descriptor);
for (uint32_t i = 0; i < descriptor.mipLevelCount; ++i) {
- EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), i, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), i);
}
}
@@ -236,7 +236,7 @@
for (uint32_t i = 0; i < descriptor.size.depthOrArrayLayers; ++i) {
for (uint32_t j = 0; j < descriptor.mipLevelCount; ++j) {
- EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), j, i);
+ EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0, i), (1, 1), j);
}
}
}
@@ -264,7 +264,7 @@
wgpu::Texture texture = device.CreateTexture(&descriptor);
for (uint32_t i = 0; i < descriptor.size.depthOrArrayLayers; ++i) {
- EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), 0, i);
+ EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0, i), (1, 1), 0);
}
}
@@ -274,7 +274,7 @@
wgpu::Texture texture = device.CreateTexture(&descriptor);
for (uint32_t i = 0; i < descriptor.mipLevelCount; ++i) {
- EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), i, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), i);
}
}
@@ -288,7 +288,7 @@
for (uint32_t i = 0; i < descriptor.size.depthOrArrayLayers; ++i) {
for (uint32_t j = 0; j < descriptor.mipLevelCount; ++j) {
- EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0), (1, 1), j, i);
+ EXPECT_TEXTURE_RGBA8_EQ(&filled, texture, (0, 0, i), (1, 1), j);
}
}
}
diff --git a/src/tests/end2end/QueueTests.cpp b/src/tests/end2end/QueueTests.cpp
index 1f043b4..fba2f81 100644
--- a/src/tests/end2end/QueueTests.cpp
+++ b/src/tests/end2end/QueueTests.cpp
@@ -309,8 +309,8 @@
dataSpec.bytesPerRow, expected.data(), copySize.width, bytesPerTexel);
EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture,
- (textureSpec.copyOrigin.x, textureSpec.copyOrigin.y),
- (copySize.width, copySize.height), textureSpec.level, slice)
+ (textureSpec.copyOrigin.x, textureSpec.copyOrigin.y, slice),
+ (copySize.width, copySize.height), textureSpec.level)
<< "Write to texture failed copying " << dataSpec.size << "-byte data with offset "
<< dataSpec.offset << " and bytes per row " << dataSpec.bytesPerRow << " to [("
<< textureSpec.copyOrigin.x << ", " << textureSpec.copyOrigin.y << "), ("
@@ -346,7 +346,7 @@
device.GetQueue().WriteTexture(&imageCopyTexture, data.data(), width * height * kPixelSize,
&textureDataLayout, ©Extent);
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (width, height), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (width, height), 0);
}
};
diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp
index 6977787..76e2dd5 100644
--- a/src/tests/end2end/RenderPassLoadOpTests.cpp
+++ b/src/tests/end2end/RenderPassLoadOpTests.cpp
@@ -166,10 +166,10 @@
auto commandsClearGreen = commandsClearGreenEncoder.Finish();
queue.Submit(1, &commandsClearZero);
- EXPECT_TEXTURE_RGBA8_EQ(expectZero.data(), renderTarget, (0, 0), (kRTSize, kRTSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectZero.data(), renderTarget, (0, 0), (kRTSize, kRTSize), 0);
queue.Submit(1, &commandsClearGreen);
- EXPECT_TEXTURE_RGBA8_EQ(expectGreen.data(), renderTarget, (0, 0), (kRTSize, kRTSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectGreen.data(), renderTarget, (0, 0), (kRTSize, kRTSize), 0);
// Part 2: draw a blue quad into the right half of the render target, and check result
utils::ComboRenderPassDescriptor renderPassLoad({renderTargetView});
@@ -185,10 +185,10 @@
queue.Submit(1, &commandsLoad);
// Left half should still be green
- EXPECT_TEXTURE_RGBA8_EQ(expectGreen.data(), renderTarget, (0, 0), (kRTSize / 2, kRTSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectGreen.data(), renderTarget, (0, 0), (kRTSize / 2, kRTSize), 0);
// Right half should now be blue
EXPECT_TEXTURE_RGBA8_EQ(expectBlue.data(), renderTarget, (kRTSize / 2, 0),
- (kRTSize / 2, kRTSize), 0, 0);
+ (kRTSize / 2, kRTSize), 0);
}
// Test clearing a color attachment with signed and unsigned integer formats.
diff --git a/src/tests/end2end/SubresourceRenderAttachmentTests.cpp b/src/tests/end2end/SubresourceRenderAttachmentTests.cpp
index 4b15b2d..6b86cf1 100644
--- a/src/tests/end2end/SubresourceRenderAttachmentTests.cpp
+++ b/src/tests/end2end/SubresourceRenderAttachmentTests.cpp
@@ -79,9 +79,8 @@
switch (type) {
case Type::Color: {
std::vector<RGBA8> expected(renderTargetSize * renderTargetSize, expectedColor);
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderTarget, (0, 0),
- (renderTargetSize, renderTargetSize), baseMipLevel,
- baseArrayLayer);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderTarget, (0, 0, baseArrayLayer),
+ (renderTargetSize, renderTargetSize), baseMipLevel);
break;
}
case Type::Depth: {
diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp
index 7574a1e..a2d7687 100644
--- a/src/tests/end2end/TextureSubresourceTests.cpp
+++ b/src/tests/end2end/TextureSubresourceTests.cpp
@@ -169,8 +169,8 @@
// black in render view (mip level 1).
RGBA8 topRight = RGBA8::kBlack;
RGBA8 bottomLeft = RGBA8::kRed;
- EXPECT_TEXTURE_RGBA8_EQ(&topRight, texture, (kSize / 2 - 1, 0), (1, 1), 1, 0);
- EXPECT_TEXTURE_RGBA8_EQ(&bottomLeft, texture, (0, kSize / 2 - 1), (1, 1), 1, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&topRight, texture, (kSize / 2 - 1, 0), (1, 1), 1);
+ EXPECT_TEXTURE_RGBA8_EQ(&bottomLeft, texture, (0, kSize / 2 - 1), (1, 1), 1);
}
// Test different array layers
@@ -197,8 +197,8 @@
// black in render view (array layer 1).
RGBA8 topRight = RGBA8::kBlack;
RGBA8 bottomLeft = RGBA8::kRed;
- EXPECT_TEXTURE_RGBA8_EQ(&topRight, texture, (kSize - 1, 0), (1, 1), 0, 1);
- EXPECT_TEXTURE_RGBA8_EQ(&bottomLeft, texture, (0, kSize - 1), (1, 1), 0, 1);
+ EXPECT_TEXTURE_RGBA8_EQ(&topRight, texture, (kSize - 1, 0, 1), (1, 1), 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&bottomLeft, texture, (0, kSize - 1, 1), (1, 1), 0);
}
// TODO (yunchao.he@intel.com):
diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp
index a329c80..7999f20 100644
--- a/src/tests/end2end/TextureViewTests.cpp
+++ b/src/tests/end2end/TextureViewTests.cpp
@@ -532,9 +532,8 @@
bytesPerRow / kBytesPerTexel * (textureWidthLevel0 - 1) + textureHeightLevel0;
constexpr RGBA8 kExpectedPixel(0, 255, 0, 255);
std::vector<RGBA8> expected(expectedDataSize, kExpectedPixel);
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0),
- (textureViewWidth, textureViewHeight), textureViewBaseLevel,
- textureViewBaseLayer);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0, textureViewBaseLayer),
+ (textureViewWidth, textureViewHeight), textureViewBaseLevel);
}
};
diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp
index 92b3578..33ee637 100644
--- a/src/tests/end2end/TextureZeroInitTests.cpp
+++ b/src/tests/end2end/TextureZeroInitTests.cpp
@@ -174,7 +174,7 @@
const std::vector<RGBA8> kExpectedAllZero(kSize * kSize, {0, 0, 0, 0});
for (uint32_t layer = 0; layer < kArrayLayers; ++layer) {
- EXPECT_TEXTURE_RGBA8_EQ(kExpectedAllZero.data(), texture, (0, 0), (kSize, kSize), 0, layer);
+ EXPECT_TEXTURE_RGBA8_EQ(kExpectedAllZero.data(), texture, (0, 0, layer), (kSize, kSize), 0);
}
}
@@ -215,8 +215,8 @@
uint32_t mipSize = kSize >> 2;
std::vector<RGBA8> expected(mipSize * mipSize, {0, 0, 0, 0});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0), (mipSize, mipSize),
- baseMipLevel, baseArrayLayer);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0, baseArrayLayer),
+ (mipSize, mipSize), baseMipLevel);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(
@@ -258,8 +258,8 @@
std::vector<RGBA8> expected(kSize * kSize, {0, 0, 0, 0});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0), (kSize, kSize), baseMipLevel,
- baseArrayLayer);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0, baseArrayLayer),
+ (kSize, kSize), baseMipLevel);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(
@@ -290,7 +290,7 @@
std::vector<RGBA8> expected(kSize * kSize, {100, 100, 100, 100});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), texture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1));
@@ -322,10 +322,9 @@
std::vector<RGBA8> expected100((kSize / 2) * kSize, {100, 100, 100, 100});
std::vector<RGBA8> expectedZeros((kSize / 2) * kSize, {0, 0, 0, 0});
// first half filled with 100, by the buffer data
- EXPECT_TEXTURE_RGBA8_EQ(expected100.data(), texture, (0, 0), (kSize / 2, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected100.data(), texture, (0, 0), (kSize / 2, kSize), 0);
// second half should be cleared
- EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kSize / 2, 0), (kSize / 2, kSize), 0,
- 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kSize / 2, 0), (kSize / 2, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1));
@@ -364,7 +363,7 @@
const std::vector<RGBA8> expected100(kSize * kSize, {100, 100, 100, 100});
for (uint32_t layer = kBaseArrayLayer; layer < kBaseArrayLayer + kCopyLayerCount; ++layer) {
- EXPECT_TEXTURE_RGBA8_EQ(expected100.data(), texture, (0, 0), (kSize, kSize), 0, layer);
+ EXPECT_TEXTURE_RGBA8_EQ(expected100.data(), texture, (0, 0, layer), (kSize, kSize), 0);
}
}
@@ -396,8 +395,8 @@
std::vector<RGBA8> expected(kSize * kSize, {0, 0, 0, 0});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), dstTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), dstTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1));
@@ -451,10 +450,10 @@
std::vector<RGBA8> expectedWithZeros((kSize / 2) * kSize, {0, 0, 0, 0});
std::vector<RGBA8> expectedWith100(kSize * kSize, {100, 100, 100, 100});
- EXPECT_TEXTURE_RGBA8_EQ(expectedWith100.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
- EXPECT_TEXTURE_RGBA8_EQ(expectedWith100.data(), dstTexture, (0, 0), (kSize / 2, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedWith100.data(), srcTexture, (0, 0), (kSize, kSize), 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedWith100.data(), dstTexture, (0, 0), (kSize / 2, kSize), 0);
EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), dstTexture, (kSize / 2, 0),
- (kSize / 2, kSize), 0, 0);
+ (kSize / 2, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1));
@@ -497,7 +496,7 @@
// Expect the texture to be red because depth test passed.
std::vector<RGBA8> expected(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1));
@@ -539,7 +538,7 @@
// Expect the texture to be red because stencil test passed.
std::vector<RGBA8> expected(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1));
@@ -578,7 +577,7 @@
// Expect the texture to be red because both depth and stencil tests passed.
std::vector<RGBA8> expected(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), srcTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(srcTexture.Get(), 0, 1, 0, 1));
@@ -647,7 +646,7 @@
// Expect the texture to be red because the depth and stencil tests passed. Depth was 0
// and stencil was 2.
std::vector<RGBA8> expected(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), colorTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), colorTexture, (0, 0), (kSize, kSize), 0);
}
// Everything is initialized now
@@ -720,7 +719,7 @@
// Expect the texture to be red because both the depth a stencil tests passed.
// Depth was 0.7 and stencil was 0
std::vector<RGBA8> expected(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), colorTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), colorTexture, (0, 0), (kSize, kSize), 0);
}
// Everything is initialized now
@@ -819,7 +818,7 @@
// Expect the texture to be red because both the depth a stencil tests passed.
// Depth was 0.3 and stencil was 0
std::vector<RGBA8> expected(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), colorTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), colorTexture, (0, 0), (kSize, kSize), 0);
}
}
@@ -839,7 +838,7 @@
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
std::vector<RGBA8> expected(kSize * kSize, {0, 0, 0, 0});
- EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true,
@@ -884,7 +883,7 @@
// Expect the rendered texture to be cleared
std::vector<RGBA8> expectedWithZeros(kSize * kSize, {0, 0, 0, 0});
- EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), renderTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), renderTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(renderTexture.Get(), 0, 1, 0, 1));
@@ -943,8 +942,8 @@
// Expect both subresources to be zero: the sampled one with lazy-clearing and the attachment
// because it sampled the lazy-cleared sampled subresource.
- EXPECT_TEXTURE_RGBA8_EQ(&RGBA8::kZero, texture, (0, 0), (1, 1), 0, 0);
- EXPECT_TEXTURE_RGBA8_EQ(&RGBA8::kZero, texture, (0, 0), (1, 1), 0, 1);
+ EXPECT_TEXTURE_RGBA8_EQ(&RGBA8::kZero, texture, (0, 0, 0), (1, 1), 0);
+ EXPECT_TEXTURE_RGBA8_EQ(&RGBA8::kZero, texture, (0, 0, 1), (1, 1), 0);
// The whole texture is now initialized.
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 2));
@@ -1172,7 +1171,7 @@
// Expect the rendered texture to be cleared
std::vector<RGBA8> expectedWithZeros(kSize * kSize, {0, 0, 0, 0});
EXPECT_LAZY_CLEAR(1u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), renderTexture, (0, 0),
- (kSize, kSize), 0, 0));
+ (kSize, kSize), 0));
// Expect texture subresource initialized to be true
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1));
@@ -1225,7 +1224,7 @@
// The depth stencil test should fail and not draw because the depth stencil texture is
// cleared to 1's by using loadOp clear and set values from descriptor.
std::vector<RGBA8> expectedBlack(kSize * kSize, {0, 0, 0, 0});
- EXPECT_TEXTURE_RGBA8_EQ(expectedBlack.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedBlack.data(), srcTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be false since storeop is clear, sets
// subresource as uninitialized
@@ -1250,7 +1249,7 @@
// Now the depth stencil test should pass since depth stencil texture is cleared to 0's by
// loadop load and uninitialized subresource, so we should have a red square
std::vector<RGBA8> expectedRed(kSize * kSize, {255, 0, 0, 255});
- EXPECT_TEXTURE_RGBA8_EQ(expectedRed.data(), srcTexture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedRed.data(), srcTexture, (0, 0), (kSize, kSize), 0);
// Expect texture subresource initialized to be false since storeop is clear, sets
// subresource as uninitialized
@@ -1319,16 +1318,16 @@
// mip.
std::vector<RGBA8> expectedWithZeros(kSize * kSize, {0, 0, 0, 0});
EXPECT_LAZY_CLEAR(1u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), renderTexture, (0, 0),
- (kSize, kSize), 0, 0));
+ (kSize, kSize), 0));
// Expect the first mip to have been lazy cleared to 0.
EXPECT_LAZY_CLEAR(0u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), sampleTexture, (0, 0),
- (kSize, kSize), 0, 0));
+ (kSize, kSize), 0));
// Expect the second mip to still be filled with 2.
std::vector<RGBA8> expectedWithTwos(mipSize * mipSize, {2, 2, 2, 2});
EXPECT_LAZY_CLEAR(0u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithTwos.data(), sampleTexture, (0, 0),
- (mipSize, mipSize), 1, 0));
+ (mipSize, mipSize), 1));
// Expect the whole texture to be initialized
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(sampleTexture.Get(), 0, 2, 0, 1));
@@ -1401,17 +1400,17 @@
// Expect the rendered texture to be cleared since we copied from the uninitialized first
// array layer.
std::vector<RGBA8> expectedWithZeros(kSize * kSize, {0, 0, 0, 0});
- EXPECT_LAZY_CLEAR(1u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), renderTexture, (0, 0),
- (kSize, kSize), 0, 0));
+ EXPECT_LAZY_CLEAR(1u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), renderTexture,
+ (0, 0, 0), (kSize, kSize), 0));
// Expect the first array layer to have been lazy cleared to 0.
- EXPECT_LAZY_CLEAR(0u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), sampleTexture, (0, 0),
- (kSize, kSize), 0, 0));
+ EXPECT_LAZY_CLEAR(0u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithZeros.data(), sampleTexture,
+ (0, 0, 0), (kSize, kSize), 0));
// Expect the second array layer to still be filled with 2.
std::vector<RGBA8> expectedWithTwos(kSize * kSize, {2, 2, 2, 2});
- EXPECT_LAZY_CLEAR(0u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithTwos.data(), sampleTexture, (0, 0),
- (kSize, kSize), 0, 1));
+ EXPECT_LAZY_CLEAR(0u, EXPECT_TEXTURE_RGBA8_EQ(expectedWithTwos.data(), sampleTexture, (0, 0, 1),
+ (kSize, kSize), 0));
// Expect the whole texture to be initialized
EXPECT_EQ(true, dawn_native::IsTextureSubresourceInitialized(sampleTexture.Get(), 0, 1, 0, 2));
@@ -1487,7 +1486,7 @@
// Expect texture initialized to be true
EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), 0, 1, 0, 1));
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kSize, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kSize, kSize), 0);
}
// Test WriteTexture to a subset of the texture, lazy init is necessary to clear the other
@@ -1522,10 +1521,9 @@
std::vector<RGBA8> expectedZeros((kSize / 2) * kSize, {0, 0, 0, 0});
// first half filled with 100, by the data
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kSize / 2, kSize), 0, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kSize / 2, kSize), 0);
// second half should be cleared
- EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kSize / 2, 0), (kSize / 2, kSize), 0,
- 0);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kSize / 2, 0), (kSize / 2, kSize), 0);
}
// In this test WriteTexture fully overwrites a range of subresources, so lazy initialization
@@ -1564,7 +1562,7 @@
kCopyLayerCount));
for (uint32_t layer = kBaseArrayLayer; layer < kBaseArrayLayer + kCopyLayerCount; ++layer) {
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kSize, kSize), 0, layer);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0, layer), (kSize, kSize), 0);
}
}
@@ -1606,10 +1604,10 @@
std::vector<RGBA8> expectedZeros((kSize / 2) * kSize, {0, 0, 0, 0});
for (uint32_t layer = kBaseArrayLayer; layer < kBaseArrayLayer + kCopyLayerCount; ++layer) {
// first half filled with 100, by the data
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kSize / 2, kSize), 0, layer);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0, layer), (kSize / 2, kSize), 0);
// second half should be cleared
- EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kSize / 2, 0), (kSize / 2, kSize),
- 0, layer);
+ EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kSize / 2, 0, layer),
+ (kSize / 2, kSize), 0);
}
}
@@ -1645,7 +1643,7 @@
// Expect texture initialized to be true
EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(texture.Get(), kMipLevel, 1, 0, 1));
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kMipSize, kMipSize), kMipLevel, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kMipSize, kMipSize), kMipLevel);
}
// Test WriteTexture to a subset of the texture at mip level, lazy init is necessary to clear the
@@ -1685,10 +1683,10 @@
std::vector<RGBA8> expectedZeros((kMipSize / 2) * kMipSize, {0, 0, 0, 0});
// first half filled with 100, by the data
- EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kMipSize / 2, kMipSize), kMipLevel, 0);
+ EXPECT_TEXTURE_RGBA8_EQ(data.data(), texture, (0, 0), (kMipSize / 2, kMipSize), kMipLevel);
// second half should be cleared
EXPECT_TEXTURE_RGBA8_EQ(expectedZeros.data(), texture, (kMipSize / 2, 0),
- (kMipSize / 2, kMipSize), kMipLevel, 0);
+ (kMipSize / 2, kMipSize), kMipLevel);
}
DAWN_INSTANTIATE_TEST(TextureZeroInitTest,
@@ -1816,7 +1814,7 @@
std::vector<RGBA8> expected(nonPaddedCopyExtent.width * nonPaddedCopyExtent.height,
{0x00, 0x20, 0x08, 0xFF});
EXPECT_TEXTURE_RGBA8_EQ(expected.data(), renderPass.color, (0, 0),
- (nonPaddedCopyExtent.width, nonPaddedCopyExtent.height), 0, 0);
+ (nonPaddedCopyExtent.width, nonPaddedCopyExtent.height), 0);
EXPECT_TRUE(dawn_native::IsTextureSubresourceInitialized(bcTexture.Get(), viewMipmapLevel,
1, baseArrayLayer, 1));
@@ -1825,7 +1823,7 @@
std::vector<RGBA8> expectBlack(nonPaddedCopyExtent.width * nonPaddedCopyExtent.height,
{0x00, 0x00, 0x00, 0xFF});
EXPECT_TEXTURE_RGBA8_EQ(expectBlack.data(), renderPass.color, (copyExtent3D.width, 0),
- (nonPaddedCopyExtent.width, nonPaddedCopyExtent.height), 0, 0);
+ (nonPaddedCopyExtent.width, nonPaddedCopyExtent.height), 0);
}
}