D3D12: Fix crash in the workaround for T2T copy issue on Intel GPUs
This patch fixes a bug in the computation of temporary buffer size in
the implementation of the workaround for the T2T copy issue on Intel
GPUs.
With this tests all the T2T operation tests in WebGPU CTS will be able
to pass on Intel Gen9 and Gen9.5 GPUs.
BUG=chromium:1161355
TEST=dawn_end2end_tests
Change-Id: Ic4fb0c0056cf7b01720e47cc91c37a9f293cd194
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44840
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/src/tests/end2end/CopyTests.cpp b/src/tests/end2end/CopyTests.cpp
index 05e85a5..f6d6a3d 100644
--- a/src/tests/end2end/CopyTests.cpp
+++ b/src/tests/end2end/CopyTests.cpp
@@ -1628,13 +1628,17 @@
ASSERT_LE(kSrcSize, kTextureBytesPerRowAlignment);
ASSERT_LE(kDstSize, kTextureBytesPerRowAlignment);
+ // The copyDepth to test:
+ // 1u (non-array texture), 3u (copyDepth < copyWidth), 5u (copyDepth > copyWidth)
+ constexpr std::array<uint32_t, 3> kTestTextureDepth = {1u, 3u, 5u};
+
for (wgpu::TextureFormat format : kFormats) {
if (HasToggleEnabled("disable_snorm_read") &&
(format == wgpu::TextureFormat::RG8Snorm || format == wgpu::TextureFormat::R8Snorm)) {
continue;
}
- for (uint32_t textureDepth = 1; textureDepth < 3; ++textureDepth) {
+ for (uint32_t textureDepth : kTestTextureDepth) {
const wgpu::Extent3D kUploadSize = {4u, 4u, textureDepth};
for (uint32_t srcLevel = 0; srcLevel < kSrcLevelCount; ++srcLevel) {