From 2a799fe3bf352dce1c17efff2f20fa94ffe216f6 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Mon, 25 Jan 2021 19:42:18 +0000 Subject: [PATCH] Enable all the tests which were blocked on WriteTexture. Bug: dawn:483 dawn:643 Change-Id: Id6b6f0d1ff039eda3156bc371e6c722b3c72ac96 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38580 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Stephen White --- .../end2end/CopyTextureForBrowserTests.cpp | 33 ------------------- .../end2end/GpuMemorySynchronizationTests.cpp | 4 --- src/tests/end2end/QueueTests.cpp | 7 ---- src/tests/end2end/TextureZeroInitTests.cpp | 32 ++++++++---------- 4 files changed, 14 insertions(+), 62 deletions(-) diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp index d326d71a4d..dcb425eab3 100644 --- a/src/tests/end2end/CopyTextureForBrowserTests.cpp +++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp @@ -90,9 +90,6 @@ class CopyTextureForBrowserTests : public DawnTest { wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); - // Use writeTexture to populate the current slice of the texture in - // `level` mip level for all platforms except OpenGL. - // TODO(shaobo.yan@intel.com): OpenGL doesn't have 'WriteTexture' implementation. const utils::TextureDataCopyLayout copyLayout = utils::GetTextureDataCopyLayoutForTexture2DAtLevel( kTextureFormat, @@ -165,11 +162,6 @@ TEST_P(CopyTextureForBrowserTests, PassthroughCopy) { // Tests skip due to crbug.com/dawn/592. DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - // OpenGL tests fails because 'WriteTexture' is unimplemented. - // Related bug : crbug.com/dawn/483 - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - constexpr uint32_t kWidth = 10; constexpr uint32_t kHeight = 1; @@ -186,11 +178,6 @@ TEST_P(CopyTextureForBrowserTests, VerifyCopyOnXDirection) { // Tests skip due to crbug.com/dawn/592. DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - // OpenGL tests fails because 'WriteTexture' is unimplemented. - // Related bug : crbug.com/dawn/483 - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - constexpr uint32_t kWidth = 1000; constexpr uint32_t kHeight = 1; @@ -207,11 +194,6 @@ TEST_P(CopyTextureForBrowserTests, VerifyCopyOnYDirection) { // Tests skip due to crbug.com/dawn/592. DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - // OpenGL tests fails because 'WriteTexture' is unimplemented. - // Related bug : crbug.com/dawn/483 - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - constexpr uint32_t kWidth = 1; constexpr uint32_t kHeight = 1000; @@ -228,11 +210,6 @@ TEST_P(CopyTextureForBrowserTests, VerifyCopyFromLargeTexture) { // Tests skip due to crbug.com/dawn/592. DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - // OpenGL tests fails because 'WriteTexture' is unimplemented. - // Related bug : crbug.com/dawn/483 - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - constexpr uint32_t kWidth = 899; constexpr uint32_t kHeight = 999; @@ -249,11 +226,6 @@ TEST_P(CopyTextureForBrowserTests, VerifyFlipY) { // Tests skip due to crbug.com/dawn/592. DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - // OpenGL tests fails because 'WriteTexture' is unimplemented. - // Related bug : crbug.com/dawn/483 - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - constexpr uint32_t kWidth = 901; constexpr uint32_t kHeight = 1001; @@ -271,11 +243,6 @@ TEST_P(CopyTextureForBrowserTests, VerifyFlipYInSlimTexture) { // Tests skip due to crbug.com/dawn/592. DAWN_SKIP_TEST_IF(IsD3D12() && IsBackendValidationEnabled()); - // OpenGL tests fails because 'WriteTexture' is unimplemented. - // Related bug : crbug.com/dawn/483 - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - constexpr uint32_t kWidth = 1; constexpr uint32_t kHeight = 1001; diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index e5f97f8d2c..e0a8db7be2 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -237,10 +237,6 @@ TEST_P(GpuMemorySyncTests, ComputePassToRenderPass) { // Use an image as both sampled and readonly storage in a compute pass. This is a regression test // for the Vulkan backend choosing different layouts for Sampled and ReadOnlyStorage. TEST_P(GpuMemorySyncTests, SampledAndROStorageTextureInComputePass) { - // TODO(dawn:483): Test is skipped on OpenGL because it uses WriteTexture which is - // unimplemented. - DAWN_SKIP_TEST_IF(IsOpenGL() || IsOpenGLES()); - // Create a storage + sampled texture of one texel initialized to 1 wgpu::TextureDescriptor texDesc; texDesc.format = wgpu::TextureFormat::R32Uint; diff --git a/src/tests/end2end/QueueTests.cpp b/src/tests/end2end/QueueTests.cpp index d42ad6e5a1..1f6708258b 100644 --- a/src/tests/end2end/QueueTests.cpp +++ b/src/tests/end2end/QueueTests.cpp @@ -178,13 +178,6 @@ TEST_P(QueueWriteBufferTests, SuperLargeWriteBuffer) { // Test a special code path: writing when dynamic uploader already contatins some unaligned // data, it might be necessary to use a ring buffer with properly aligned offset. TEST_P(QueueWriteBufferTests, UnalignedDynamicUploader) { - // TODO(dawn:483): Skipping test because WriteTexture inside UnalignDynamicUploader - // is not implemented. Moreover when using UnalignDynamicUploader we are assuming - // that WriteTexture implementation uses a DynamicUploader which might be false in the - // case of a future OpenGL implementation. - DAWN_SKIP_TEST_IF(IsOpenGL()); - DAWN_SKIP_TEST_IF(IsOpenGLES()); - utils::UnalignDynamicUploader(device); wgpu::BufferDescriptor descriptor; diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp index 90fc5fac73..959b531521 100644 --- a/src/tests/end2end/TextureZeroInitTests.cpp +++ b/src/tests/end2end/TextureZeroInitTests.cpp @@ -1453,9 +1453,6 @@ TEST_P(TextureZeroInitTest, CopyTextureToBufferNonRenderableUnaligned) { // In this test WriteTexture fully overwrites a texture TEST_P(TextureZeroInitTest, WriteWholeTexture) { - // TODO(dawn:483): Remove this condition after implementing WriteTexture in those backends. - DAWN_SKIP_TEST_IF(IsOpenGL()); - wgpu::TextureDescriptor descriptor = CreateTextureDescriptor( 1, 1, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc, kColorFormat); wgpu::Texture texture = device.CreateTexture(&descriptor); @@ -1488,9 +1485,6 @@ TEST_P(TextureZeroInitTest, WriteWholeTexture) { // Test WriteTexture to a subset of the texture, lazy init is necessary to clear the other // half. TEST_P(TextureZeroInitTest, WriteTextureHalf) { - // TODO(dawn:483): Remove this condition after implementing WriteTexture in those backends. - DAWN_SKIP_TEST_IF(IsOpenGL()); - wgpu::TextureDescriptor descriptor = CreateTextureDescriptor( 4, 1, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc, @@ -1528,9 +1522,6 @@ TEST_P(TextureZeroInitTest, WriteTextureHalf) { // In this test WriteTexture fully overwrites a range of subresources, so lazy initialization // is needed for neither the subresources involved in the write nor the other subresources. TEST_P(TextureZeroInitTest, WriteWholeTextureArray) { - // TODO(dawn:483): Remove this condition after implementing WriteTexture in those backends. - DAWN_SKIP_TEST_IF(IsOpenGL()); - wgpu::TextureDescriptor descriptor = CreateTextureDescriptor( 1, 6, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc, kColorFormat); wgpu::Texture texture = device.CreateTexture(&descriptor); @@ -1571,9 +1562,6 @@ TEST_P(TextureZeroInitTest, WriteWholeTextureArray) { // Test WriteTexture to a subset of the subresource, lazy init is necessary to clear the other // half. TEST_P(TextureZeroInitTest, WriteTextureArrayHalf) { - // TODO(dawn:483): Remove this condition after implementing WriteTexture in those backends. - DAWN_SKIP_TEST_IF(IsOpenGL()); - wgpu::TextureDescriptor descriptor = CreateTextureDescriptor( 4, 6, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc, @@ -1618,9 +1606,6 @@ TEST_P(TextureZeroInitTest, WriteTextureArrayHalf) { // In this test WriteTexture fully overwrites a texture at mip level. TEST_P(TextureZeroInitTest, WriteWholeTextureAtMipLevel) { - // TODO(dawn:483): Remove this condition after implementing WriteTexture in those backends. - DAWN_SKIP_TEST_IF(IsOpenGL()); - wgpu::TextureDescriptor descriptor = CreateTextureDescriptor( 4, 1, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::CopySrc, kColorFormat); wgpu::Texture texture = device.CreateTexture(&descriptor); @@ -1657,9 +1642,6 @@ TEST_P(TextureZeroInitTest, WriteWholeTextureAtMipLevel) { // Test WriteTexture to a subset of the texture at mip level, lazy init is necessary to clear the // other half. TEST_P(TextureZeroInitTest, WriteTextureHalfAtMipLevel) { - // TODO(dawn:483): Remove this condition after implementing WriteTexture in those backends. - DAWN_SKIP_TEST_IF(IsOpenGL()); - wgpu::TextureDescriptor descriptor = CreateTextureDescriptor( 4, 1, wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled | wgpu::TextureUsage::CopySrc, @@ -1860,6 +1842,9 @@ TEST_P(CompressedTextureZeroInitTest, FullMipCopy) { // Test that 1 lazy clear count happens when we copy to half the texture TEST_P(CompressedTextureZeroInitTest, HalfCopyBufferToTexture) { + // TODO(crbug.com/dawn/643): diagnose and fix this failure on OpenGL. + DAWN_SKIP_TEST_IF(IsOpenGL()); + wgpu::TextureDescriptor textureDescriptor; textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled; @@ -1899,6 +1884,9 @@ TEST_P(CompressedTextureZeroInitTest, FullCopyToNonZeroMipLevel) { // Test that 1 lazy clear count happens when we copy buffer to half texture to a nonzero mip level // (with physical size different from the virtual mip size) TEST_P(CompressedTextureZeroInitTest, HalfCopyToNonZeroMipLevel) { + // TODO(crbug.com/dawn/643): diagnose and fix this failure on OpenGL. + DAWN_SKIP_TEST_IF(IsOpenGL()); + wgpu::TextureDescriptor textureDescriptor; textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled; @@ -1937,6 +1925,9 @@ TEST_P(CompressedTextureZeroInitTest, FullCopyToNonZeroArrayLayer) { // Test that 1 lazy clear count happens when we copy buffer to half texture to a nonzero array layer TEST_P(CompressedTextureZeroInitTest, HalfCopyToNonZeroArrayLayer) { + // TODO(crbug.com/dawn/643): diagnose and fix this failure on OpenGL. + DAWN_SKIP_TEST_IF(IsOpenGL()); + wgpu::TextureDescriptor textureDescriptor; textureDescriptor.usage = wgpu::TextureUsage::CopySrc | wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::Sampled; @@ -1998,6 +1989,9 @@ TEST_P(CompressedTextureZeroInitTest, FullCopyTextureToTextureMipLevel) { // half copy texture to texture, lazy clears are needed for noncopied half TEST_P(CompressedTextureZeroInitTest, HalfCopyTextureToTextureMipLevel) { + // TODO(crbug.com/dawn/643): diagnose and fix this failure on OpenGL. + DAWN_SKIP_TEST_IF(IsOpenGL()); + // create srcTexture with data wgpu::TextureDescriptor srcDescriptor = CreateTextureDescriptor( 3, 1, @@ -2044,4 +2038,6 @@ TEST_P(CompressedTextureZeroInitTest, HalfCopyTextureToTextureMipLevel) { DAWN_INSTANTIATE_TEST(CompressedTextureZeroInitTest, D3D12Backend({"nonzero_clear_resources_on_creation_for_testing"}), MetalBackend({"nonzero_clear_resources_on_creation_for_testing"}), + OpenGLBackend({"nonzero_clear_resources_on_creation_for_testing"}), + OpenGLESBackend({"nonzero_clear_resources_on_creation_for_testing"}), VulkanBackend({"nonzero_clear_resources_on_creation_for_testing"}));