summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDarrelFW321 <60972474+DarrelFW321@users.noreply.github.com>2025-03-21 20:11:29 -0400
committerGitHub <noreply@github.com>2025-03-22 00:11:29 +0000
commit7f72256bcf3e9a33feec641ce8bc98bc750b6297 (patch)
tree118519b804cf1b9b0131f0feffc6dbff5d429a76 /source
parent969d101aff074675de32bdbe6b97baf744634f78 (diff)
Add GLSL array length syntax support (#6665)
Diffstat (limited to 'source')
-rw-r--r--source/slang/glsl.meta.slang11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/glsl.meta.slang b/source/slang/glsl.meta.slang
index 4412ae460..9e6c6c3cc 100644
--- a/source/slang/glsl.meta.slang
+++ b/source/slang/glsl.meta.slang
@@ -321,6 +321,17 @@ ${{{{
}
}}}}
+/// Array length
+__generic<T, let N : int>
+public extension Array<T, N>
+{
+ [ForceInline]
+ public int length()
+ {
+ return this.getCount();
+ }
+}
+
//
// Section 8.1. Angle and Trigonometry Functions
//