From 9288ea605d4533b4bf9f17557f8d12fc6e9b37ca Mon Sep 17 00:00:00 2001 From: Yunchao He Date: Thu, 17 Jun 2021 02:36:48 +0000 Subject: [PATCH] Fix a bug in 3D texture copy splitter for D3D12 TextureOffset should respect both origin and copySize when we are addressing the empty first row issue. So textureOffset in copy 1 should just move/add (copySize.height - blockInfo.height) rows in order to copy the last row of all depth slices but the last one. Bug: dawn:547 Change-Id: I6a1acf656651869c8934897d5c7e8974f1a5eb9a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54441 Commit-Queue: Jiawei Shao Reviewed-by: Corentin Wallez Reviewed-by: Jiawei Shao --- src/dawn_native/d3d12/TextureCopySplitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dawn_native/d3d12/TextureCopySplitter.cpp b/src/dawn_native/d3d12/TextureCopySplitter.cpp index 7297f50a00..fd9dccc471 100644 --- a/src/dawn_native/d3d12/TextureCopySplitter.cpp +++ b/src/dawn_native/d3d12/TextureCopySplitter.cpp @@ -381,7 +381,7 @@ namespace dawn_native { namespace d3d12 { TextureCopySubresource::CopyInfo* copy1 = copy.AddCopy(); *copy1 = copy0; copy1->alignedOffset += 2 * bytesPerRow; - copy1->textureOffset.y = copySize.height - blockInfo.height; + copy1->textureOffset.y += copySize.height - blockInfo.height; // Offset two rows from the copy height for the bufferOffset (See the figure above): // - one for the row we advanced in the buffer: row (N + 4). // - one for the last row we want to copy: row (N + 3) itself.