d3d11: Fix 0 DstZ for CopySubresourceRegion

DstZ only must be 0 for 1D/2D textures. It still needs to be set with
the right value for 3D textures.

Bug: dawn:1908
Bug: dawn:1705

Change-Id: Id160a1c13a6561ac62bb637a52f6c864da96549d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/140320
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/d3d11/TextureD3D11.cpp b/src/dawn/native/d3d11/TextureD3D11.cpp
index 2fad2fe..e932329 100644
--- a/src/dawn/native/d3d11/TextureD3D11.cpp
+++ b/src/dawn/native/d3d11/TextureD3D11.cpp
@@ -746,7 +746,8 @@
                                              D3D11Aspect(dstSubresources.aspects));
         commandContext->GetD3D11DeviceContext1()->CopySubresourceRegion(
             ToBackend(dst.texture)->GetD3D11Resource(), dstSubresource, dst.origin.x, dst.origin.y,
-            0, ToBackend(src.texture)->GetD3D11Resource(), srcSubresource,
+            dst.texture->GetDimension() == wgpu::TextureDimension::e3D ? dst.origin.z : 0,
+            ToBackend(src.texture)->GetD3D11Resource(), srcSubresource,
             isWholeSubresource ? nullptr : &srcBox);
     }