Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 97fecda

Browse files
committedOct 8, 2024·
Categorize functions and types.
1 parent b602da5 commit 97fecda

6 files changed

+587
-260
lines changed
 

‎docs/build_reference.ps1

+14-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@ git describe --tags | Out-File -FilePath ".\stdlib-reference\_includes\version.i
1616
cd stdlib-reference
1717
& ../../build/Release/bin/slangc -compile-stdlib -doc
1818
Move-Item -Path ".\toc.html" -Destination ".\_includes\stdlib-reference-toc.html" -Force
19-
git config user.email "bot@shader-slang.com"
20-
git config user.name "Stdlib Reference Bot"
21-
git add .
22-
git commit -m "Update stdlib reference"
23-
git push
19+
#git config user.email "bot@shader-slang.com"
20+
#git config user.name "Stdlib Reference Bot"
21+
#git add .
22+
#git commit -m "Update stdlib reference"
23+
#git push
2424
cd ../
2525

26+
Remove-Item -Path "D:\git_repo\stdlib-reference\global-decls" -Recurse -Force
27+
Remove-Item -Path "D:\git_repo\stdlib-reference\interfaces" -Recurse -Force
28+
Remove-Item -Path "D:\git_repo\stdlib-reference\types" -Recurse -Force
29+
Copy-Item -Path .\stdlib-reference\global-decls -Destination D:\git_repo\stdlib-reference\global-decls -Recurse -Force
30+
Copy-Item -Path .\stdlib-reference\interfaces -Destination D:\git_repo\stdlib-reference\interfaces -Recurse -Force
31+
Copy-Item -Path .\stdlib-reference\types -Destination D:\git_repo\stdlib-reference\types -Recurse -Force
32+
Copy-Item -Path .\stdlib-reference\_includes\stdlib-reference-toc.html -Destination D:\git_repo\stdlib-reference\_includes\stdlib-reference-toc.html -Force
33+
34+

‎source/slang/core.meta.slang

+34-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
// Slang `core` library
22

33
// Aliases for base types
4+
/// @category scalar_types Scalar types
45
typedef half float16_t;
6+
/// @category scalar_types
57
typedef float float32_t;
8+
/// @category scalar_types
69
typedef double float64_t;
710

11+
/// @category scalar_types
812
typedef int int32_t;
13+
14+
/// @category scalar_types
915
typedef uint uint32_t;
1016

17+
/// @category scalar_types
1118
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
1322
typedef intptr_t ssize_t;
1423

1524
// Modifier for variables that must resolve to compile-time constants
@@ -1108,8 +1117,10 @@ struct String
11081117
}
11091118
};
11101119

1120+
/// @category misc_types
11111121
typedef String string;
11121122

1123+
/// @category misc_types
11131124
__magic_type(NativeStringType)
11141125
__intrinsic_type($(kIROp_NativeStringType))
11151126
struct NativeString
@@ -1225,7 +1236,9 @@ struct Array : IRWArray<T>
12251236
__intrinsic_op($(kIROp_GetArrayLength))
12261237
int getCount();
12271238
}
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`.
12291242
__generic<T = float, let N : int = 4>
12301243
__magic_type(VectorExpressionType)
12311244
struct vector : IRWArray<T>
@@ -1255,7 +1268,8 @@ static const int kRowMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_ROW_MAJOR);
12551268
static const int kColumnMajorMatrixLayout = $(SLANG_MATRIX_LAYOUT_COLUMN_MAJOR);
12561269

12571270
//@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
12591273
__generic<T = float, let R : int = 4, let C : int = 4, let L : int = $(SLANG_MATRIX_LAYOUT_MODE_UNKNOWN)>
12601274
__magic_type(MatrixExpressionType)
12611275
struct matrix : IRWArray<vector<T,C>>
@@ -1490,6 +1504,7 @@ __intrinsic_type($(kIROp_ConstantBufferType))
14901504
__magic_type(ConstantBufferType)
14911505
struct ConstantBuffer {}
14921506

1507+
///@category texture_types
14931508
__generic<T>
14941509
__intrinsic_type($(kIROp_TextureBufferType))
14951510
__magic_type(TextureBufferType)
@@ -1500,6 +1515,7 @@ __intrinsic_type($(kIROp_ParameterBlockType))
15001515
__magic_type(ParameterBlockType)
15011516
struct ParameterBlock {}
15021517

1518+
/// @category stage_io
15031519
__generic<T, let MAX_VERTS : uint>
15041520
__magic_type(VerticesType)
15051521
__intrinsic_type($(kIROp_VerticesType))
@@ -1539,6 +1555,7 @@ struct OutputVertices
15391555
}
15401556
};
15411557

1558+
/// @category stage_io
15421559
__generic<T, let MAX_PRIMITIVES : uint>
15431560
__magic_type(IndicesType)
15441561
__intrinsic_type($(kIROp_IndicesType))
@@ -1571,6 +1588,7 @@ struct OutputIndices
15711588
}
15721589
};
15731590

1591+
/// @category stage_io
15741592
__generic<T, let MAX_PRIMITIVES : uint>
15751593
__magic_type(PrimitivesType)
15761594
__intrinsic_type($(kIROp_PrimitivesType))
@@ -1797,14 +1815,16 @@ T __slang_noop_cast(U u);
17971815

17981816
//@ public:
17991817

1800-
/// Sampling state for filtered texture fetches.
1818+
/// Sampling state for filtered texture fetches.
1819+
/// @category sampler_types Sampler types
18011820
__magic_type(SamplerStateType, $(int(SamplerStateFlavor::SamplerState)))
18021821
__intrinsic_type($(kIROp_SamplerStateType))
18031822
struct SamplerState
18041823
{
18051824
}
18061825

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
18081828
__magic_type(SamplerStateType, $(int(SamplerStateFlavor::SamplerComparisonState)))
18091829
__intrinsic_type($(kIROp_SamplerComparisonStateType))
18101830
struct SamplerComparisonState
@@ -2245,7 +2265,9 @@ ${{{{
22452265
//@ public:
22462266

22472267

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
22492271
__generic<T, U>
22502272
[__unsafeForceInlineEarly]
22512273
__intrinsic_op($(kIROp_BitCast))
@@ -2257,15 +2279,16 @@ __generic<T, U>
22572279
__intrinsic_op($(kIROp_CreateExistentialObject))
22582280
T createDynamicObject(uint typeId, U value);
22592281

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
22612285
__generic<T, U>
22622286
[__unsafeForceInlineEarly]
22632287
__intrinsic_op($(kIROp_Reinterpret))
22642288
T reinterpret(U value);
22652289

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.
22692292
__generic<T>
22702293
[__readNone]
22712294
[ForceInline]
@@ -2758,8 +2781,7 @@ __intrinsic_op($(kIROp_RequireComputeDerivative))
27582781
void __requireComputeDerivative();
27592782

27602783
//@ public:
2761-
// Atomic<T>
2762-
2784+
/// @category misc_types
27632785
enum MemoryOrder
27642786
{
27652787
Relaxed = $(kIRMemoryOrder_Relaxed),

0 commit comments

Comments
 (0)
Please sign in to comment.