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 <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Yunchao He 2021-06-17 02:36:48 +00:00 committed by Dawn LUCI CQ
parent cd417bc9a1
commit 9288ea605d
1 changed files with 1 additions and 1 deletions

View File

@ -381,7 +381,7 @@ namespace dawn_native { namespace d3d12 {
TextureCopySubresource::CopyInfo* copy1 = copy.AddCopy(); TextureCopySubresource::CopyInfo* copy1 = copy.AddCopy();
*copy1 = copy0; *copy1 = copy0;
copy1->alignedOffset += 2 * bytesPerRow; 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): // 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 row we advanced in the buffer: row (N + 4).
// - one for the last row we want to copy: row (N + 3) itself. // - one for the last row we want to copy: row (N + 3) itself.