1
1
// Slang `core` library
2
2
3
3
// Aliases for base types
4
+ /// @category scalar_types Scalar types
4
5
typedef half float16_t;
6
+ /// @category scalar_types
5
7
typedef float float32_t;
8
+ /// @category scalar_types
6
9
typedef double float64_t;
7
10
11
+ /// @category scalar_types
8
12
typedef int int32_t ;
13
+
14
+ /// @category scalar_types
9
15
typedef uint uint32_t ;
10
16
17
+ /// @category scalar_types
11
18
typedef uintptr_t size_t;
12
- typedef uintptr_t usize_t
19
+ /// @category scalar_types
20
+ typedef uintptr_t usize_t;
21
+ /// @category scalar_types
13
22
typedef intptr_t ssize_t;
14
23
15
24
// Modifier for variables that must resolve to compile-time constants
@@ -1108,8 +1117,10 @@ struct String
1108
1117
}
1109
1118
};
1110
1119
1120
+ /// @category misc_types
1111
1121
typedef String string ;
1112
1122
1123
+ /// @category misc_types
1113
1124
__magic_type(NativeStringType)
1114
1125
__intrinsic_type($(kIROp_NativeStringType ))
1115
1126
struct NativeString
@@ -1225,7 +1236,9 @@ struct Array : IRWArray<T>
1225
1236
__intrinsic_op($(kIROp_GetArrayLength ))
1226
1237
int getCount();
1227
1238
}
1228
- /// An `N` component vector with elements of type `T`.
1239
+
1240
+ /// @category math_types Math types
1241
+ /// An `N` component vector with elements of type `T`.
1229
1242
__generic < T = float , let N : int = 4 >
1230
1243
__magic_type(VectorExpressionType)
1231
1244
struct vector : IRWArray< T>
@@ -1255,7 +1268,8 @@ static const int kRowMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_ROW_MAJOR);
1255
1268
static const int kColumnMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_COLUMN_MAJOR);
1256
1269
1257
1270
// @public:
1258
- /// A matrix with `R` rows and `C` columns, with elements of type `T`.
1271
+ /// A matrix with `R` rows and `C` columns, with elements of type `T`.
1272
+ /// @category math_types Math types
1259
1273
__generic < T = float , let R : int = 4 , let C : int = 4 , let L : int = $(SLANG_MATRIX_LAYOUT_MODE_UNKNOWN)>
1260
1274
__magic_type(MatrixExpressionType)
1261
1275
struct matrix : IRWArray< vector< T,C>>
@@ -1490,6 +1504,7 @@ __intrinsic_type($(kIROp_ConstantBufferType))
1490
1504
__magic_type(ConstantBufferType)
1491
1505
struct ConstantBuffer {}
1492
1506
1507
+ /// @category texture_types
1493
1508
__generic < T>
1494
1509
__intrinsic_type($(kIROp_TextureBufferType ))
1495
1510
__magic_type(TextureBufferType)
@@ -1500,6 +1515,7 @@ __intrinsic_type($(kIROp_ParameterBlockType))
1500
1515
__magic_type(ParameterBlockType)
1501
1516
struct ParameterBlock {}
1502
1517
1518
+ /// @category stage_io
1503
1519
__generic < T, let MAX_VERTS : uint >
1504
1520
__magic_type(VerticesType)
1505
1521
__intrinsic_type($(kIROp_VerticesType ))
@@ -1539,6 +1555,7 @@ struct OutputVertices
1539
1555
}
1540
1556
};
1541
1557
1558
+ /// @category stage_io
1542
1559
__generic < T, let MAX_PRIMITIVES : uint >
1543
1560
__magic_type(IndicesType)
1544
1561
__intrinsic_type($(kIROp_IndicesType ))
@@ -1571,6 +1588,7 @@ struct OutputIndices
1571
1588
}
1572
1589
};
1573
1590
1591
+ /// @category stage_io
1574
1592
__generic < T, let MAX_PRIMITIVES : uint >
1575
1593
__magic_type(PrimitivesType)
1576
1594
__intrinsic_type($(kIROp_PrimitivesType ))
@@ -1797,14 +1815,16 @@ T __slang_noop_cast(U u);
1797
1815
1798
1816
// @ public:
1799
1817
1800
- /// Sampling state for filtered texture fetches.
1818
+ /// Sampling state for filtered texture fetches.
1819
+ /// @category sampler_types Sampler types
1801
1820
__magic_type(SamplerStateType, $(int (SamplerStateFlavor::SamplerState )))
1802
1821
__intrinsic_type($(kIROp_SamplerStateType ))
1803
1822
struct SamplerState
1804
1823
{
1805
1824
}
1806
1825
1807
- /// Sampling state for filtered texture fetches that include a comparison operation before filtering.
1826
+ /// Sampling state for filtered texture fetches that include a comparison operation before filtering.
1827
+ /// @category sampler_types
1808
1828
__magic_type(SamplerStateType, $(int (SamplerStateFlavor::SamplerComparisonState )))
1809
1829
__intrinsic_type($(kIROp_SamplerComparisonStateType ))
1810
1830
struct SamplerComparisonState
@@ -2245,7 +2265,9 @@ ${{{{
2245
2265
// @ public:
2246
2266
2247
2267
2248
- // Bit cast
2268
+ /// Bit cast between types. `T` and `U` must have the same size.
2269
+ /// They can be any scalar, vector, matrix, struct or array types.
2270
+ /// @category conversion
2249
2271
__generic < T, U>
2250
2272
[__unsafeForceInlineEarly]
2251
2273
__intrinsic_op($(kIROp_BitCast ))
@@ -2257,15 +2279,16 @@ __generic<T, U>
2257
2279
__intrinsic_op($(kIROp_CreateExistentialObject ))
2258
2280
T createDynamicObject(uint typeId, U value);
2259
2281
2260
- // Reinterpret
2282
+ /// Reinterpret type `U` as type `T`. `T` and `U`
2283
+ /// can be any scalar, vector, matrix, struct or array types.
2284
+ /// @category conversion
2261
2285
__generic < T, U>
2262
2286
[__unsafeForceInlineEarly]
2263
2287
__intrinsic_op($(kIROp_Reinterpret ))
2264
2288
T reinterpret(U value);
2265
2289
2266
- // Use an otherwise unused value
2267
- //
2268
- // This can be used to silence the warning about returning before initializing an out paramter.
2290
+ /// Use an otherwise unused value
2291
+ /// This can be used to silence the warning about returning before initializing an out paramter.
2269
2292
__generic < T>
2270
2293
[__readNone]
2271
2294
[ForceInline]
@@ -2758,8 +2781,7 @@ __intrinsic_op($(kIROp_RequireComputeDerivative))
2758
2781
void __requireComputeDerivative();
2759
2782
2760
2783
// @ public:
2761
- // Atomic<T>
2762
-
2784
+ /// @category misc_types
2763
2785
enum MemoryOrder
2764
2786
{
2765
2787
Relaxed = $(kIRMemoryOrder_Relaxed ),
0 commit comments