summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/target-compatibility.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/target-compatibility.md b/docs/target-compatibility.md
index 64695c09c..e8edeeaf5 100644
--- a/docs/target-compatibility.md
+++ b/docs/target-compatibility.md
@@ -34,6 +34,7 @@ Items with ^ means there is some discussion about support later in the document
| tex.Load | Yes | Yes | Yes | Limited ^ | Yes
| Full bool | Yes | Yes | Yes | No | Yes ^
| Mesh Shader | No | No + | No + | No | No
+| `[unroll]` | Yes | Yes | Yes ^ | Yes | Limited +
## Half Type
@@ -114,3 +115,14 @@ tex.Load is only supported on CUDA for Texture1D. Additionally CUDA only allows
Means fully featured bool support. CUDA has issues around bool because there isn't a vector bool type built in. Currently bool aliases to an int vector type.
On CPU there are some issues in so far as bool's size is not well defined in size an alignment. Most C++ compilers now use a byte to represent a bool. In the past it has been backed by an int on some compilers.
+
+## `[unroll]`
+
+The unroll attribute allows for unrolling `for` loops. At the moment the feature is dependent on downstream compiler support which is mixed. In the longer term the intention is for Slang to contain it's own loop unroller - and therefore not be dependent on the feature on downstream compilers.
+
+On C++ this attribute becomes SLANG_UNROLL which is defined in the prelude. This can be predefined if there is a suitable mechanism, if there isn't a definition SLANG_UNROLL will be an empty definition.
+
+On GLSL and VK targets loop unrolling uses the [GL_EXT_control_flow_attributes](https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GL_EXT_control_flow_attributes.txt) extension.
+
+Slang does have a cross target mechanism to [unroll loops](language-reference/06-statements.md), in the section `Compile-Time For Statement`.
+