From b46b75f4effa66095c5f63efd952a0d19abcad8f Mon Sep 17 00:00:00 2001 From: Pedro Pontes Date: Fri, 18 Jun 2021 23:51:37 +0200 Subject: [PATCH 1/2] chore: cherry-pick 3d4f87ab5b9b from angle --- patches/angle/.patches | 1 + patches/angle/cherry-pick-3d4f87ab5b9b.patch | 62 ++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 patches/angle/cherry-pick-3d4f87ab5b9b.patch diff --git a/patches/angle/.patches b/patches/angle/.patches index 82ed05bacaf4f..b291c2cc2b545 100644 --- a/patches/angle/.patches +++ b/patches/angle/.patches @@ -1 +1,2 @@ d3d11_skip_blits_if_there_is_no_intersection_of_dest_areas.patch +cherry-pick-3d4f87ab5b9b.patch diff --git a/patches/angle/cherry-pick-3d4f87ab5b9b.patch b/patches/angle/cherry-pick-3d4f87ab5b9b.patch new file mode 100644 index 0000000000000..6232146c32aec --- /dev/null +++ b/patches/angle/cherry-pick-3d4f87ab5b9b.patch @@ -0,0 +1,62 @@ +From 3d4f87ab5b9ba4c720cedf1f219cc0884038b140 Mon Sep 17 00:00:00 2001 +From: Jamie Madill +Date: Thu, 20 May 2021 12:22:46 -0400 +Subject: [PATCH] D3D11: Fix respecifying 3D textures. + + + +The missing check for the "Depth" dimension could lead to a bug +where we would not recreate a texture when the dimension changed. + +Bug: chromium:1210414 +Change-Id: Id59097ad14ae77ff80d27081f61786dad17a77ea +Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911032 +Reviewed-by: Geoff Lang +Commit-Queue: Jamie Madill +(cherry picked from commit 2697358464cf20576701987f60300b6c4086c11e) +Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2937026 +Reviewed-by: Jamie Madill +--- + +diff --git a/src/libANGLE/renderer/d3d/d3d11/Image11.cpp b/src/libANGLE/renderer/d3d/d3d11/Image11.cpp +index 7aef56e..cb5563e 100644 +--- a/src/libANGLE/renderer/d3d/d3d11/Image11.cpp ++++ b/src/libANGLE/renderer/d3d/d3d11/Image11.cpp +@@ -225,8 +225,8 @@ + const gl::Extents &size, + bool forceRelease) + { +- if (mWidth != size.width || mHeight != size.height || mInternalFormat != internalformat || +- forceRelease) ++ if (mWidth != size.width || mHeight != size.height || mDepth != size.depth || ++ mInternalFormat != internalformat || forceRelease) + { + // End the association with the TextureStorage, since that data will be out of date. + // Also reset mRecoveredFromStorageCount since this Image is getting completely redefined. +diff --git a/src/tests/gl_tests/MipmapTest.cpp b/src/tests/gl_tests/MipmapTest.cpp +index b15ab3d..d5720eb 100644 +--- a/src/tests/gl_tests/MipmapTest.cpp ++++ b/src/tests/gl_tests/MipmapTest.cpp +@@ -2070,6 +2070,22 @@ + EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 8, getWindowHeight() / 8, GLColor::green); + } + ++// Tests respecifying 3D mipmaps. ++TEST_P(MipmapTestES3, Generate3DMipmapRespecification) ++{ ++ std::vector pixels(256 * 256 * 100, GLColor::black); ++ ++ GLTexture texture; ++ glBindTexture(GL_TEXTURE_3D, texture); ++ glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 256, 256, 100, 0, GL_RGBA, GL_UNSIGNED_BYTE, ++ pixels.data()); ++ glTexImage3D(GL_TEXTURE_3D, 1, GL_RGBA, 128, 128, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, ++ pixels.data()); ++ glGenerateMipmap(GL_TEXTURE_3D); ++ ++ ASSERT_GL_NO_ERROR(); ++} ++ + // Use this to select which configurations (e.g. which renderer, which GLES major version) these + // tests should be run against. + ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(MipmapTest); From c1111762f9fb599ee2827924b1b4d97624f6b775 Mon Sep 17 00:00:00 2001 From: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Date: Fri, 18 Jun 2021 22:03:24 +0000 Subject: [PATCH 2/2] chore: update patches --- patches/angle/cherry-pick-3d4f87ab5b9b.patch | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/patches/angle/cherry-pick-3d4f87ab5b9b.patch b/patches/angle/cherry-pick-3d4f87ab5b9b.patch index 6232146c32aec..811d0a8867ebc 100644 --- a/patches/angle/cherry-pick-3d4f87ab5b9b.patch +++ b/patches/angle/cherry-pick-3d4f87ab5b9b.patch @@ -1,13 +1,11 @@ -From 3d4f87ab5b9ba4c720cedf1f219cc0884038b140 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Thu, 20 May 2021 12:22:46 -0400 -Subject: [PATCH] D3D11: Fix respecifying 3D textures. +Subject: D3D11: Fix respecifying 3D textures. + +The missing check for the "Depth" dimension could lead to a bug +where we would not recreate a texture when the dimension changed. - - -The missing check for the "Depth" dimension could lead to a bug -where we would not recreate a texture when the dimension changed. - Bug: chromium:1210414 Change-Id: Id59097ad14ae77ff80d27081f61786dad17a77ea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911032 @@ -16,13 +14,12 @@ Commit-Queue: Jamie Madill (cherry picked from commit 2697358464cf20576701987f60300b6c4086c11e) Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2937026 Reviewed-by: Jamie Madill ---- diff --git a/src/libANGLE/renderer/d3d/d3d11/Image11.cpp b/src/libANGLE/renderer/d3d/d3d11/Image11.cpp -index 7aef56e..cb5563e 100644 +index c502d00fac032ea708015bbbf4f51db2dc2b3c59..daa5c3abc3ab4f4460ec48d0aba9649cf66897ac 100644 --- a/src/libANGLE/renderer/d3d/d3d11/Image11.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/Image11.cpp -@@ -225,8 +225,8 @@ +@@ -223,8 +223,8 @@ bool Image11::redefine(gl::TextureType type, const gl::Extents &size, bool forceRelease) { @@ -34,10 +31,10 @@ index 7aef56e..cb5563e 100644 // End the association with the TextureStorage, since that data will be out of date. // Also reset mRecoveredFromStorageCount since this Image is getting completely redefined. diff --git a/src/tests/gl_tests/MipmapTest.cpp b/src/tests/gl_tests/MipmapTest.cpp -index b15ab3d..d5720eb 100644 +index 888088b5e38191e38e07bf50a0d1b6fa0a09db95..372c6645a587563c616a961ed3ac46dc667e9660 100644 --- a/src/tests/gl_tests/MipmapTest.cpp +++ b/src/tests/gl_tests/MipmapTest.cpp -@@ -2070,6 +2070,22 @@ +@@ -1991,6 +1991,22 @@ void main() EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 8, getWindowHeight() / 8, GLColor::green); }