src/common/bitset_utils_unittest.cpp


Log

Author Commit Date CI Message
Alexey Knyazev 74af31ad 2024-02-28T00:00:00 GL: Add ClearsWithGapsNeedFlush workaround Enabled on older Adreno drivers to avoid clear/draw race conditions in certain cases. Fixed: angleproject:8374 Change-Id: Ifc30f66ece562027ae4dd7672fcb121f91ec4696 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5335662 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 764f31be 2023-06-22T23:52:43 Add more BitSetArray tests Bug: angleproject:8224 Change-Id: I8835da245df52e1be2e3e4ea17e32ce8c438e51e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636870 Reviewed-by: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Charlie Lao 76fa3806 2023-05-04T10:19:35 Vulkan: Expand BufferOnly path for VertexArray binding change VertexArrayVk has a fast code path for attribute change where the only change is buffer (i.e, no format or relativeOffset change). It will pass in bufferOnly to syncDirtyAttrib() call and will avoid invalidate graphics pipeline. This CL expands DIRTY_BIT_BINDING_n change and will also try to detect the bufferOnly case. This CL and crrev.com/c/4507978 together seeing Gfxbench driver overhead score improves 1.48% (from average 6804 before CLs to 6905 after CLs) on pixel 7 pro. Bug: b/277644512 Change-Id: I71da1b886bb26ba2629b83af3aeaba4d45c3d3c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4504919 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Charlie Lao <cclao@google.com>
Charlie Lao 0561884e 2023-04-26T17:26:42 Vulkan: Dirty VertexArray binding bit if buffer storage change In crrev.com/c/3669603, we did optimization for black_desert_mobile that when vertex array is unbound, we remove vertex array from buffer's observer list to reduce overhead of observer notifications when buffer is been modified. To compensate for the lost notification, when vertex array is bound, we always assume every buffer that is bound to vertex array has been dirtied, for the simplicity at that time. This CL further the optimization of that CL. In this CL, I moved the dirty bit set into backend and improves vulkan backend by checking buffer's serial number and only dirty the binding if the serial has changed. Given this, now we can also remove all the non-current vertex array from buffer's observer list (previously it is heuristic based with a hard coded observer count limit). This and the previous CL improves asphalt_9 by ~1%. Bug: b/277644512 Change-Id: Ibc3f8e3df9fe70c6879e0b2bca86d8487a9dba73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4481241 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 7fb1a25d 2022-11-16T11:40:55 Make BitSetT::Mask return a bit set This allows a Mask function to be implemented for BitSetArray, which is added in this CL. When using larger bitsets on 32-bit systems, the current Mask implementation prohibits its use. This is in preparation for a follow up change that uses Mask on such a bitset. Bug: angleproject:7369 Change-Id: If995d96ec1583a546f20bff277f3223e2f2490f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031493 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 20820bb4 2022-05-13T10:50:47 Make BitSetArray constexpr Bug: angleproject:5906 Change-Id: If1ccacfc81e3e01b4bdbd10d47cf4ec860e3fe0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645494 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 171bc07e 2021-12-20T13:10:33 Don't silently drop out-of-range bits in BitSetT Notes: - std::bitset's constructor accepts out-of-range bits (and drops them) - std::bitset with initializer list doesn't exist and is a BitSetT feature - |=, &= and ^= with non-bitset is a BitSetT feature - std::bitset's set(pos), reset(pos) and flip(pos) throw an exception if pos is out of the range of the bitset. This change adds an ASSERT in the functions that std::bitset would throw an exception, as well as functions that are only in BitSetT. Bug: angleproject:6840 Change-Id: Iab5bac40b05d4f7f29e0242ea0baa093721e3339 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3349980 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 00d0b79f 2021-11-26T14:38:20 Bug fix in BitSetArray iterator Account for gaps spanning multiple BaseBitSet while iterating. Bug: angleproject:3877 Tests: BitSetArrayTest*IterationWithGaps* Change-Id: I64a0393bf117678b0a7855904a6ac328a13bb40c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3304108 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 971ba359 2021-06-23T16:45:33 Add angle::BitMask for creating bit masks angle::BitMask(n) implements the common pattern of angle::Bit(n)-1. Bug: angleproject:6048 Change-Id: Icd56ef1504804add59d0804a7249b3035c96f9c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2984099 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill cfc21345 2021-04-21T09:42:51 Add first() and last() to BitSetArray. These helper functions return the bounds of the 1 bits in the array. Also required implementing ScanReverse the same way we implemented ScanForward. Bug: angleproject:5736 Change-Id: Ied945c57cd85ca7bc91dcc7a1168a74b3a59fce4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2842347 Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0c77f3ad 2021-03-10T15:58:00 Vulkan: Implement shader buffers descriptor cache. Implements a descriptor set cache for UBOs, SSBOs, and atomic counter buffers. Storage Images and framebuffer fetch input attachments are not yet included. Requires moving the buffer barrier handling into ContextVk, similarly to how we handle the barriers for Textures. The packed description key for the descriptors uses a "fast" vector with a basic minimum size. For most cases of a few buffers this will fit easily in stack memory, but for larger programs with many buffers we fit this into heap memory. The key has a large upper bound due to the high ES 3.2 requirements and the need to index several values such as the offset and binding size. We use dynamic offsets for uniform buffers when possible. This ensures applications like Manhattan 3.1 that use sets of common buffers with changing offsets hit the cache most of the time. Because of resource limits we pick at compilation time whether to use dynamic or static descriptor sets. Mostly this applies to tests that use a large number of uniform buffers. A future implementation could be smart and would recompile the program with heuristics to use a minimal number of dynamic indices. Reduces the number of descriptor set updates from ~300 -> ~30 per frame in Manhattan 3.1 and in Asphalt 9 from 900+ to as low as 0 per frame. Bug: angleproject:5736 Change-Id: I5c2a3881bec90d301dab15cc86c8a70e60674ad7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2757515 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e8c0aa81 2021-01-26T23:40:36 Vulkan: Clean up transform feedback extension pause/resume 1. The xfb counter buffer barrier issued was wrong, following a typo in the spec. This barrier is now correctly issued using the usual barrier APIs. 2. A mechanism was added to automatically pause/resume transform feedback when a program pipeline needs to be rebound. This is incorrect as it misses the xfb counter buffer barrier. The render pass is broken instead if transform feedback is active/unpaused and the program pipeline is changed. 3. The transform feedback counter buffers are now disposed of when transform feedback is ended. This avoids an unnecessary barrier that this change would have otherwise incurred (and hence render pass break) in Manhattan which repurposes the same transform feedback object. Bug: angleproject:5528 Change-Id: I1ffe8b4b8975645ba43afd70e9cdbb0765529da5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2651647 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 12990d73 2021-02-11T11:37:03 GetBitSet now uses BitSetArray instead of IterableBitSet Remove the now unused IterableBitSet class. Bug: angleproject:3877 Change-Id: I161e5d062c8183e30a7eb9040f3018116fe6e69e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2683494 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya dfd2a881 2021-02-11T11:26:18 Add more functionality to BitSetArray class Add support for more unary and binary operators. In order to support setLaterBit and resetLaterBit in BitSetArray::Iterator there were 2 choices - 1. Make a copy of BitSetArray only if it is a mutating usecase 2. Always perform a copy in the constructor BitSetIteratorPerfTest was run with both patches - 1) Copy only when necessary - RESULT BitSetIteratorPerf.wall_time: run = 116.1067374961 ns 2) Copy always - RESULT BitSetIteratorPerf.wall_time: run = 242.7446459439 ns We settled on the copy only when necessary path. Bug: angleproject:3877 Change-Id: If1d3cc428c68c84857952b46237aa5f206f080cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2690912 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 224e3c14 2021-02-08T13:00:16 Support optimized bitsets that need more than 64bits For usecases that needed more than 64bits we were using std::bitset container. This has slower perf compared to the BitSetT container. Add a new class that can support large bitsets by wrapping an array of BitSet32/BitSet64 objects, depending on CPU bitness, as the container. Bug: angleproject:3877 Tests: angle_unittests.exe --gtest_filter=BitSetArrayTest* angle_white_box_perftests.exe --gtest_filter=BitSetIteratorPerfTest* Change-Id: I3f4a635f9e6974a99db7a4b592ab206aad754760 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2664733 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev d30f0114 2020-11-05T17:46:53 Metal: Early loop exit during attachments clear Added BitSetIteratorTest.IterationOrder Bug: angleproject:2634 Change-Id: I0e9c6ad4d19bbb7d691e46b7ec720e918b170371 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2520956 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 26ae42cf 2020-08-09T00:11:18 Vulkan: Clean up handleDirtyTexturesImpl. Adds a new bitset helper and changes a check to an ASSERT. Refactoring change only. Bug: angleproject:4959 Change-Id: I0de9f1b707c87cfb6fed8a110654783059e55c99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2345025 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Alexey Knyazev d6c7bac9 2020-04-18T01:41:14 Add BlendStateExt helper structure It provides compact storage and comparison operations for per-drawbuffer blend states. Added BitSetT::Zero() static constexpr. Bug: angleproject:4394 Change-Id: I66d6275facb7b28022fc24ff9cc0d8c3c976c99d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2154669 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Alexey Knyazev e6519445 2020-03-12T19:02:03 Implement ScanForward64 on 32-bit platforms This unlocks opt-in usage of BitSet64 on 32-bit platforms. It is slightly faster than IterableBitSet when the amount of bits is greater than 32. Bug: angleproject:4473 Change-Id: I230784acc871e13b1f94c87503f6bb869dcd3a68 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2100969 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 90b1865e 2019-03-29T00:00:27 More unittests for BitSet Bug: angleproject:2361 Change-Id: Icca49086d95ddb0d2d50e5ba71ae9b748eeabf3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1545203 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 0cc11c68 2018-10-12T18:07:18 StateManagerGL: Remove setGenericShaderState. We can mutate the BitSetIterator as it clears dirty bits. This removes the risk of doing a double state update. Improves the proformance of the GL back-end state update. Also do an early-out before calling syncDrawArraysState. Bug: angleproject:2763 Change-Id: Idd25bdd67a6aceff05529a533260b661b07c2928 Reviewed-on: https://chromium-review.googlesource.com/c/1262740 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c6dbc253 2018-04-30T19:07:56 Scope ANGLE_UNUSED_VARIABLE. Renames the macro to be more ANGLE-ey. Refactoring only. Bug: angleproject:1671 Change-Id: I8f2dd227c7e2025886ec66e85efa877ea261d0ad Reviewed-on: https://chromium-review.googlesource.com/1036209 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shao 37219c87 2017-04-26T10:59:48 Fix missing return values in bitset_utils.h This patch adds the missing return value *this in the operator= of class BitSetT BUG=angleproject:1814 Change-Id: I758d62e80e4ade92aac64315f1808ca1eabdc787 Reviewed-on: https://chromium-review.googlesource.com/487423 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6de51858 2017-04-12T09:53:01 Optimize angle::BitSetIterator. Adds a new custom bitset template to handle packing as many bits as possible into a single variable. Intelligently select the right class depending on platform features and bit sizes. For now, always use a packed 64-bit set on 64-bit, instead of using a 32-bit set for smaller bitsets. BUG=angleproject:1814 Change-Id: I3ffef815c15515555833f6fc9302d8a4eee5423b Reviewed-on: https://chromium-review.googlesource.com/471827 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 20e005b2 2017-04-07T14:19:22 Rename BitSetIterator.h to bitset_utils.h BUG=angleproject:1814 Change-Id: I152ae13b6b7cf0ba72259967f0f124e199b20e07 Reviewed-on: https://chromium-review.googlesource.com/471826 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>