From 405d438bf176411247bfd2937fcbb8c0684b0ed7 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 10 Jun 2025 17:33:38 +0800 Subject: 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 --- source/core/slang-list.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/core') 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 + 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; } -- cgit v1.2.3