2021-09-02 13:49:59 +00:00
# Tint changes during Origin Trial
2023-01-30 15:34:49 +00:00
## Changes for M112
### Breaking changes
* * The `sig` member of the return type of `frexp()` has been renamed to `fract` . [tint:1766 ](crbug.com/tint/1766 )
2023-01-24 14:55:17 +00:00
## Changes for M111
2023-01-26 13:02:59 +00:00
### New features
* The `workgroupUniformLoad` builtin function is now supported. [tint:1780 ](crbug.com/tint/1780 )
* The `diagnostic` directive and `@diagnostic` attribute are now supported. [tint:1809 ](crbug.com/tint/1809 )
* The attribute is currently only supported on function declarations.
2023-01-24 19:32:04 +00:00
### Breaking changes
* You may need to add parentheses to less-than or greater-than binary expressions that now parse as template lists. For example `a(b<c, d>e)` will need parentheses around `b<c` or `d>e` . [tint:1810 ](crbug.com/tint/1810 ).
2023-01-26 13:02:59 +00:00
* Uniformity analysis failures are now an error [tint:880 ](crbug.com/tint/880 )
* The `derivative_uniformity` diagnostic filter can be used to modify the severity if needed.
2023-01-24 19:32:04 +00:00
2023-01-24 14:55:17 +00:00
## Deprecated Features
* The keyword to alias a type has been renamed from `type` to `alias` . [tint:1812 ](crbug.com/tint/1812 )
2023-01-24 14:59:43 +00:00
* `static_assert` has been renamed to `const_assert` . [tint:1807 ](crbug.com/tint/1807 )
2023-01-24 14:55:17 +00:00
2022-11-14 15:29:29 +00:00
## Changes for M110
2022-11-18 11:17:41 +00:00
### Breaking changes
* The `textureSampleLevel()` overload for `texture_external` has been removed. Use `textureSampleBaseClampToEdge()` . [tint:1671 ](crbug.com/tint/1671 )
2022-11-14 15:29:29 +00:00
### Deprecated Features
* The `sig` member of the return type of `frexp()` has been renamed to `fract` . [tint:1757 ](crbug.com/tint/1757 )
2022-11-17 17:27:27 +00:00
* Calling a function with multiple pointer arguments that alias each other is now a warning, and
will become an error in a future release. [tint:1675 ](crbug.com/tint/1675 )
2022-11-14 15:29:29 +00:00
2022-10-26 00:27:38 +00:00
## Changes for M109
2022-10-26 18:36:44 +00:00
### Breaking changes
* `textureDimensions()` , `textureNumLayers()` and `textureNumLevels()` now return unsigned integers / vectors. [tint:1526 ](crbug.com/tint/1526 )
2022-11-07 11:34:34 +00:00
* The `@stage` attribute has been removed. The short forms should be used
instead (`@vertex`, `@fragment` , or `@compute` ). [tint:1503 ](crbug.com/tint/1503 )
2022-11-07 14:20:33 +00:00
* Module-scope `let` is now an error. Use module-scope `const` instead. [tint:1580 ](crbug.com/tint/1584 )
2022-11-07 16:15:55 +00:00
* Reserved words are now an error instead of a deprecation. [tint:1463 ](crbug.com/tint/1463 )
2022-11-09 20:11:43 +00:00
* You may no longer use pointer parameters in `workgroup` address space. [tint:1721 ](crbug.com/tint/1721 )
2022-10-26 18:36:44 +00:00
2022-10-26 00:27:38 +00:00
### New features
* Uniformity analysis failures are warnings again [tint:1728 ](crbug.com/tint/1728 )
2022-10-26 18:47:02 +00:00
* You can now call texture builtins with a mix of signed and unsigned integer arguments. [tint:1733 ](crbug.com/tint/1733 )
2022-10-26 00:27:38 +00:00
2022-09-22 22:59:16 +00:00
## Changes for M108
### New features
* `textureSampleBaseClampToEdge()` has been implemented. [tint:1671 ](crbug.com/tint/1671 )
### Deprecated Features
* The `external_texture` overload of `textureSampleLevel()` has been deprecated. Use `textureSampleBaseClampToEdge()` instead. [tint:1671 ](crbug.com/tint/1671 )
2022-10-11 20:36:48 +00:00
### Fixes
* Constant evaluation of type conversions where the value exceeds the limits of the target type have been fixed. [tint:1707 ](crbug.com/tint/1707 )
2022-09-21 13:20:13 +00:00
## Changes for M107
2022-08-02 16:14:25 +00:00
### New features
2022-09-13 22:57:52 +00:00
* `saturate()` has been implemented. [tint:1591 ](crbug.com/tint/1591 )
2022-08-02 16:14:25 +00:00
2022-09-13 22:47:12 +00:00
### Breaking changes
2022-09-26 12:30:05 +00:00
* Uniformity analysis failures are now an error [tint:880 ](crbug.com/tint/880 )
2022-09-13 22:47:12 +00:00
* Indexing an array, vector or matrix with a compile-time expression that's out-of-bounds is now an error [tint:1665 ](crbug.com/tint/1665 )
2022-09-21 13:20:13 +00:00
## Changes for M106
### New features
* `array()` constructor can now infer type and count. [tint:1628 ](crbug.com/tint/1628 )
* `static_assert` statement has been added. [tint:1625 ](crbug.com/tint/1625 )
2022-08-03 14:34:16 +00:00
### Deprecated Features
* The list of reserved words has been sync'd to the WGSL specification. [tint:1463 ](crbug.com/tint/1463 )
2022-06-09 15:33:42 +00:00
## Changes for M105
2022-06-28 12:53:56 +00:00
### New features
* Module-scope `var<private>` can now infer the storage type, like function-scope `var` . [tint:1584 ](crbug.com/tint/1584 )
2022-06-28 15:27:44 +00:00
* The `acosh` , `asinh` , and `atanh` builtin functions are now supported [tint:1465 ](crbug.com/tint/1465 )
2022-06-28 12:53:56 +00:00
2022-06-15 23:32:14 +00:00
### Breaking changes
* The `smoothStep()` builtin has been removed (use `smoothstep` instead). [tint:1483 ](crbug.com/tint/1483 )
2022-06-29 00:55:36 +00:00
* Module-scope `let` has been replaced with module-scope `const` . [tint:1580 ](crbug.com/tint/1584 )
* Note: Module-scope `const` does not support structure types. Use `var<private>` if you need a module-scope structure type.
2022-07-04 16:58:00 +00:00
* Struct members can no longer be separated with semicolons (use commas instead). [tint:1475 ](crbug.com/tint/1475 )
2022-07-15 15:25:30 +00:00
* Single scalar matrix constructors have been removed. These were never part of the WGSL spec. [tint:1597 ](crbug.com/tint/1597 )
2022-06-15 23:32:14 +00:00
2022-06-09 15:33:42 +00:00
### Deprecated Features
* The `@stage` attribute has been deprecated. The short forms should be used
instead (`@vertex`, `@fragment` , or `@compute` ). [tint:1503 ](crbug.com/tint/1503 )
## Changes for M104
2022-06-09 16:45:05 +00:00
### New features
* Tint now supports abstract-numerics, removing the need to always suffix unsigned integers with `u` [tint:1504 ](crbug.com/tint/1504 )
2022-06-09 15:33:42 +00:00
* Parsing of `@compute` , `@fragment` and `@vertex` added.
2022-05-11 22:05:15 +00:00
## Changes for M103
### New features
* Produce warnings for when calling barriers, textureSample, and derivative
builtins in non-uniform control flow [tint:880 ](crbug.com/tint/880 )
2022-05-16 21:14:11 +00:00
* Matrix identity constructors and constructors for a single scalar value are now supported [tint:1545 ](crbug.com/tint/1545 )
2022-05-11 22:05:15 +00:00
2022-05-31 22:35:49 +00:00
### Breaking changes
2022-06-09 16:45:05 +00:00
2022-05-31 22:35:49 +00:00
* Builtin `atomicCompareExchangeWeak` returns a struct instead of a vec2. [tint:1185 ](crbug.com/tint/1185 )
2022-03-21 16:09:17 +00:00
## Changes for M102
2022-03-23 09:11:03 +00:00
### New Features
* Parentheses are no longer required around expressions for if and switch statements [tint:1424 ](crbug.com/tint/1424 )
2022-03-31 22:30:10 +00:00
* Compound assignment statements are now supported. [tint:1325 ](https://crbug.com/tint/1325 )
2022-04-07 13:42:45 +00:00
* Postfix increment and decrement statements are now supported. [tint:1488 ](crbug.com/tint/1488 )
2022-04-05 21:01:09 +00:00
* The colon in case statements is now optional. [tint:1485 ](crbug.com/tint/1485 )
2022-03-23 09:11:03 +00:00
2022-03-21 16:09:17 +00:00
### Breaking changes
2022-03-28 14:31:22 +00:00
* Struct members are now separated by commas. [tint:1475 ](crbug.com/tint/1475 )
2022-03-21 16:09:17 +00:00
* The `@block` attribute has been removed. [tint:1324 ](crbug.com/tint/1324 )
2022-03-21 16:09:17 +00:00
* The `@stride` attribute has been removed. [tint:1381 ](crbug.com/tint/1381 )
2022-03-21 16:09:17 +00:00
* Attributes using `[[attribute]]` syntax are no longer supported. [tint:1382 ](crbug.com/tint/1382 )
2022-03-21 16:09:17 +00:00
* The `elseif` keyword is no longer supported. [tint:1289 ](crbug.com/tint/1289 )
2022-03-21 16:09:17 +00:00
2022-03-30 17:57:39 +00:00
### Deprecated Features
* The `smoothStep()` builtin has been renamed to `smoothstep()` . [tint:1483 ](crbug.com/tint/1483 )
2022-02-18 21:47:24 +00:00
## Changes for M101
### New Features
* Tint now supports unicode identifiers. [tint:1437 ](crbug.com/tint/1437 )
2022-03-05 00:39:14 +00:00
### Breaking changes
* The `isNan()` , `isInf()` , `isFinite()` , and `isNormal()` builtins have been removed. [tint:1312 ](https://crbug.com/tint/1312 )
2022-01-25 01:01:39 +00:00
## Changes for M100
### Breaking changes
* The `@interpolate(flat)` attribute must now be specified on integral user-defined IO. [tint:1224 ](crbug.com/tint/1224 )
2022-02-01 17:21:52 +00:00
* The `ignore()` intrinsic has been removed. Use phoney-assignment instead: `ignore(expr);` -> `_ = expr;` .
2022-02-03 00:12:52 +00:00
* `break` statements in `continuing` blocks are now correctly validated.
2022-01-25 01:01:39 +00:00
2022-02-14 21:56:06 +00:00
### New Features
* Module-scope declarations can now be declared in any order. [tint:1266 ](crbug.com/tint/1266 )
2022-02-15 16:36:57 +00:00
* The `override` keyword and `@id()` attribute for pipeline-overridable constants are now supported, replacing the `@override` attribute. [tint:1403 ](crbug.com/tint/1403 )
2022-02-14 21:56:06 +00:00
2021-12-09 22:53:14 +00:00
## Changes for M99
2022-01-14 17:16:32 +00:00
### Breaking changes
Obviously infinite loops (no condition, no break) are now a validation error.
2021-12-09 22:53:14 +00:00
### Deprecated Features
2022-01-04 20:06:49 +00:00
The following features have been deprecated and will be removed in M102:
* The `[[block]]` attribute has been deprecated. [tint:1324 ](https://crbug.com/tint/1324 )
2022-01-19 22:46:57 +00:00
* Attributes now use the `@decoration` syntax instead of the `[[decoration]]` syntax. [tint:1382 ](https://crbug.com/tint/1382 )
* `elseif` has been replaced with `else if` . [tint:1289 ](https://crbug.com/tint/1289 )
2022-01-20 22:11:07 +00:00
* The `[[stride]]` attribute has been deprecated. [tint:1381 ](https://crbug.com/tint/1381 )
2021-12-09 22:53:14 +00:00
### New Features
* Vector and matrix element type can now be inferred from constructor argument types. [tint:1334 ](https://crbug.com/tint/1334 )
2022-01-05 20:11:00 +00:00
* Added builtins `degrees()` and `radians()` for converting between degrees and radians. [tint:1329 ](https://crbug.com/tint/1329 )
2022-01-06 18:11:01 +00:00
* `let` arrays and matrices can now be dynamically indexed. [tint:1352 ](https://crbug.com/tint/1352 )
2022-01-19 15:55:56 +00:00
* Storage and Uniform buffer types no longer have to be structures. [tint:1372 ](crbug.com/tint/1372 )
2022-01-19 18:11:17 +00:00
* A struct declaration does not have to be followed by a semicolon. [tint:1380 ](crbug.com/tint/1380 )
2021-12-09 22:53:14 +00:00
2022-01-06 21:32:41 +00:00
### Fixes
* Fixed an issue where for-loops that contain array or structure constructors in the loop initializer statements, condition expressions or continuing statements could fail to compile. [tint:1364 ](https://crbug.com/tint/1364 )
2021-11-04 19:55:57 +00:00
## Changes for M98
### Breaking Changes
* Taking the address of a vector component is no longer allowed.
2021-11-26 09:56:19 +00:00
* Module-scope declarations can no longer alias a builtin name. [tint:1318 ](https://crbug.com/tint/1318 )
2021-12-03 17:51:48 +00:00
* It is now an error to call a function either directly or transitively, from a loop continuing block, that uses `discard` . [tint:1302 ](https://crbug.com/tint/1302 )
2021-11-04 19:55:57 +00:00
2021-11-23 18:57:57 +00:00
### Deprecated Features
* The `isNan()` , `isInf()` , `isFinite()` and `isNormal()` builtins has been deprecated and will be removed in M101. [tint:1312 ](https://crbug.com/tint/1312 )
2021-11-05 18:37:16 +00:00
### New Features
2021-12-08 19:54:08 +00:00
* New texture gather builtins: `textureGather()` and `textureGatherCompare()` . [tint:1330 ](https://crbug.com/tint/1330 )
2021-11-23 20:45:51 +00:00
* Shadowing is now fully supported. [tint:819 ](https://crbug.com/tint/819 )
2021-11-05 18:37:16 +00:00
* The `dot()` builtin now supports integer vector types.
2021-11-22 15:24:16 +00:00
* Identifiers can now start with a single leading underscore. [tint:1292 ](https://crbug.com/tint/1292 )
2021-12-03 17:51:48 +00:00
* Control flow analysis has been improved, and functions no longer need to `return` if the statement is unreachable. [tint:1302 ](https://crbug.com/tint/1302 )
* Unreachable statements now produce a warning instead of an error, to allow WGSL code to be updated to the new analysis behavior. These warnings may become errors in the future [gpuweb#2378 ](https://github.com/gpuweb/gpuweb/issues/2378 )
2021-11-05 18:37:16 +00:00
2021-11-23 21:46:48 +00:00
### Fixes
* Fixed an issue where using a module-scoped `let` in a `workgroup_size` may result in a compilation error. [tint:1320 ](https://crbug.com/tint/1320 )
2021-10-14 03:17:32 +00:00
## Changes for M97
2021-10-12 21:57:47 +00:00
### Breaking Changes
* Deprecated `modf()` and `frexp()` builtin overloads that take a pointer second parameter have been removed.
2021-10-14 10:10:45 +00:00
* Deprecated texture builtin functions that accepted a `read` access controlled storage texture have been removed.
* Storage textures must now only use the `write` access control.
2021-10-12 21:57:47 +00:00
2021-10-22 06:23:12 +00:00
### Deprecated Features
* The `ignore()` builtin has been replaced with phony-assignment. [gpuweb#2127 ](https://github.com/gpuweb/gpuweb/pull/2127 )
2021-10-21 09:39:13 +00:00
### New Features
* `any()` and `all()` now support a `bool` parameter. These simply return the passed argument. [tint:1253 ](https://crbug.com/tint/1253 )
2021-10-21 20:36:04 +00:00
* Call statements may now include functions that return a value (`ignore()` is no longer needed).
2021-10-21 23:08:44 +00:00
* The `interpolate(flat)` attribute can now be specified on integral user-defined IO. It will eventually become an error to define integral user-defined IO without this attribute.
2021-10-25 19:20:31 +00:00
* Matrix construction from scalar element values is now supported.
2021-10-21 09:39:13 +00:00
2021-10-20 16:12:33 +00:00
### Fixes
* Swizzling of `vec3` types in `storage` and `uniform` buffers has been fixed for Metal 1.x. [tint:1249 ](https://crbug.com/tint/1249 )
2021-10-25 11:00:44 +00:00
* Calling a function that returns an unused value no longer produces an FXC compilation error. [tint:1259 ](https://crbug.com/tint/1259 )
2022-01-05 21:03:10 +00:00
* `abs()` fixed for unsigned integers on SPIR-V backend
2021-10-20 16:12:33 +00:00
2021-09-02 13:49:59 +00:00
## Changes for M95
### New Features
2021-10-01 08:41:55 +00:00
2021-09-02 13:49:59 +00:00
* The size of an array can now be defined using a non-overridable module-scope constant
2021-09-13 17:11:58 +00:00
* The `num_workgroups` builtin is now supported.
2021-09-08 13:46:51 +00:00
### Fixes
2021-10-01 08:41:55 +00:00
* Hex floats: now correctly errors when the magnitude is non-zero, and the exponent would cause overflow. [tint:1150 ](https://crbug.com/tint/1150 ), [tint:1166 ](https://crbug.com/tint/1166 )
2021-10-12 21:57:47 +00:00
* Identifiers beginning with an underscore are now correctly rejected. [tint:1179 ](https://crbug.com/tint/1179 )