From 948ef4292f4e6415995d0bf11f6c309d798ba598 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Fri, 28 Apr 2023 19:01:32 +0000 Subject: [PATCH] d3d11: fix Queue::WriteTexture() and enable queue related tests Bug: dawn:1705 Change-Id: I63540d46335401aeaa46efe157fdb7a191aa4637 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128860 Reviewed-by: Corentin Wallez Commit-Queue: Peng Huang Kokoro: Kokoro --- src/dawn/native/d3d11/QueueD3D11.cpp | 4 ++-- src/dawn/tests/end2end/QueueTests.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/dawn/native/d3d11/QueueD3D11.cpp b/src/dawn/native/d3d11/QueueD3D11.cpp index 1fd5bc0e3a..fc1134ea83 100644 --- a/src/dawn/native/d3d11/QueueD3D11.cpp +++ b/src/dawn/native/d3d11/QueueD3D11.cpp @@ -81,8 +81,8 @@ MaybeError Queue::WriteTextureImpl(const ImageCopyTexture& destination, Texture* texture = ToBackend(destination.texture); return texture->Write(commandContext, subresources, destination.origin, writeSizePixel, - static_cast(data), dataLayout.bytesPerRow, - dataLayout.rowsPerImage); + static_cast(data) + dataLayout.offset, + dataLayout.bytesPerRow, dataLayout.rowsPerImage); } } // namespace dawn::native::d3d11 diff --git a/src/dawn/tests/end2end/QueueTests.cpp b/src/dawn/tests/end2end/QueueTests.cpp index 23e6f40ffc..8531181305 100644 --- a/src/dawn/tests/end2end/QueueTests.cpp +++ b/src/dawn/tests/end2end/QueueTests.cpp @@ -30,6 +30,7 @@ TEST_P(QueueTests, GetQueueSameObject) { } DAWN_INSTANTIATE_TEST(QueueTests, + D3D11Backend(), D3D12Backend(), MetalBackend(), NullBackend(), @@ -187,6 +188,7 @@ TEST_P(QueueWriteBufferTests, UnalignedDynamicUploader) { } DAWN_INSTANTIATE_TEST(QueueWriteBufferTests, + D3D11Backend(), D3D12Backend(), MetalBackend(), OpenGLBackend(), @@ -639,6 +641,9 @@ TEST_P(QueueWriteTextureTests, WriteStencilAspectWithSourceOffsetUnalignedTo4) { // Copies to a single aspect are unsupported on OpenGL. DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES()); + // Copies to a single aspect are unsupported on D3D11. + DAWN_SUPPRESS_TEST_IF(IsD3D11()); + wgpu::TextureDescriptor textureDescriptor; textureDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8; textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst; @@ -743,6 +748,9 @@ TEST_P(QueueWriteTextureTests, WriteStencilAspectAfterOtherQueueWriteTextureCall // Copies to a single aspect are unsupported on OpenGL. DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES()); + // Copies to a single aspect are unsupported on D3D11. + DAWN_SUPPRESS_TEST_IF(IsD3D11()); + wgpu::TextureDescriptor textureDescriptor; textureDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8; textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst; @@ -771,6 +779,7 @@ TEST_P(QueueWriteTextureTests, WriteStencilAspectAfterOtherQueueWriteTextureCall } DAWN_INSTANTIATE_TEST(QueueWriteTextureTests, + D3D11Backend(), D3D12Backend(), D3D12Backend({"d3d12_use_temp_buffer_in_depth_stencil_texture_and_buffer_" "copy_with_non_zero_buffer_offset"}),