Skip to content

Commit e670cd7

Browse files
committed
Split abs into signed and unsigend cases
In the unsigned case it's the identity function.
1 parent b91e780 commit e670cd7

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

wgsl/index.bs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4773,14 +4773,25 @@ TODO: deduplicate these tables
47734773
<thead>
47744774
<tr><th>Precondition<th>Built-in<th>Description
47754775
</thead>
4776-
<tr algorithm="scalar case, abs">
4777-
<td>|T| is u32 or i32
4778-
<td class="nowrap">`abs(`|e|`:` |T| `) ->` |T|
4779-
<td>(GLSLstd450SAbs)
4780-
<tr algorithm="vector case, abs">
4781-
<td>|T| is u32 or i32
4782-
<td class="nowrap">`abs(`|e|`:` vec|N|<|T|> `) ->` vec|N|<|T|>
4783-
<td>(GLSLstd450SAbs)
4776+
<tr algorithm="scalar case, signed abs">
4777+
<td>
4778+
<td class="nowrap">`abs`(|e|: i32 ) -> i32
4779+
<td>The absolute value of |e|.<br>
4780+
(GLSLstd450SAbs)
4781+
<tr algorithm="vector case, signed abs">
4782+
<td>
4783+
<td class="nowrap">`abs`(|e| : vec|N|&lt;i32&gt; ) -> vec|N|&lt;i32&gt;
4784+
<td>Component-wise absolute value:
4785+
Component |i| of the result is `abs(`|e|`[`|i|`])`<br>
4786+
(GLSLstd450SAbs)
4787+
<tr algorithm="scalar case, unsigned abs">
4788+
<td>
4789+
<td class="nowrap">`abs`(|e| : u32 ) -> u32
4790+
<td>Result is |e|. This is provided for symmetry with `abs` for signed integers.
4791+
<tr algorithm="vector case, unsgined abs">
4792+
<td>
4793+
<td class="nowrap">`abs(`|e|`:` vec|N|&lt;u32&gt; `) ->` vec|N|&lt;u32&gt;
4794+
<td>Result is |e|. This is provided for symmetry with `abs` for signed integer vectors.
47844795
<tr algorithm="scalar case, unsigned clamp">
47854796
<td>|T| is u32
47864797
<td class="nowrap">`clamp(`|e1|`:` |T| `, `|e2|`:` |T|`, `|e3|`:` |T|`) ->` |T|

0 commit comments

Comments
 (0)