d3d11: enable BufferZeroInitTests.Copy2DArrayTextureToBuffer

This fixes the dst buffer initialization for Texture2BufferCopy.

Bug: dawn:1799
Bug: dawn:1705
Change-Id: Ibd4d2db9e6e0b025acf3385591f285edd2aa64ec
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131701
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Peng Huang <penghuang@chromium.org>
This commit is contained in:
jchen10 2023-05-06 06:20:08 +00:00 committed by Dawn LUCI CQ
parent 331ef65fed
commit 8b2ab40c39
2 changed files with 8 additions and 18 deletions

View File

@ -198,21 +198,14 @@ MaybeError CommandBuffer::Execute() {
Buffer::ScopedMap scopedDstMap; Buffer::ScopedMap scopedDstMap;
DAWN_TRY_ASSIGN(scopedDstMap, Buffer::ScopedMap::Create(buffer)); DAWN_TRY_ASSIGN(scopedDstMap, Buffer::ScopedMap::Create(buffer));
Texture::ReadCallback callback; DAWN_TRY(buffer->EnsureDataInitializedAsDestination(commandContext, copy));
if (scopedDstMap.GetMappedData()) {
callback = [&](const uint8_t* data, uint64_t offset, Texture::ReadCallback callback = [&](const uint8_t* data, uint64_t offset,
uint64_t size) -> MaybeError { uint64_t size) -> MaybeError {
memcpy(scopedDstMap.GetMappedData() + dst.offset + offset, data, size); DAWN_TRY(ToBackend(dst.buffer)
return {}; ->Write(commandContext, dst.offset + offset, data, size));
}; return {};
} else { };
callback = [&](const uint8_t* data, uint64_t offset,
uint64_t size) -> MaybeError {
DAWN_TRY(ToBackend(dst.buffer)
->Write(commandContext, dst.offset + offset, data, size));
return {};
};
}
DAWN_TRY(ToBackend(src.texture) DAWN_TRY(ToBackend(src.texture)
->Read(commandContext, subresources, src.origin, copy->copySize, ->Read(commandContext, subresources, src.origin, copy->copySize,

View File

@ -967,9 +967,6 @@ TEST_P(BufferZeroInitTest, Copy2DTextureToBuffer) {
// Test that the code path of CopyTextureToBuffer clears the destination buffer correctly when it is // Test that the code path of CopyTextureToBuffer clears the destination buffer correctly when it is
// the first use of the buffer and the texture is a 2D array texture. // the first use of the buffer and the texture is a 2D array texture.
TEST_P(BufferZeroInitTest, Copy2DArrayTextureToBuffer) { TEST_P(BufferZeroInitTest, Copy2DArrayTextureToBuffer) {
// TODO(dawn:1799): Figure this out.
DAWN_SUPPRESS_TEST_IF(IsD3D11());
constexpr wgpu::Extent3D kTextureSize = {64u, 4u, 3u}; constexpr wgpu::Extent3D kTextureSize = {64u, 4u, 3u};
// bytesPerRow == texelBlockSizeInBytes * copySize.width && rowsPerImage == copySize.height && // bytesPerRow == texelBlockSizeInBytes * copySize.width && rowsPerImage == copySize.height &&