diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2025-06-10 17:33:38 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-10 17:33:38 +0800 |
| commit | 405d438bf176411247bfd2937fcbb8c0684b0ed7 (patch) | |
| tree | a4769d4d8e5e39b58b5ce388be5245b4f45c1781 /source/core/slang-list.h | |
| parent | d70da65a90ccd73439895a43b3958c0ea1441f35 (diff) | |
Legalise out parameters for vertex shaders on metal (#6943)
* Handle pointer types when getting type cast style
Closes https://github.com/shader-slang/slang/issues/6025
* Move vertex shader out parameters to return type for Metal
Closes https://github.com/shader-slang/slang/issues/6025
* More asserts
* Make struct instead of tuple
* More layout preservation
* Handle same function result
* more layout
* remove layout
* a
* more debug code
* more debug code
* a
* layout working
* refactored
* more tests
* more tests
* fuse loops
* remove unused comments
* Correct filecheck usage
* debug code
* correct name and order of filecheck vars
* simplify
* Address review comments
fix warning
* simplify handling of simple vertex shaders
Diffstat (limited to 'source/core/slang-list.h')
| -rw-r--r-- | source/core/slang-list.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/core/slang-list.h b/source/core/slang-list.h index 7c96e3844..597f1b9b6 100644 --- a/source/core/slang-list.h +++ b/source/core/slang-list.h @@ -192,6 +192,18 @@ public: Index getCount() const { return m_count; } Index getCapacity() const { return m_capacity; } + template<typename Predicate> + Index countIf(Predicate predicate) const + { + Index count = 0; + for (Index i = 0; i < getCount(); ++i) + { + if (predicate((*this)[i])) + count++; + } + return count; + } + const T* getBuffer() const { return m_buffer; } T* getBuffer() { return m_buffer; } |
