diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-06-07 09:48:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-07 09:48:24 -0400 |
| commit | 7c6faf62158eed309f01bbef8a7b88e0c36459c7 (patch) | |
| tree | ae0e87295bad2b45dd80dfac125b37d59bcda588 /source/slang/slang-capability.h | |
| parent | 004fe27a52b7952111ad7e749397aeff499de7ed (diff) | |
Precompute UIntSet from individual capabilities inside generator (#4269)
* fixes: #4163
Precompute UIntSet from individual capabilities inside generator (removes intermediate form of capabilities).
note:
1. I still expand capabilities which are missing `target` and `stage` atoms.
* fix compile warning<->error with clang
* address review
preallocate the pregenerated UIntSet's
* disable incorrect warning of 'unreachable code'
The warning is wrong since, when `out` has 0 elements (does not start `for` loop), the `return` is reached.
* fix clang warnings
1. use unsigned long for the buffer serializer
2. braces around scalar init
* address review
added work around to avoid warning with `for(...) return; return;` pattern
`else if constexpr` addition instead of cascading blocks
* push fix for use of `_BitScanForward`
* cleanup
* move around assert for proper checking
* syntax error
* use SLANG_ASSERT instead of assert
* test for why SLANG_ASSERT caused CI to fail with linux-arm builds
* test if `SLANG_ASSERT` really is causing a build issue for linux-arm
Diffstat (limited to 'source/slang/slang-capability.h')
| -rw-r--r-- | source/slang/slang-capability.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/slang/slang-capability.h b/source/slang/slang-capability.h index 5ee79670b..6e123a9a6 100644 --- a/source/slang/slang-capability.h +++ b/source/slang/slang-capability.h @@ -173,11 +173,12 @@ public: /// Find any capability sets which are in 'available' but not in 'required'. Return false if this situation occurs. static bool checkCapabilityRequirement(CapabilitySet const& available, CapabilitySet const& required, CapabilityAtomSet& outFailedAvailableSet); - inline void addToTargetCapabilityWithValidUIntSetAndTargetAndStage(CapabilityName target, CapabilityName stage, CapabilityAtomSet setToAdd); - inline void addToTargetCapabilityWithTargetAndStageAtom(CapabilityName target, CapabilityName stage, const ArrayView<CapabilityName>& canonicalRepresentation); - inline void addToTargetCapabilityWithTargetAndOrStageAtom(CapabilityName target, CapabilityName stage, const ArrayView<CapabilityName>& canonicalRepresentation); - inline void addToTargetCapabilityWithStageAtom(CapabilityName stage, const ArrayView<CapabilityName>& canonicalRepresentation); - inline void addToTargetCapabilitesWithCanonicalRepresentation(const ArrayView<CapabilityName>& atom); + // For each element in `elementsToPermutateWith`, create and add a different conjunction permutation by adding to `setToPermutate`. + template<CapabilityName keyholeAtomToPermuteWith> + void addPermutationsOfConjunctionForEachInContainer(CapabilityAtomSet& setToPermutate, const CapabilityAtomSet& elementsToPermutateWith, CapabilityAtom knownTargetAtom, CapabilityAtom knownStageAtom); + // This is used for adding conjunctions directly and efficently, this is not functionally a join. + // if `knownStage`/`knownTarget` is not CapabilityAtom::Invalid, the given atom will be assumed as an assigned key atom (faster) + inline void addConjunction(CapabilityAtomSet conjunction, CapabilityAtom knownTarget, CapabilityAtom knownStage); inline void addUnexpandedCapabilites(CapabilityName atom); CapabilityTargetSets& getCapabilityTargetSets() { return m_targetSets; } |
