diff options
author | android-autoroll <android-autoroll@skia-public.iam.gserviceaccount.com> | 2022-04-20 18:34:17 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-04-20 18:34:17 +0000 |
commit | c051a5b411f25c1a0c42e7f6de31165729c8fa04 (patch) | |
tree | 29dade7c8102f314ff1dafdf1854f618a0c7ca7f | |
parent | d7e8e849313c53d85acf739cd8f1d377a193b4fa (diff) | |
parent | f3e5d9fa66394c12495c7578ad27280087de265e (diff) | |
download | angle-c051a5b411f25c1a0c42e7f6de31165729c8fa04.tar.gz |
Roll ANGLE from 5014ce664ca5 to f4fc8e1688f5 (1 revision) am: 695ded07c3 am: f3e5d9fa66
Original change: https://android-review.googlesource.com/c/platform/external/angle/+/2068672
Change-Id: I36d8d2abadac39f976bceeecbcb48659d47cd142
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | src/libANGLE/State.cpp | 2 | ||||
-rw-r--r-- | src/libANGLE/angletypes.cpp | 16 | ||||
-rw-r--r-- | src/libANGLE/angletypes.h | 10 | ||||
-rw-r--r-- | src/libANGLE/angletypes_unittest.cpp | 17 |
4 files changed, 15 insertions, 30 deletions
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp index daee4f0f77..383bf7ce44 100644 --- a/src/libANGLE/State.cpp +++ b/src/libANGLE/State.cpp @@ -799,7 +799,7 @@ bool State::anyActiveDrawBufferChannelMasked() const { // Compare current color mask with all-enabled color mask, while ignoring disabled draw // buffers. - return (mBlendStateExt.compareColorMask(mBlendStateExt.mAllColorMask) & + return (mBlendStateExt.compareColorMask(mBlendStateExt.mMaxColorMask) & mDrawFramebuffer->getDrawBufferMask()) .any(); } diff --git a/src/libANGLE/angletypes.cpp b/src/libANGLE/angletypes.cpp index 6294e16ce9..9076160958 100644 --- a/src/libANGLE/angletypes.cpp +++ b/src/libANGLE/angletypes.cpp @@ -355,20 +355,16 @@ BlendStateExt::BlendStateExt(const size_t drawBuffers) mMaxEquationMask(EquationStorage::GetMask(drawBuffers)), mEquationColor(EquationStorage::GetReplicatedValue(BlendEquationType::Add, mMaxEquationMask)), mEquationAlpha(EquationStorage::GetReplicatedValue(BlendEquationType::Add, mMaxEquationMask)), - mAllColorMask(ColorMaskStorage::GetReplicatedValue(PackColorMask(true, true, true, true), - ColorMaskStorage::GetMask(drawBuffers))), - mColorMask(mAllColorMask), + mMaxColorMask(ColorMaskStorage::GetMask(drawBuffers)), + mColorMask(ColorMaskStorage::GetReplicatedValue(PackColorMask(true, true, true, true), + mMaxColorMask)), mMaxEnabledMask(0xFF >> (8 - drawBuffers)), mMaxDrawBuffers(drawBuffers) {} BlendStateExt::BlendStateExt(const BlendStateExt &other) = default; -BlendStateExt &BlendStateExt::operator=(const BlendStateExt &other) -{ - memcpy(this, &other, sizeof(BlendStateExt)); - return *this; -} +BlendStateExt &BlendStateExt::operator=(const BlendStateExt &other) = default; void BlendStateExt::setEnabled(const bool enabled) { @@ -387,14 +383,14 @@ BlendStateExt::ColorMaskStorage::Type BlendStateExt::expandColorMaskValue(const const bool alpha) const { return BlendStateExt::ColorMaskStorage::GetReplicatedValue( - PackColorMask(red, green, blue, alpha), mAllColorMask); + PackColorMask(red, green, blue, alpha), mMaxColorMask); } BlendStateExt::ColorMaskStorage::Type BlendStateExt::expandColorMaskIndexed( const size_t index) const { return ColorMaskStorage::GetReplicatedValue( - ColorMaskStorage::GetValueIndexed(index, mColorMask), mAllColorMask); + ColorMaskStorage::GetValueIndexed(index, mColorMask), mMaxColorMask); } void BlendStateExt::setColorMask(const bool red, diff --git a/src/libANGLE/angletypes.h b/src/libANGLE/angletypes.h index 886afb140f..a890f5c24a 100644 --- a/src/libANGLE/angletypes.h +++ b/src/libANGLE/angletypes.h @@ -706,25 +706,25 @@ class BlendStateExt final ///////// Data Members ///////// - const FactorStorage::Type mMaxFactorMask; + FactorStorage::Type mMaxFactorMask; FactorStorage::Type mSrcColor; FactorStorage::Type mDstColor; FactorStorage::Type mSrcAlpha; FactorStorage::Type mDstAlpha; - const EquationStorage::Type mMaxEquationMask; + EquationStorage::Type mMaxEquationMask; EquationStorage::Type mEquationColor; EquationStorage::Type mEquationAlpha; - const ColorMaskStorage::Type mAllColorMask; + ColorMaskStorage::Type mMaxColorMask; ColorMaskStorage::Type mColorMask; - const DrawBufferMask mMaxEnabledMask; + DrawBufferMask mMaxEnabledMask; DrawBufferMask mEnabledMask; // Cache of whether the blend equation for each index is from KHR_blend_equation_advanced. DrawBufferMask mUsesAdvancedBlendEquationMask; - const size_t mMaxDrawBuffers; + size_t mMaxDrawBuffers; }; // Used in StateCache diff --git a/src/libANGLE/angletypes_unittest.cpp b/src/libANGLE/angletypes_unittest.cpp index 27e5ea9476..de3bf083da 100644 --- a/src/libANGLE/angletypes_unittest.cpp +++ b/src/libANGLE/angletypes_unittest.cpp @@ -49,7 +49,7 @@ TEST(BlendStateExt, Init) const gl::BlendStateExt blendStateExt = gl::BlendStateExt(1); ASSERT_EQ(blendStateExt.mMaxDrawBuffers, 1u); ASSERT_EQ(blendStateExt.mMaxEnabledMask.to_ulong(), 1u); - ASSERT_EQ(blendStateExt.mAllColorMask, 0xFu); + ASSERT_EQ(blendStateExt.mMaxColorMask, is64Bit ? 0xFFu : 0xFu); ASSERT_EQ(blendStateExt.mMaxEquationMask, 0xFFu); ASSERT_EQ(blendStateExt.mMaxFactorMask, 0xFFu); checkInitState(blendStateExt); @@ -59,7 +59,7 @@ TEST(BlendStateExt, Init) const gl::BlendStateExt blendStateExt = gl::BlendStateExt(4); ASSERT_EQ(blendStateExt.mMaxDrawBuffers, 4u); ASSERT_EQ(blendStateExt.mMaxEnabledMask.to_ulong(), 0xFu); - ASSERT_EQ(blendStateExt.mAllColorMask, is64Bit ? 0x0F0F0F0Fu : 0xFFFFu); + ASSERT_EQ(blendStateExt.mMaxColorMask, is64Bit ? 0xFFFFFFFFu : 0xFFFFu); ASSERT_EQ(blendStateExt.mMaxEquationMask, 0xFFFFFFFFu); ASSERT_EQ(blendStateExt.mMaxFactorMask, 0xFFFFFFFFu); checkInitState(blendStateExt); @@ -69,7 +69,7 @@ TEST(BlendStateExt, Init) const gl::BlendStateExt blendStateExt = gl::BlendStateExt(8); ASSERT_EQ(blendStateExt.mMaxDrawBuffers, 8u); ASSERT_EQ(blendStateExt.mMaxEnabledMask.to_ulong(), 0xFFu); - ASSERT_EQ(blendStateExt.mAllColorMask, is64Bit ? 0x0F0F0F0F0F0F0F0Fu : 0xFFFFFFFFu); + ASSERT_EQ(blendStateExt.mMaxColorMask, is64Bit ? 0xFFFFFFFFFFFFFFFFu : 0xFFFFFFFFu); ASSERT_EQ(blendStateExt.mMaxEquationMask, 0xFFFFFFFFFFFFFFFFu); ASSERT_EQ(blendStateExt.mMaxFactorMask, 0xFFFFFFFFFFFFFFFFu); checkInitState(blendStateExt); @@ -120,17 +120,6 @@ TEST(BlendStateExt, ColorMask) ASSERT_EQ(diff.to_ulong(), 23u); } -// Test that all-enabled color mask correctly compares with the current color mask -TEST(BlendStateExt, MaxColorMask) -{ - gl::BlendStateExt blendStateExt = gl::BlendStateExt(4); - - blendStateExt.setColorMaskIndexed(2, true, false, true, false); - - const gl::DrawBufferMask diff = blendStateExt.compareColorMask(blendStateExt.mAllColorMask); - ASSERT_EQ(diff.to_ulong(), 4u); -} - // Test blend equations manipulations TEST(BlendStateExt, BlendEquations) { |