From f32ae5b68020670d0a3f14760b83664c6933be45 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Tue, 29 Mar 2022 16:11:34 +0000 Subject: [PATCH] GLES: fix texture-to-texture copy with offset src or dest region. glBlitFramebuffer() takes min and max coordinates, not min and size. Bug: dawn:1084 Change-Id: I7b8b53ecd9c5ade20d4d7a909bd134c13a2d960b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85081 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Stephen White --- src/dawn/native/opengl/UtilsGL.cpp | 4 ++-- src/dawn/tests/end2end/CopyTests.cpp | 7 ------- src/dawn/tests/end2end/NonzeroTextureCreationTests.cpp | 4 ---- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/dawn/native/opengl/UtilsGL.cpp b/src/dawn/native/opengl/UtilsGL.cpp index f0dcdbe0d8..746f93bb3f 100644 --- a/src/dawn/native/opengl/UtilsGL.cpp +++ b/src/dawn/native/opengl/UtilsGL.cpp @@ -140,8 +140,8 @@ namespace dawn::native::opengl { dstLevel, dst.z + layer); } } - gl.BlitFramebuffer(src.x, src.y, size.width, size.height, dst.x, dst.y, size.width, - size.height, blitMask, GL_NEAREST); + gl.BlitFramebuffer(src.x, src.y, src.x + size.width, src.y + size.height, dst.x, dst.y, + dst.x + size.width, dst.y + size.height, blitMask, GL_NEAREST); } gl.Enable(GL_SCISSOR_TEST); gl.DeleteFramebuffers(1, &readFBO); diff --git a/src/dawn/tests/end2end/CopyTests.cpp b/src/dawn/tests/end2end/CopyTests.cpp index ed661d3cdd..f57c7a56ea 100644 --- a/src/dawn/tests/end2end/CopyTests.cpp +++ b/src/dawn/tests/end2end/CopyTests.cpp @@ -1194,8 +1194,6 @@ TEST_P(CopyTests_T2B, Texture3DFull) { // Test that copying a range of texture 3D depths in one texture-to-buffer-copy works. TEST_P(CopyTests_T2B, Texture3DSubRegion) { - DAWN_TEST_UNSUPPORTED_IF(IsANGLE()); // TODO(crbug.com/angleproject/5967) - constexpr uint32_t kWidth = 256; constexpr uint32_t kHeight = 128; constexpr uint32_t kDepth = 6; @@ -1789,8 +1787,6 @@ TEST_P(CopyTests_B2T, Texture3DFull) { // Test that copying a range of texture 3D Depths in one texture-to-buffer-copy works. TEST_P(CopyTests_B2T, Texture3DSubRegion) { - DAWN_TEST_UNSUPPORTED_IF(IsANGLE()); // TODO(crbug.com/angleproject/5967) - constexpr uint32_t kWidth = 256; constexpr uint32_t kHeight = 128; constexpr uint32_t kDepth = 6; @@ -2299,7 +2295,6 @@ TEST_P(CopyTests_T2T, Texture3DTo2DArrayFull) { // Test that copying between 3D texture and 2D array textures works. It includes partial copy // for src and/or dst texture, non-zero offset (copy origin), non-zero mip level. TEST_P(CopyTests_T2T, Texture3DAnd2DArraySubRegion) { - DAWN_TEST_UNSUPPORTED_IF(IsANGLE()); // TODO(crbug.com/angleproject/5967) // TODO(crbug.com/dawn/1216): Remove this suppression. DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsNvidia()); @@ -2374,7 +2369,6 @@ TEST_P(CopyTests_T2T, Texture2DArrayTo3DFull) { // Test that copying subregion of a 3D texture in one texture-to-texture-copy works. TEST_P(CopyTests_T2T, Texture3DSubRegion) { - DAWN_TEST_UNSUPPORTED_IF(IsANGLE()); // TODO(crbug.com/angleproject/5967) constexpr uint32_t kWidth = 256; constexpr uint32_t kHeight = 128; constexpr uint32_t kDepth = 6u; @@ -2402,7 +2396,6 @@ TEST_P(CopyTests_T2T, Texture3DTo2DArraySubRegion) { // Test that copying subregion of a 2D array to a 3D texture to in one texture-to-texture-copy // works. TEST_P(CopyTests_T2T, Texture2DArrayTo3DSubRegion) { - DAWN_TEST_UNSUPPORTED_IF(IsANGLE()); // TODO(crbug.com/angleproject/5967) // TODO(crbug.com/dawn/1216): Remove this suppression. DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsNvidia()); constexpr uint32_t kWidth = 256; diff --git a/src/dawn/tests/end2end/NonzeroTextureCreationTests.cpp b/src/dawn/tests/end2end/NonzeroTextureCreationTests.cpp index 73a863d605..5d8878c616 100644 --- a/src/dawn/tests/end2end/NonzeroTextureCreationTests.cpp +++ b/src/dawn/tests/end2end/NonzeroTextureCreationTests.cpp @@ -92,10 +92,6 @@ namespace { DAWN_TEST_UNSUPPORTED_IF(GetParam().mFormat == wgpu::TextureFormat::RGBA8Snorm && HasToggleEnabled("disable_snorm_read")); - // TODO(crbug.com/angleproject/5967): This texture readback hits an assert in ANGLE. - DAWN_SUPPRESS_TEST_IF(GetParam().mDimension == wgpu::TextureDimension::e3D && - IsANGLE()); - // TODO(crbug.com/dawn/791): Determine Intel specific platforms this occurs on, and // implement a workaround on all backends (happens on Windows too, but not on our test // machines).