summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/user-guide/04-interfaces-generics.md44
-rw-r--r--docs/user-guide/a1-03-obfuscation.md6
-rw-r--r--docs/user-guide/toc.html10
3 files changed, 34 insertions, 26 deletions
diff --git a/docs/user-guide/04-interfaces-generics.md b/docs/user-guide/04-interfaces-generics.md
index 322134d9f..94a08714e 100644
--- a/docs/user-guide/04-interfaces-generics.md
+++ b/docs/user-guide/04-interfaces-generics.md
@@ -136,25 +136,6 @@ void f<T:IFoo>()
}
```
-### `This` Type
-
-You may use a special keyword `This` in interface definitions to refer to the type that is conforming to the interface. The following examples demonstrate a use of `This` type:
-```csharp
-interface IComparable
-{
- int comparesTo(This other);
-}
-struct MyObject : IComparable
-{
- int val;
- int comparesTo(MyObject other)
- {
- return val < other.val ? -1 : 1;
- }
-}
-```
-In this example, the `IComparable` interface declares that any conforming type must provide a `comparesTo` method that performs a comparison between an object to another object of the same type. The `MyObject` type satisfies this requirement by providing a `comparesTo` method that accepts a `MyObject` typed argument, since in the scope of `MyObject`, `This` type is equivalent to `MyObject`.
-
### Static Constants
You can define static constant requirements in an interface. The constants can be accessed in places where a compile-time constant is needed.
@@ -175,6 +156,25 @@ struct GetValuePlus1<T:IMyValue>
static const int result = GetValuePlus1<MyObject2>.value; // result == 3
```
+### `This` Type
+
+You may use a special keyword `This` in interface definitions to refer to the type that is conforming to the interface. The following examples demonstrate a use of `This` type:
+```csharp
+interface IComparable
+{
+ int comparesTo(This other);
+}
+struct MyObject : IComparable
+{
+ int val;
+ int comparesTo(MyObject other)
+ {
+ return val < other.val ? -1 : 1;
+ }
+}
+```
+In this example, the `IComparable` interface declares that any conforming type must provide a `comparesTo` method that performs a comparison between an object to another object of the same type. The `MyObject` type satisfies this requirement by providing a `comparesTo` method that accepts a `MyObject` typed argument, since in the scope of `MyObject`, `This` type is equivalent to `MyObject`.
+
### Initializers
Consider a generic method that wants to create and initialize a new instance of generic type `T`:
@@ -459,10 +459,10 @@ In this example, the `Array` type has a generic type parameter, `T`, that is use
Note that the builtin `vector<float, N>` type also has an generic value parameter `N`.
> #### Note ####
-> The only type of generic value parameters are integer values. `bool`, `float` and
+> The only type of generic value parameters are `int`, `uint` and `bool`. `float` and
> other types cannot be used in a generic value parameter. Computations in a type
-> expression are supported as long as they can be folded at compile time. For example,
-`vector<float, 1+1>` is equivalent to `vector<float, 2>`.
+> expression are supported as long as they can be evaluated at compile time. For example,
+`vector<float, 1+1>` is allowed and considered equivalent to `vector<float, 2>`.
Interface-typed Values
diff --git a/docs/user-guide/a1-03-obfuscation.md b/docs/user-guide/a1-03-obfuscation.md
index 1a1bc9326..abce92e12 100644
--- a/docs/user-guide/a1-03-obfuscation.md
+++ b/docs/user-guide/a1-03-obfuscation.md
@@ -19,8 +19,7 @@ If a developer is not able to ship all shader binaries then there is a problem.
Some of these issues are similar to the problems of distributing JavaScript libraries that run on client machines, but which the original authors do not want to directly make available the implementation. Some of the obfuscation solutions used in the JavaScript world are partially applicable to Slang's obfuscation solution, including [source maps](https://github.com/source-map/source-map-spec).
-Obfuscation in Slang
-====================
+## Obfuscation in Slang
Slang provides an obfuscation feature that addresses these issues. The major parts being
@@ -261,8 +260,7 @@ Why you might not want to use an emit source map
* A developer could use the slang `compiler-core` implementation
* In the future the project could provide some API support
-Issues/Future Work
-==================
+## Issues/Future Work
* Support AST emitting in obfuscated modules
* Potentially add API support for source maps
diff --git a/docs/user-guide/toc.html b/docs/user-guide/toc.html
index be6fd04bb..a36925683 100644
--- a/docs/user-guide/toc.html
+++ b/docs/user-guide/toc.html
@@ -110,6 +110,16 @@
<li data-link="a1-02-slangpy#type-marshalling-between-slang-and-python"><span>Type Marshalling Between Slang and Python</span></li>
</ul>
</li>
+<li data-link="a1-03-obfuscation"><span>Obfuscation</span>
+<ul class="toc_list">
+<li data-link="a1-03-obfuscation#obfuscation-in-slang"><span>Obfuscation in Slang</span></li>
+<li data-link="a1-03-obfuscation#using-an-obfuscated-module"><span>Using An Obfuscated Module</span></li>
+<li data-link="a1-03-obfuscation#accessing-source-maps"><span>Accessing Source Maps</span></li>
+<li data-link="a1-03-obfuscation#accessing-source-maps-without-files"><span>Accessing Source Maps without Files</span></li>
+<li data-link="a1-03-obfuscation#emit-source-maps"><span>Emit Source Maps</span></li>
+<li data-link="a1-03-obfuscation#issuesfuture-work"><span>Issues/Future Work</span></li>
+</ul>
+</li>
</ul>
</li>
</ul>