summaryrefslogtreecommitdiffstats
path: root/docs/language-reference
diff options
context:
space:
mode:
Diffstat (limited to 'docs/language-reference')
-rw-r--r--docs/language-reference/05-expressions.md6
-rw-r--r--docs/language-reference/06-statements.md6
-rw-r--r--docs/language-reference/07-declarations.md16
-rw-r--r--docs/language-reference/08-attributes.md2
4 files changed, 15 insertions, 15 deletions
diff --git a/docs/language-reference/05-expressions.md b/docs/language-reference/05-expressions.md
index da0921ff2..64bee737a 100644
--- a/docs/language-reference/05-expressions.md
+++ b/docs/language-reference/05-expressions.md
@@ -105,7 +105,7 @@ If the member name of a swizzle consists of a single character, then the express
If the member name of a swizzle consists of `M` characters, then the result is a `vector<T,M>` built from the elements of the base vector with the corresponding indices.
-A vector swizzle expression is an l-value if the base expression was an l-value and the list of indices corresponding to the characeters of the member name contains no duplicates.
+A vector swizzle expression is an l-value if the base expression was an l-value and the list of indices corresponding to the characters of the member name contains no duplicates.
### Matrix Swizzles
@@ -224,7 +224,7 @@ A cast expression can perform both built-in type conversions and invoke any sing
### Compatibility Feature
-As a compatiblity feature for older code, Slang supports using a cast where the base expression is an integer literal zero and the target type is a user-defined structure type:
+As a compatibility feature for older code, Slang supports using a cast where the base expression is an integer literal zero and the target type is a user-defined structure type:
```hlsl
MyStruct s = (MyStruct) 0;
@@ -338,7 +338,7 @@ With the exception of the assignment operator (`=`), an infix operator expressio
### Conditional Expression
-The conditonal operator, `?:`, is used to select between two expressions based on the value of a condition:
+The conditional operator, `?:`, is used to select between two expressions based on the value of a condition:
```hlsl
useNegative ? -1.0f : 1.0f
diff --git a/docs/language-reference/06-statements.md b/docs/language-reference/06-statements.md
index 7a4770d99..5c3b77ad4 100644
--- a/docs/language-reference/06-statements.md
+++ b/docs/language-reference/06-statements.md
@@ -3,7 +3,7 @@
Statements
==========
-Statements are used to define the bodies of functions and deterine order of evaluation and control flow for an entire program.
+Statements are used to define the bodies of functions and determine order of evaluation and control flow for an entire program.
Statements are distinct from expressions in that statements do not yield results and do not have types.
This section lists the kinds of statements supported by Slang.
@@ -101,7 +101,7 @@ default:
break;
```
-A _case label_ consists of the keyword `case` followed by an expresison and a colon (`:`).
+A _case label_ consists of the keyword `case` followed by an expressions and a colon (`:`).
The expression must evaluate to a compile-time constant integer.
A _default label_ consists of the keyword `default` followed by a colon (`:`).
@@ -203,7 +203,7 @@ The value returned must be able to coerce to the result type of the lexically en
### Discard Statement
-A `discard` statement can only be used in the context of a fragment shader, in which case it causes the current invocation to terminate and the graphics system to discard the corresponding fragment so that it does not get combined with the framebuffer pixel at its coordintes.
+A `discard` statement can only be used in the context of a fragment shader, in which case it causes the current invocation to terminate and the graphics system to discard the corresponding fragment so that it does not get combined with the framebuffer pixel at its coordinates.
Operations with side effects that were executed by the invocation before a `discard` will still be performed and their results will become visible according to the rules of the platform.
diff --git a/docs/language-reference/07-declarations.md b/docs/language-reference/07-declarations.md
index e3b7aa60d..2c6e6bdbe 100644
--- a/docs/language-reference/07-declarations.md
+++ b/docs/language-reference/07-declarations.md
@@ -85,7 +85,7 @@ var y = 9.0;
A `let` declaration introduces an immutable variable, which may not be assigned to or used as the argument for an `in out` or `out` parameter.
A `var` declaration introduces a mutable variable.
-An explicit type may be given for a variable by placing it afte the variable name and a colon (`:`):
+An explicit type may be given for a variable by placing it after the variable name and a colon (`:`):
```hlsl
let x : int = 7;
@@ -160,7 +160,7 @@ A global shader parameter may include an initial-value epxression, but such an e
### Variables at Function Scope
-Variables declared at _function scope_ (in the body of a function, initializer, subscript acessor, etc.) may be either a function-scope constant, function-scope static variable, or a local variable.
+Variables declared at _function scope_ (in the body of a function, initializer, subscript accessor, etc.) may be either a function-scope constant, function-scope static variable, or a local variable.
#### Function-Scope Constants
@@ -216,7 +216,7 @@ The available directions are:
* `in out` or `inout` indicates pass-by-value-result (copy-in and copy-out) semantics. The callee receives a copy of the argument passed by the caller, it may manipulate the copy, and then when the call returns the final value is copied back to the argument of the caller.
An implementation may assume that at every call site the arguments for `out` or `in out` parameters never alias.
-Under those assumptions, the `out` and `inout` cases may be optimized to use pass-by-refernece instead of copy-in and copy-out.
+Under those assumptions, the `out` and `inout` cases may be optimized to use pass-by-reference instead of copy-in and copy-out.
> Note: Applications that rely on the precise order in which write-back for `out` and `in out` parameters is performed are already on shaky semantic ground.
@@ -332,7 +332,7 @@ struct Things { ... }
When a structure declarations ends without a semicolon, the closing curly brace (`}`) must be the last non-comment, non-whitespace token on its line.
-For compatiblity with C-style code, a structure type declaration may be used as the type specifier in a traditional-style variable declaration:
+For compatibility with C-style code, a structure type declaration may be used as the type specifier in a traditional-style variable declaration:
```hlsl
struct Association
@@ -372,7 +372,7 @@ An optional trailing comma may terminate the lis of cases.
A _case declaration_ consists of the name of the case, along with an optional initial-value expression that specifies the _tag value_ for that case.
If the first case declaration in the body elides an initial-value expression, the value `0` is used for the tag value.
-If any other case decalration elides an initial-value expresison, its tag value is one greater than the tag value of the immediately preceding case declaration.
+If any other case declaration elides an initial-value expressions, its tag value is one greater than the tag value of the immediately preceding case declaration.
An enumeration case is referred to as if it were a `static` member of the enumeration type (e.g., `Color.Red`).
@@ -429,7 +429,7 @@ typedef int Height;
Constant Buffers and Texture Buffers
------------------------------------
-As a compatiblity feature, the `cbuffer` and `tbuffer` keywords can be used to introduce variable declarations.
+As a compatibility feature, the `cbuffer` and `tbuffer` keywords can be used to introduce variable declarations.
A declaration of the form:
@@ -528,7 +528,7 @@ It is an error to declare an associated type anywhere other than the body of an
An associated type declaration may have an inheritance clause.
The inheritance clause of an associated type may only list interfaces; these are the _required interfaces_ for the associated type.
-A concrete type that is used to satisfy an associated type requirement must conform to all of the required interaces of the associated type.
+A concrete type that is used to satisfy an associated type requirement must conform to all of the required interfaces of the associated type.
Initializers
------------
@@ -599,7 +599,7 @@ MyVector v = ...;
float f = v[0];
```
-A subscript declaration lists one or more parameters inside parantheses, followed by a result type clause starting with `->`.
+A subscript declaration lists one or more parameters inside parentheses, followed by a result type clause starting with `->`.
The result type clause of a subscript declaration cannot be elided.
The body of a subscript declaration consists of _accessor declarations_.
diff --git a/docs/language-reference/08-attributes.md b/docs/language-reference/08-attributes.md
index 7ffe0f0fe..f4d900d33 100644
--- a/docs/language-reference/08-attributes.md
+++ b/docs/language-reference/08-attributes.md
@@ -11,7 +11,7 @@ Attributes
This attribute is only available for Vulkan SPIR-V output.
-The attibute allows access to SPIR-V intrinsics, by supplying a function declaration with the appropriate signature for the SPIR-V op and no body. The intrinsic takes a single parameter which is the integer value for the SPIR-V op.
+The attribute allows access to SPIR-V intrinsics, by supplying a function declaration with the appropriate signature for the SPIR-V op and no body. The intrinsic takes a single parameter which is the integer value for the SPIR-V op.
In the example below the add function, uses the mechanism to directly use the SPIR-V integer add 'op' which is 128 in this case.