summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-10-04 11:20:35 -0700
committerGitHub <noreply@github.com>2023-10-04 11:20:35 -0700
commitac886fd3e329a9599ed1ac7a6d8b26ca5821046c (patch)
tree87bcafb3985775f9d90303d6a4239eb743164407 /source/core
parentd87493a46c00be37b820a473c0827bbb865eb222 (diff)
SPIRV compiler performance fixes. (#3258)
* SPIRV compiler performance fixes. * Cleanup. * update project files * Cleanup debug code. * Make redundancy removal non-recursive. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-uint-set.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/core/slang-uint-set.h b/source/core/slang-uint-set.h
index f2c573865..4912ae504 100644
--- a/source/core/slang-uint-set.h
+++ b/source/core/slang-uint-set.h
@@ -52,6 +52,8 @@ public:
/// Returns true if the value is present
inline bool contains(UInt val) const;
+ inline bool contains(const UIntSet& set) const;
+
/// ==
bool operator==(const UIntSet& set) const;
/// !=
@@ -111,6 +113,25 @@ inline bool UIntSet::contains(UInt val) const
}
// --------------------------------------------------------------------------
+inline bool UIntSet::contains(const UIntSet& set) const
+{
+ for (Index i = 0; i < set.m_buffer.getCount(); i++)
+ {
+ if (i >= m_buffer.getCount())
+ {
+ if (set.m_buffer[i])
+ return false;
+ }
+ else
+ {
+ if ((m_buffer[i] & set.m_buffer[i]) != set.m_buffer[i])
+ return false;
+ }
+ }
+ return true;
+}
+
+// --------------------------------------------------------------------------
inline void UIntSet::add(UInt val)
{
const Index idx = Index(val >> kElementShift);