Remove the TODO about using CopyResource() on 1D textures
This patch removes a TODO about using CopyResource() on 1D textures
as it has already been the case with the current code.
This patch also adds an end2end test about doing a full copy with
1D textures as a verification.
Bug: chromium:42240279,chromium:42242046
Test: dawn_end2end_tests
Change-Id: Ib663e2c65c5c71c3946a34150296234b34bb0086
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/212674
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/native/d3d12/CommandBufferD3D12.cpp b/src/dawn/native/d3d12/CommandBufferD3D12.cpp
index e5718d5..e365237 100644
--- a/src/dawn/native/d3d12/CommandBufferD3D12.cpp
+++ b/src/dawn/native/d3d12/CommandBufferD3D12.cpp
@@ -90,7 +90,6 @@
// https://docs.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-copyresource
// In order to use D3D12's copy resource, the textures must be the same dimensions, and
// the copy must be of the entire resource.
- // TODO(dawn:129): Support 1D textures.
return src.aspect == src.texture->GetFormat().aspects &&
src.texture->GetDimension() == dst.texture->GetDimension() && //
dst.texture->GetNumMipLevels() == 1 && //
diff --git a/src/dawn/tests/end2end/CopyTests.cpp b/src/dawn/tests/end2end/CopyTests.cpp
index ddcd2ee..57dc411 100644
--- a/src/dawn/tests/end2end/CopyTests.cpp
+++ b/src/dawn/tests/end2end/CopyTests.cpp
@@ -2822,6 +2822,18 @@
}
}
+// Test that copying whole 1D texture in one texture-to-texture-copy works.
+TEST_P(CopyTests_T2T, Texture1DFull) {
+ constexpr uint32_t kWidth = 256;
+ constexpr uint32_t kHeight = 1;
+ constexpr uint32_t kDepth = 1;
+
+ TextureSpec textureSpec;
+ textureSpec.textureSize = {kWidth, kHeight, kDepth};
+
+ DoTest(textureSpec, textureSpec, {kWidth, kHeight, kDepth}, false, wgpu::TextureDimension::e1D);
+}
+
// Test that copying whole 3D texture in one texture-to-texture-copy works.
TEST_P(CopyTests_T2T, Texture3DFull) {
// TODO(crbug.com/dawn/2294): diagnose T2B failures on Pixel 4 OpenGLES