summaryrefslogtreecommitdiff
path: root/source/slang/type-defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/type-defs.h')
-rw-r--r--source/slang/type-defs.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/source/slang/type-defs.h b/source/slang/type-defs.h
index 14e99caf9..70f062cdc 100644
--- a/source/slang/type-defs.h
+++ b/source/slang/type-defs.h
@@ -318,7 +318,46 @@ protected:
)
END_SYNTAX_CLASS()
+// A type that has a rate qualifier applied. Conceptually `@R T` where `R`
+// represents a rate, and `T` represents a data type.
+SYNTAX_CLASS(RateQualifiedType, Type)
+
+ // The rate `R` at which the value is computed/stored
+ SYNTAX_FIELD(RefPtr<Type>, rate);
+
+ // The underlying data type `T` of the value
+ SYNTAX_FIELD(RefPtr<Type>, valueType);
+
+RAW(
+ virtual Slang::String ToString() override;
+
+protected:
+ virtual bool EqualsImpl(Type * type) override;
+ virtual RefPtr<Type> CreateCanonicalType() override;
+ virtual RefPtr<Val> SubstituteImpl(SubstitutionSet subst, int* ioDiff) override;
+ virtual int GetHashCode() override;
+ )
+END_SYNTAX_CLASS()
+
+// A representation of the `ConstExpr` rate, to be used
+// in defining `@ConstExpr T` for particular data types `T`
+SYNTAX_CLASS(ConstExprRate, Type)
+
+RAW(
+ virtual Slang::String ToString() override;
+
+protected:
+ virtual bool EqualsImpl(Type * type) override;
+ virtual RefPtr<Type> CreateCanonicalType() override;
+ virtual RefPtr<Val> SubstituteImpl(SubstitutionSet subst, int* ioDiff) override;
+ virtual int GetHashCode() override;
+ )
+END_SYNTAX_CLASS()
+
// The effective type of a variable declared with `groupshared` storage qualifier.
+//
+// TODO: this should be converted to a `GroupSharedRate`, which then gets used
+// in conjunction with `RateQualifiedType`.
SYNTAX_CLASS(GroupSharedType, Type)
SYNTAX_FIELD(RefPtr<Type>, valueType);