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 <cwallez@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Peng Huang 2023-04-28 19:01:32 +00:00 committed by Dawn LUCI CQ
parent 85d98a91f7
commit 948ef4292f
2 changed files with 11 additions and 2 deletions

View File

@ -81,8 +81,8 @@ MaybeError Queue::WriteTextureImpl(const ImageCopyTexture& destination,
Texture* texture = ToBackend(destination.texture); Texture* texture = ToBackend(destination.texture);
return texture->Write(commandContext, subresources, destination.origin, writeSizePixel, return texture->Write(commandContext, subresources, destination.origin, writeSizePixel,
static_cast<const uint8_t*>(data), dataLayout.bytesPerRow, static_cast<const uint8_t*>(data) + dataLayout.offset,
dataLayout.rowsPerImage); dataLayout.bytesPerRow, dataLayout.rowsPerImage);
} }
} // namespace dawn::native::d3d11 } // namespace dawn::native::d3d11

View File

@ -30,6 +30,7 @@ TEST_P(QueueTests, GetQueueSameObject) {
} }
DAWN_INSTANTIATE_TEST(QueueTests, DAWN_INSTANTIATE_TEST(QueueTests,
D3D11Backend(),
D3D12Backend(), D3D12Backend(),
MetalBackend(), MetalBackend(),
NullBackend(), NullBackend(),
@ -187,6 +188,7 @@ TEST_P(QueueWriteBufferTests, UnalignedDynamicUploader) {
} }
DAWN_INSTANTIATE_TEST(QueueWriteBufferTests, DAWN_INSTANTIATE_TEST(QueueWriteBufferTests,
D3D11Backend(),
D3D12Backend(), D3D12Backend(),
MetalBackend(), MetalBackend(),
OpenGLBackend(), OpenGLBackend(),
@ -639,6 +641,9 @@ TEST_P(QueueWriteTextureTests, WriteStencilAspectWithSourceOffsetUnalignedTo4) {
// Copies to a single aspect are unsupported on OpenGL. // Copies to a single aspect are unsupported on OpenGL.
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES()); DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
// Copies to a single aspect are unsupported on D3D11.
DAWN_SUPPRESS_TEST_IF(IsD3D11());
wgpu::TextureDescriptor textureDescriptor; wgpu::TextureDescriptor textureDescriptor;
textureDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8; textureDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8;
textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst; 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. // Copies to a single aspect are unsupported on OpenGL.
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES()); DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
// Copies to a single aspect are unsupported on D3D11.
DAWN_SUPPRESS_TEST_IF(IsD3D11());
wgpu::TextureDescriptor textureDescriptor; wgpu::TextureDescriptor textureDescriptor;
textureDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8; textureDescriptor.format = wgpu::TextureFormat::Depth24PlusStencil8;
textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst; textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst;
@ -771,6 +779,7 @@ TEST_P(QueueWriteTextureTests, WriteStencilAspectAfterOtherQueueWriteTextureCall
} }
DAWN_INSTANTIATE_TEST(QueueWriteTextureTests, DAWN_INSTANTIATE_TEST(QueueWriteTextureTests,
D3D11Backend(),
D3D12Backend(), D3D12Backend(),
D3D12Backend({"d3d12_use_temp_buffer_in_depth_stencil_texture_and_buffer_" D3D12Backend({"d3d12_use_temp_buffer_in_depth_stencil_texture_and_buffer_"
"copy_with_non_zero_buffer_offset"}), "copy_with_non_zero_buffer_offset"}),