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
// Equivalent to `float3 a[2] = {{1,2,3}, {4,5,6}};`
982
+
```csharp
983
+
// Equivalent to `float3 a[2] = {{1,2,3}, {4,5,6}};`
984
984
float3a[3] = {1,2,3, 4,5,6};
985
985
```
986
986
987
987
### Initializer Lists - Struct
988
988
989
989
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:
In addition, Slang also provides compatbility support for C-style initializer lists with `struct`s. C-style initializer lists can use [Partial Initializer List's](#Partial-Initializer-List's) and [Flattened Array Initializer With Struct's](#Flattened-Array-Initializer-With-Struct)
@@ -1056,7 +1056,7 @@ A struct is considered a C-style struct if:
1056
1056
1057
1057
#### Partial Initializer List's
1058
1058
1059
-
```c#
1059
+
```csharp
1060
1060
structFoo
1061
1061
{
1062
1062
inta;
@@ -1075,7 +1075,7 @@ Foo val = {2, 3};
1075
1075
1076
1076
#### Flattened Array Initializer With Struct's
1077
1077
1078
-
```c#
1078
+
```csharp
1079
1079
structFoo
1080
1080
{
1081
1081
inta;
@@ -1085,7 +1085,7 @@ struct Foo
1085
1085
1086
1086
...
1087
1087
1088
-
// Equivalent to `Foo val[2] = {{0,1,2}, {3,4,5}};`
1088
+
// Equivalent to `Foo val[2] = {{0,1,2}, {3,4,5}};`
0 commit comments