Replace TextureCopyView::arrayLayer -> origin.z in backends
Also fix a misuse of VkBufferImageCopy that caused some Swiftshader
failures.
Bug: dawn:22
Change-Id: Ie812a590d70c7561dfcf2f78ce6c530187610e65
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp
index 5b8bc64..b282dc8 100644
--- a/src/dawn_native/CommandEncoder.cpp
+++ b/src/dawn_native/CommandEncoder.cpp
@@ -737,13 +737,8 @@
copy->source.rowsPerImage = defaultedRowsPerImage;
copy->destination.texture = destination->texture;
copy->destination.origin = destination->origin;
- copy->copySize = *copySize;
copy->destination.mipLevel = destination->mipLevel;
- copy->destination.arrayLayer = destination->arrayLayer;
-
- // TODO(cwallez@chromium.org): Make backends use origin.z instead of arrayLayer
- copy->destination.arrayLayer = copy->destination.origin.z;
- copy->destination.origin.z = 0;
+ copy->copySize = *copySize;
return {};
});
@@ -803,17 +798,12 @@
allocator->Allocate<CopyTextureToBufferCmd>(Command::CopyTextureToBuffer);
copy->source.texture = source->texture;
copy->source.origin = source->origin;
- copy->copySize = *copySize;
copy->source.mipLevel = source->mipLevel;
- copy->source.arrayLayer = source->arrayLayer;
copy->destination.buffer = destination->buffer;
copy->destination.offset = destination->offset;
copy->destination.bytesPerRow = destination->bytesPerRow;
copy->destination.rowsPerImage = defaultedRowsPerImage;
-
- // TODO(cwallez@chromium.org): Make backends use origin.z instead of arrayLayer
- copy->source.arrayLayer = copy->source.origin.z;
- copy->source.origin.z = 0;
+ copy->copySize = *copySize;
return {};
});
@@ -860,19 +850,11 @@
copy->source.texture = source->texture;
copy->source.origin = source->origin;
copy->source.mipLevel = source->mipLevel;
- copy->source.arrayLayer = source->arrayLayer;
copy->destination.texture = destination->texture;
copy->destination.origin = destination->origin;
copy->destination.mipLevel = destination->mipLevel;
- copy->destination.arrayLayer = destination->arrayLayer;
copy->copySize = *copySize;
- // TODO(cwallez@chromium.org): Make backends use origin.z instead of arrayLayer
- copy->source.arrayLayer = copy->source.origin.z;
- copy->source.origin.z = 0;
- copy->destination.arrayLayer = copy->destination.origin.z;
- copy->destination.origin.z = 0;
-
return {};
});
}