@@ -446,6 +446,7 @@ interface IRWArray<T> : IArray<T>
446
446
// argument. The left-to-right evaluation order guaranteed by Slang then ensures that
447
447
// `left` is evaluated before `right`.
448
448
//
449
+ // @hidden:
449
450
__generic < T,U>
450
451
[__unsafeForceInlineEarly]
451
452
U operator,(T left, U right)
@@ -457,20 +458,29 @@ U operator,(T left, U right)
457
458
// follow that definition for the scalar condition overload, so this declaration just serves
458
459
// for type-checking purpose only.
459
460
460
- __generic < T> __intrinsic_op(select) T operator?: (bool condition, T ifTrue, T ifFalse);
461
+ // @hidden:
462
+ __generic < T> __intrinsic_op(select) T operator?: (bool condition, T ifTrue, T ifFalse);
463
+
464
+ // @hidden:
461
465
__generic < T, let N : int > __intrinsic_op(select) vector< T,N> operator?: (vector< bool ,N> condition, vector< T,N> ifTrue, vector< T,N> ifFalse);
462
466
463
467
// Users are advised to use `select` instead if non-short-circuiting behavior is intended.
468
+ // @public:
464
469
__generic < T> __intrinsic_op(select) T select(bool condition, T ifTrue, T ifFalse);
465
470
__generic < T, let N : int > __intrinsic_op(select) vector< T,N> select(vector< bool ,N> condition, vector< T,N> ifTrue, vector< T,N> ifFalse);
466
471
467
472
// Allow real-number types to be cast into each other
473
+ // @hidden:
468
474
__intrinsic_op($(kIROp_FloatCast ))
469
475
T __realCast< T : __BuiltinRealType, U : __BuiltinRealType> (U val);
476
+ // @hidden:
470
477
__intrinsic_op($(kIROp_CastIntToFloat ))
471
- T __realCast< T : __BuiltinRealType, U : __BuiltinIntegerType> (U val);
478
+ T __realCast< T : __BuiltinRealType, U : __BuiltinIntegerType> (U val);
479
+ // @hidden:
472
480
__intrinsic_op($(kIROp_IntCast ))
473
- T __intCast< T : __BuiltinType, U : __BuiltinType> (U val);
481
+ T __intCast< T : __BuiltinType, U : __BuiltinType> (U val);
482
+
483
+ // @hidden:
474
484
${{{{
475
485
// We are going to use code generation to produce the
476
486
// declarations for all of our base types.
@@ -716,17 +726,20 @@ ${{{{
716
726
// (eventually we can have the traditional syntax sugar for this)
717
727
}}}}
718
728
729
+ // @hidden:
719
730
__magic_type(NullPtrType)
720
731
struct NullPtr
721
732
{
722
733
};
723
734
735
+ // @hidden:
724
736
__magic_type(NoneType)
725
737
__intrinsic_type($(kIROp_VoidType ))
726
738
struct __none_t
727
739
{
728
740
};
729
741
742
+ // @public:
730
743
__generic < T, let addrSpace : uint64_t = $( (uint64_t )AddressSpace::UserPointer)ULL>
731
744
__magic_type(PtrType)
732
745
__intrinsic_type($(kIROp_PtrType ))
@@ -752,6 +765,7 @@ struct Ptr
752
765
}
753
766
};
754
767
768
+ // @hidden:
755
769
__intrinsic_op($(kIROp_Load ))
756
770
T __load< T, let addrSpace : uint64_t > (Ptr < T, addrSpace> ptr);
757
771
@@ -788,6 +802,7 @@ __generic<T, let addrSpace : uint64_t>
788
802
__intrinsic_op($(kIROp_Eql ))
789
803
bool operator == (Ptr < T, addrSpace> p1, Ptr < T, addrSpace> p2);
790
804
805
+ // @public:
791
806
extension bool : IRangedValue
792
807
{
793
808
__generic < T, let addrSpace : uint64_t >
@@ -847,6 +862,7 @@ extension uintptr_t : IRangedValue
847
862
static const int size = $(SLANG_PROCESSOR_X86_64? " 8" : " 4" );
848
863
}
849
864
865
+ // @hidden:
850
866
__generic < T>
851
867
__magic_type(OutType)
852
868
__intrinsic_type($(kIROp_OutType ))
@@ -873,6 +889,7 @@ struct ConstRef
873
889
874
890
typealias __Addr< T> = Ptr < T, $( (uint64_t )AddressSpace::Generic)ULL> ;
875
891
892
+ // @public:
876
893
__generic < T>
877
894
__magic_type(OptionalType)
878
895
__intrinsic_type($(kIROp_OptionalType ))
@@ -895,6 +912,7 @@ struct Optional
895
912
__init(T val);
896
913
};
897
914
915
+ // @hidden:
898
916
__generic < T>
899
917
[__unsafeForceInlineEarly]
900
918
bool operator== (Optional< T> val, __none_t noneVal)
@@ -920,6 +938,7 @@ bool operator!=(__none_t noneVal, Optional<T> val)
920
938
return val .hasValue ;
921
939
}
922
940
941
+ // @public:
923
942
__generic < each T>
924
943
__magic_type(TupleType)
925
944
struct Tuple
@@ -936,7 +955,7 @@ Tuple<T, U> concat<each T, each U>(Tuple<T> t, Tuple<U> u)
936
955
return makeTuple(expand each t, expand each u);
937
956
}
938
957
939
-
958
+ // @hidden:
940
959
[__unsafeForceInlineEarly]
941
960
bool __assign(inout bool v, bool newVal)
942
961
{
@@ -978,6 +997,7 @@ void __tupleGreaterKernel<T : IComparable>(inout bool result, inout bool exit, T
978
997
}
979
998
}
980
999
1000
+ // @public:
981
1001
__generic < each T : IComparable>
982
1002
extension Tuple< T> : IComparable
983
1003
{
@@ -1027,6 +1047,7 @@ interface IDifferentiableFunc<TR : IDifferentiable, each TP : IDifferentiable> :
1027
1047
TR operator()(expand each TP p);
1028
1048
}
1029
1049
1050
+ // @hidden:
1030
1051
__generic < T>
1031
1052
__magic_type(NativeRefType)
1032
1053
__intrinsic_type($(kIROp_NativePtrType ))
@@ -1049,6 +1070,7 @@ T __attachToNativeRef(NativeRef<T> nativeVal)
1049
1070
return result;
1050
1071
}
1051
1072
1073
+ // @public:
1052
1074
__magic_type(StringType)
1053
1075
__intrinsic_type($(kIROp_StringType ))
1054
1076
struct String
@@ -1133,11 +1155,14 @@ extension Ptr<void>
1133
1155
__init(NativeRef< T> ptr);
1134
1156
}
1135
1157
1158
+ // @hidden:
1136
1159
__magic_type(DynamicType)
1137
1160
__intrinsic_type($(kIROp_DynamicType ))
1138
1161
struct __Dynamic
1139
1162
{};
1140
1163
1164
+ // @public:
1165
+
1141
1166
extension half : IRangedValue
1142
1167
{
1143
1168
static const half maxValue = half (65504 );
@@ -1225,9 +1250,11 @@ struct vector : IRWArray<T>
1225
1250
int getCount() { return N; }
1226
1251
}
1227
1252
1228
- const int kRowMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_ROW_MAJOR);
1229
- const int kColumnMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_COLUMN_MAJOR);
1253
+ // @hidden:
1254
+ static const int kRowMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_ROW_MAJOR);
1255
+ static const int kColumnMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_COLUMN_MAJOR);
1230
1256
1257
+ // @public:
1231
1258
/// A matrix with `R` rows and `C` columns, with elements of type `T`.
1232
1259
__generic < T = float , let R : int = 4 , let C : int = 4 , let L : int = $(SLANG_MATRIX_LAYOUT_MODE_UNKNOWN)>
1233
1260
__magic_type(MatrixExpressionType)
@@ -1248,9 +1275,11 @@ struct matrix : IRWArray<vector<T,C>>
1248
1275
int getCount() { return R; }
1249
1276
}
1250
1277
1278
+ // @hidden:
1251
1279
__intrinsic_op($(kIROp_Eql ))
1252
- vector< bool , N> __vectorEql< T, let N: int > (vector< T, N> left, vector< T,N> right);
1280
+ vector< bool , N> __vectorEql< T, let N : int > (vector< T, N> left, vector< T, N> right);
1253
1281
1282
+ // @public:
1254
1283
__generic < T:__BuiltinFloatingPointType, let N : int >
1255
1284
extension vector< T,N> : IFloat
1256
1285
{
@@ -1360,10 +1389,12 @@ extension matrix<int16_t,R,C,L>
1360
1389
__init(int value) { this = matrix< T,R,C,L> (T(value)); }
1361
1390
}
1362
1391
1392
+ // @hidden:
1363
1393
__intrinsic_op(makeVector)
1364
1394
__generic < T, let N:int >
1365
1395
vector< T,N* 2 > __makeVector(vector< T,N> vec1, vector< T,N> vec2);
1366
1396
1397
+ // @public:
1367
1398
__generic < T>
1368
1399
extension vector< T, 4 >
1369
1400
{
@@ -1385,6 +1416,7 @@ extension matrix<T, 2, 2, L>
1385
1416
}
1386
1417
}
1387
1418
1419
+ // @hidden:
1388
1420
${{{{
1389
1421
static const struct {
1390
1422
char const * name;
@@ -1573,7 +1605,7 @@ struct OutputPrimitives
1573
1605
}
1574
1606
};
1575
1607
1576
- // @ hidden :
1608
+ // @ public :
1577
1609
1578
1610
// Need to add constructors to the types above
1579
1611
@@ -1757,6 +1789,7 @@ ${{{{
1757
1789
}
1758
1790
}}}}
1759
1791
1792
+ // @ hidden:
1760
1793
__generic < T, U>
1761
1794
__intrinsic_op(0 )
1762
1795
T __slang_noop_cast(U u);
@@ -2267,6 +2300,8 @@ int __SyntaxError()
2267
2300
}
2268
2301
}
2269
2302
2303
+ // @ hidden:
2304
+
2270
2305
/// For downstream compilers that allow sizeof/alignof/offsetof
2271
2306
/// Can't be called in the C/C++ style. Need to use __size_of<some_type>() as opposed to sizeof(some_type).
2272
2307
__generic < T>
@@ -2350,7 +2385,7 @@ __generic<E : __EnumType>
2350
2385
__intrinsic_op($(kIROp_Neq ))
2351
2386
bool operator!= (E left, E right);
2352
2387
2353
- // @ public :
2388
+ // @ hidden :
2354
2389
2355
2390
// public interfaces for generic arithmetic types.
2356
2391
@@ -2722,6 +2757,7 @@ __Addr<T> __getLegalizedSPIRVGlobalParamAddr(T val);
2722
2757
__intrinsic_op($(kIROp_RequireComputeDerivative ))
2723
2758
void __requireComputeDerivative();
2724
2759
2760
+ // @ public:
2725
2761
// Atomic<T>
2726
2762
2727
2763
enum MemoryOrder
@@ -2767,6 +2803,7 @@ struct Atomic<T : IAtomicable>
2767
2803
MemoryOrder failOrder = MemoryOrder .Relaxed );
2768
2804
}
2769
2805
2806
+ /// These addtional members are only available when `T` conforms to `IArithmeticAtomicable`.
2770
2807
extension < T : IArithmeticAtomicable> Atomic< T>
2771
2808
{
2772
2809
__intrinsic_op($(kIROp_AtomicAdd ))
@@ -2779,6 +2816,7 @@ extension<T : IArithmeticAtomicable> Atomic<T>
2779
2816
[__ref] T min(T value, MemoryOrder order = MemoryOrder .Relaxed ); // returns original value
2780
2817
}
2781
2818
2819
+ /// These addtional members are only available when `T` conforms to `IBitAtomicable`.
2782
2820
extension < T : IBitAtomicable> Atomic< T>
2783
2821
{
2784
2822
__intrinsic_op($(kIROp_AtomicAnd ))
@@ -2793,6 +2831,8 @@ extension<T : IBitAtomicable> Atomic<T>
2793
2831
[__ref] T decrement(MemoryOrder order = MemoryOrder .Relaxed );
2794
2832
}
2795
2833
2834
+ // @ hidden:
2835
+
2796
2836
__generic < T : IArithmeticAtomicable>
2797
2837
[ForceInline]
2798
2838
T operator += (__ref Atomic< T> v, T value)
0 commit comments