You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/user-guide/02-conventional-features.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -995,7 +995,7 @@ float3 a[3] = {1,2,3, 4,5,6};
995
995
996
996
### Initializer Lists - Struct
997
997
998
-
In most scenarios, using an initializer list to create a struct typed value is equivalent to calling the struct's constructor using the elements in the initilaizer list as arguments for the constructor, for example:
998
+
In most scenarios, using an initializer list to create a struct typed value is equivalent to calling the struct's constructor using the elements in the initializer list as arguments for the constructor, for example:
999
999
```csharp
1000
1000
structGenerateCtorInner1
1001
1001
{
@@ -1061,7 +1061,7 @@ In addition, Slang also provides compatibility support for C-style initializer l
1061
1061
1062
1062
A struct is considered a C-style struct if:
1063
1063
1. User never defines a custom constructor with **more than** 0 parameters
1064
-
2. All member variables in a `struct` have the same visibiliity (`public` or `internal` or `private`).
1064
+
2. All member variables in a `struct` have the same visibility (`public` or `internal` or `private`).
In summary, an `asssociatedtype` requirement in an interface is similar to other types of requirements: a method requirement means that an implementation must provide a method matching the interface signature, while an `associatedtype` requirement means that an implementation must provide a type in its scope with the matching name and interface constraint. In general, when defining an interface that is producing and consuming an object whose actual type is implementation-dependent, the type of this object can often be modeled as an associated type in the interface.
432
+
In summary, an `associatedtype` requirement in an interface is similar to other types of requirements: a method requirement means that an implementation must provide a method matching the interface signature, while an `associatedtype` requirement means that an implementation must provide a type in its scope with the matching name and interface constraint. In general, when defining an interface that is producing and consuming an object whose actual type is implementation-dependent, the type of this object can often be modeled as an associated type in the interface.
Copy file name to clipboardexpand all lines: docs/user-guide/07-autodiff.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -381,7 +381,7 @@ struct MyType
381
381
Roriginal(T0p0, inoutT1, p1, T2p2);
382
382
```
383
383
384
-
Sometimes the derivative function needs to be defined in a different module from the original function, or the derivative function cannot be made visible from the original function. In this case, we can use the `[ForwardDerivativeOf(originalFunnc)]` attribute to inform the compiler that `originalFunc` should be treated as a forward-differentiable function, and the current function is the derivative implementation of `originalFunc`. The following code will have the same effect to associate `derivative` and the forward-derivative implementation of `original`:
384
+
Sometimes the derivative function needs to be defined in a different module from the original function, or the derivative function cannot be made visible from the original function. In this case, we can use the `[ForwardDerivativeOf(originalFunc)]` attribute to inform the compiler that `originalFunc` should be treated as a forward-differentiable function, and the current function is the derivative implementation of `originalFunc`. The following code will have the same effect to associate `derivative` and the forward-derivative implementation of `original`:
385
385
386
386
```csharp
387
387
Roriginal(T0p0, inoutT1, p1, T2p2);
@@ -653,7 +653,7 @@ This may lead to unexpected results. For example:
Copy file name to clipboardexpand all lines: docs/user-guide/08-compiling.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -924,7 +924,7 @@ meanings of their `CompilerOptionValue` encodings.
924
924
925
925
|CompilerOptionName | Description |
926
926
|:------------------ |:----------- |
927
-
| MacroDefine | Specifies a prepreocessor macro define entry. `stringValue0` encodes macro name, `stringValue1` encodes the macro value.
927
+
| MacroDefine | Specifies a preprocessor macro define entry. `stringValue0` encodes macro name, `stringValue1` encodes the macro value.
928
928
| Include | Specifies an additional search path. `stringValue0` encodes the additional path. |
929
929
| Language | Specifies the input language. `intValue0` encodes a value defined in `SlangSourceLanguage`. |
930
930
| MatrixLayoutColumn | Use column major matrix layout as default. `intValue0` encodes a bool value for the setting. |
@@ -973,5 +973,5 @@ meanings of their `CompilerOptionValue` encodings.
973
973
## Debugging
974
974
975
975
Slang's SPIRV backend supports generating debug information using the [NonSemantic Shader DebugInfo Instructions](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.Shader.DebugInfo.100.asciidoc).
976
-
To enable debugging information when targing SPIRV, specify the `-emit-spirv-directly` and the `-g2` argument when using `slangc` tool, or set `EmitSpirvDirectly` to `1` and `DebugInformation` to `SLANG_DEBUG_INFO_LEVEL_STANDARD` when using the API.
976
+
To enable debugging information when targeting SPIRV, specify the `-emit-spirv-directly` and the `-g2` argument when using `slangc` tool, or set `EmitSpirvDirectly` to `1` and `DebugInformation` to `SLANG_DEBUG_INFO_LEVEL_STANDARD` when using the API.
Copy file name to clipboardexpand all lines: docs/user-guide/09-reflection.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -487,7 +487,7 @@ void printSize(
487
487
}
488
488
```
489
489
490
-
Note that the size of a type may be *unbounded* for a particluar layout unit; this case is encoded just like the unbounded case for the element count of an array type (`~size_t(0)`).
490
+
Note that the size of a type may be *unbounded* for a particular layout unit; this case is encoded just like the unbounded case for the element count of an array type (`~size_t(0)`).
491
491
492
492
The layout units used by a particular type layout can be iterated over using `getCategoryCount()` and `getCategoryByIndex()`:
493
493
@@ -1052,7 +1052,7 @@ That is, the binding information for the implicit constant buffer will be found
1052
1052
The `ProgramLayout` type has the appealingly-named `getParameterCount` and `getParameterByIndex()` methods, which seem to be the obvious way to navigate the global-scope parameters of a shader.
1053
1053
However, we recommend *against* using these functions in applications that want to be able to systematically and robustly reflect any possible input shader code.
1054
1054
1055
-
While the reflection API implementation makes an effort to ensure that the information returned by `getParameterByIndex()` is not incorrect, it is very difficult when using those functions to account for how global-scope parameters might have been grouped into an automatically-introduced constnat buffer or parameter block.
1055
+
While the reflection API implementation makes an effort to ensure that the information returned by `getParameterByIndex()` is not incorrect, it is very difficult when using those functions to account for how global-scope parameters might have been grouped into an automatically-introduced constant buffer or parameter block.
1056
1056
The `getGlobalConstantBufferBinding()` and `getGlobalConstantBufferSize()` methods can be used in some scenarios, but aren't the best way to get the relevant information.
1057
1057
1058
1058
While it would only matter in corner cases, we still recommend that applications use `getGlobalParamsVarLayout()` instead of `getGlobalParamsTypeLayout()`, to account for cases where the global-scope might have offsets applied to it (and also to handle the global scope and entry-point scopes more uniformly).
@@ -1405,13 +1405,13 @@ In contrast, the cumulative of offset of `c.b` in `t` registers is one, and the
1405
1405
1406
1406
Similarly, when calculating the cumulative offsets of variables inside a parameter block (for targets that can allocate each parameter block its own space), it is important not to sum contributions past an enclosing parameter block.
1407
1407
1408
-
We can account for these subtleties by extending the representation of access paths in our example application to record the node coresponding to the deepest constant buffer or parameter block along the path:
1408
+
We can account for these subtleties by extending the representation of access paths in our example application to record the node corresponding to the deepest constant buffer or parameter block along the path:
1409
1409
1410
1410
```c++
1411
1411
structAccessPath
1412
1412
{
1413
1413
AccessPathNode* leaf = nullptr;
1414
-
AccessPathNode* deepestConstantBufer = nullptr;
1414
+
AccessPathNode* deepestConstantBuffer = nullptr;
1415
1415
AccessPathNode* deepestParameterBlock = nullptr;
1416
1416
};
1417
1417
```
@@ -1427,7 +1427,7 @@ case slang::TypeReflection::Kind::ShaderStorageBuffer:
Copy file name to clipboardexpand all lines: docs/user-guide/09-targets.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ On platforms that provide a CPU-like "flat" memory model with a single virtual a
61
61
Current graphics APIs provide far more complicated and less uniform mechanisms for passing shader parameters.
62
62
63
63
A high-level language compiler like Slang handles the task of _binding_ each user-defined shader parameter to one or more of the parameter-passing resources defined by a target platform.
64
-
For example, the Slang compiler might bindg a global `Texture2D` parameter called `gDiffuse` to the `t1` register defined by the Direct3D 11 API.
64
+
For example, the Slang compiler might bind a global `Texture2D` parameter called `gDiffuse` to the `t1` register defined by the Direct3D 11 API.
65
65
66
66
An application is responsible for passing the argument data for a parameter using the using the corresponding platform-specific resource it was bound to.
67
67
For example, an application should set the texture they want to use for `gDiffuse` to the `t1` register using Direct3D 11 API calls.
@@ -173,7 +173,7 @@ The D3D12 rasterization pipeline provides alternative geometry processing stages
173
173
174
174
- The optional `amplification` stage precedes the mesh stage and is responsible for determining how many mesh shader invocations should be run.
175
175
176
-
Compared to the D3D11 pipeline without tesselllation (hull and domain shaders), a mesh shader is kind of like a combined/generalized vertex and geometry shader.
176
+
Compared to the D3D11 pipeline without tessellation (hull and domain shaders), a mesh shader is kind of like a combined/generalized vertex and geometry shader.
177
177
178
178
Compared to the D3D11 pipeline with tessellation, an amplification shader is kind of like a combined/generalized vertex and hull shader, while a mesh shader is kind of like a combined/generalized domain and geometry shader.
Traditionally, graphics developers have been relying on the preprocessor defines to specialize their shader code for high-performance GPU execution.
9
9
While functioning systems can be built around preprocessor macros, overusing them leads to many problems:
10
-
- Long compilation time. With preprocessors defines, specialzation happens before parsing, which is a very early stage in the compilation flow.
10
+
- Long compilation time. With preprocessors defines, specialization happens before parsing, which is a very early stage in the compilation flow.
11
11
This means that the compiler must redo almost all work from the scratch with every specialized variant, including parsing, type checking, IR generation
12
12
and optimization, even when two specialized variants only differ in one constant value. The lack of reuse of compiler front-end work between
13
13
different shader specializations contributes a significant portion to long shader compile times.
Copy file name to clipboardexpand all lines: docs/user-guide/a1-03-obfuscation.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -193,7 +193,7 @@ This method is currently only available on the `ICompileRequest` and not on the
193
193
194
194
The file system returned is held in memory, and the blob data held in the file system typically shared, so accessing items this way is typically very low overhead.
195
195
196
-
The conventions used for the file system representation could best be described as a work in progress, and may change in the future. Internally Slang stores compilation results as a hierarchy of "artifacts". An artifact consists of the main result, plus associated artifacts. An artifact can also be a container which can additionally hold children artifacts. In the current directory structure each artifact is a directory, with the root directory of the `ISlangMultableFileSystem` being the root artifact.
196
+
The conventions used for the file system representation could best be described as a work in progress, and may change in the future. Internally Slang stores compilation results as a hierarchy of "artifacts". An artifact consists of the main result, plus associated artifacts. An artifact can also be a container which can additionally hold children artifacts. In the current directory structure each artifact is a directory, with the root directory of the `ISlangMutableFileSystem` being the root artifact.
197
197
198
198
Given a directory representing an artifact it can contain 2 special directories `children` and `associated`. The `children` directory contains the artifacts that are children of the current directories artifact. Similarly `associated` contains directories for artifacts that are associated with the current artifact.
Copy file name to clipboardexpand all lines: docs/user-guide/a1-04-interop.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,7 @@ float modf(float x, out float ip)
182
182
}
183
183
```
184
184
185
-
Opcodes such as `OpCapbility`, `OpExtension` and type definitions are allowed inside a `spirv_asm` block. These instructions will be deduplicated and inserted into the correct sections defined by the SPIRV specification, for example:
185
+
Opcodes such as `OpCapability`, `OpExtension` and type definitions are allowed inside a `spirv_asm` block. These instructions will be deduplicated and inserted into the correct sections defined by the SPIRV specification, for example:
Copy file name to clipboardexpand all lines: docs/user-guide/a2-01-spirv-target-specific.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -291,7 +291,7 @@ Another way to put, Slang treats column as row and row as column when targeting
291
291
292
292
Due to the swap of row and column in terminology, the matrix multiplication needs to be performed little differently. Slang translates a matrix multiplication, `mul(mat1, mat2)`, to `transpose(mul(transpose(mat2), transpose(mat1)))` when targeting SPIR-V.
293
293
294
-
Note that the matrix translation explained above is orthogoal to the memory layout of a matrix. The memory layout is related to how CPU places matrix values in the memory and how GPU reads them. It is like how `std140` or `std430` works. DXC by default uses `column_major` memory layout and Slang uses row-major memory layout. For more information about the matrix memory layout, please see [a1-01-matrix-layout](a1-01-matrix-layout.md).
294
+
Note that the matrix translation explained above is orthogonal to the memory layout of a matrix. The memory layout is related to how CPU places matrix values in the memory and how GPU reads them. It is like how `std140` or `std430` works. DXC by default uses `column_major` memory layout and Slang uses row-major memory layout. For more information about the matrix memory layout, please see [a1-01-matrix-layout](a1-01-matrix-layout.md).
0 commit comments