Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 1 | // Copyright 2021 The Dawn & Tint Authors |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 2 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 3 | // Redistribution and use in source and binary forms, with or without |
| 4 | // modification, are permitted provided that the following conditions are met: |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 5 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 6 | // 1. Redistributions of source code must retain the above copyright notice, this |
| 7 | // list of conditions and the following disclaimer. |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 8 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 9 | // 2. Redistributions in binary form must reproduce the above copyright notice, |
| 10 | // this list of conditions and the following disclaimer in the documentation |
| 11 | // and/or other materials provided with the distribution. |
| 12 | // |
| 13 | // 3. Neither the name of the copyright holder nor the names of its |
| 14 | // contributors may be used to endorse or promote products derived from |
| 15 | // this software without specific prior written permission. |
| 16 | // |
| 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 24 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 27 | |
| 28 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | 62d9848 | 2023-09-21 10:31:23 +0000 | [diff] [blame] | 29 | // core builtin definition file // |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 30 | // // |
| 31 | // This file is used to generate parts of the Tint BuiltinTable, various // |
Ben Clayton | e435124 | 2024-02-21 08:11:33 +0000 | [diff] [blame] | 32 | // enum definition files. // |
David Neto | f72919f | 2023-09-14 16:52:23 +0000 | [diff] [blame] | 33 | // // |
| 34 | // After modifying this file, run: // |
| 35 | // tools/run gen // |
| 36 | // from the Dawn source directory. // |
Ben Clayton | e435124 | 2024-02-21 08:11:33 +0000 | [diff] [blame] | 37 | // // |
| 38 | // See docs/tint/intrinsic_definition_files.md for syntax // |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 39 | //////////////////////////////////////////////////////////////////////////////// |
| 40 | |
Ben Clayton | 62d9848 | 2023-09-21 10:31:23 +0000 | [diff] [blame] | 41 | import "src/tint/lang/core/address_space.def" |
| 42 | import "src/tint/lang/core/access.def" |
dan sinclair | 23fa64f | 2024-08-19 22:50:10 +0000 | [diff] [blame] | 43 | import "src/tint/lang/core/subgroup_matrix_kind.def" |
Ben Clayton | 62d9848 | 2023-09-21 10:31:23 +0000 | [diff] [blame] | 44 | import "src/tint/lang/core/texel_format.def" |
| 45 | |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 46 | //////////////////////////////////////////////////////////////////////////////// |
| 47 | // Enumerators // |
| 48 | //////////////////////////////////////////////////////////////////////////////// |
| 49 | |
Jiawei Shao | 1eca38f | 2024-08-13 02:20:18 +0000 | [diff] [blame] | 50 | // https://www.w3.org/TR/WGSL/#builtin-inputs-outputs |
Ben Clayton | fe8e6ee | 2022-07-27 22:21:30 +0000 | [diff] [blame] | 51 | enum builtin_value { |
| 52 | position |
| 53 | vertex_index |
| 54 | instance_index |
| 55 | front_facing |
| 56 | frag_depth |
| 57 | local_invocation_id |
| 58 | local_invocation_index |
| 59 | global_invocation_id |
| 60 | workgroup_id |
| 61 | num_workgroups |
| 62 | sample_index |
| 63 | sample_mask |
Jiawei Shao | 2918c42 | 2024-08-15 00:55:19 +0000 | [diff] [blame] | 64 | clip_distances |
James Price | ae32ef4 | 2023-08-01 15:01:32 +0000 | [diff] [blame] | 65 | subgroup_invocation_id |
| 66 | subgroup_size |
Ben Clayton | 4d3ff97 | 2023-02-21 17:33:54 +0000 | [diff] [blame] | 67 | __point_size |
Ben Clayton | fe8e6ee | 2022-07-27 22:21:30 +0000 | [diff] [blame] | 68 | } |
| 69 | |
Ben Clayton | f9ed9d3 | 2022-10-11 19:49:17 +0000 | [diff] [blame] | 70 | // https://www.w3.org/TR/WGSL/#interpolation |
| 71 | enum interpolation_type { |
| 72 | perspective |
| 73 | linear |
| 74 | flat |
| 75 | } |
| 76 | |
| 77 | // https://www.w3.org/TR/WGSL/#interpolation |
| 78 | enum interpolation_sampling { |
| 79 | center |
| 80 | centroid |
| 81 | sample |
Gregg Tavares | d015151 | 2024-07-11 23:12:44 +0000 | [diff] [blame] | 82 | first |
| 83 | either |
Ben Clayton | f9ed9d3 | 2022-10-11 19:49:17 +0000 | [diff] [blame] | 84 | } |
| 85 | |
Ben Clayton | ad733018 | 2023-02-07 13:35:58 +0000 | [diff] [blame] | 86 | enum builtin_type { |
Ben Clayton | 6e0a515 | 2023-02-09 23:33:24 +0000 | [diff] [blame] | 87 | // https://www.w3.org/TR/WGSL/#scalar-types |
| 88 | bool |
| 89 | f16 |
| 90 | f32 |
| 91 | i32 |
| 92 | u32 |
Ben Clayton | 0335c7d | 2022-12-14 11:55:58 +0000 | [diff] [blame] | 93 | // https://www.w3.org/TR/WGSL/#matrix-types |
Ben Clayton | 971318f | 2023-02-14 13:52:43 +0000 | [diff] [blame] | 94 | mat2x2 |
| 95 | mat2x3 |
| 96 | mat2x4 |
| 97 | mat3x2 |
| 98 | mat3x3 |
| 99 | mat3x4 |
| 100 | mat4x2 |
| 101 | mat4x3 |
| 102 | mat4x4 |
Ben Clayton | 0335c7d | 2022-12-14 11:55:58 +0000 | [diff] [blame] | 103 | mat2x2f |
| 104 | mat2x2h |
| 105 | mat2x3f |
| 106 | mat2x3h |
| 107 | mat2x4f |
| 108 | mat2x4h |
| 109 | mat3x2f |
| 110 | mat3x2h |
| 111 | mat3x3f |
| 112 | mat3x3h |
| 113 | mat3x4f |
| 114 | mat3x4h |
| 115 | mat4x2f |
| 116 | mat4x2h |
| 117 | mat4x3f |
| 118 | mat4x3h |
| 119 | mat4x4f |
| 120 | mat4x4h |
| 121 | // https://www.w3.org/TR/WGSL/#vector-types |
Ben Clayton | 971318f | 2023-02-14 13:52:43 +0000 | [diff] [blame] | 122 | vec2 |
| 123 | vec3 |
| 124 | vec4 |
Ben Clayton | d5d207b | 2022-12-01 13:41:56 +0000 | [diff] [blame] | 125 | vec2f |
| 126 | vec2h |
| 127 | vec2i |
| 128 | vec2u |
| 129 | vec3f |
| 130 | vec3h |
| 131 | vec3i |
| 132 | vec3u |
| 133 | vec4f |
| 134 | vec4h |
| 135 | vec4i |
| 136 | vec4u |
Ben Clayton | 971318f | 2023-02-14 13:52:43 +0000 | [diff] [blame] | 137 | // https://www.w3.org/TR/WGSL/#array-types |
| 138 | array |
| 139 | // https://www.w3.org/TR/WGSL/#atomic-types |
| 140 | atomic |
| 141 | // https://www.w3.org/TR/WGSL/#ref-ptr-types |
| 142 | ptr |
Ben Clayton | ed3389f | 2023-02-09 23:56:42 +0000 | [diff] [blame] | 143 | // https://www.w3.org/TR/WGSL/#sampler-type |
| 144 | sampler |
| 145 | sampler_comparison |
Ben Clayton | a5fec20 | 2023-02-10 02:34:21 +0000 | [diff] [blame] | 146 | // https://www.w3.org/TR/WGSL/#texture-depth |
| 147 | texture_depth_2d |
| 148 | texture_depth_2d_array |
| 149 | texture_depth_cube |
| 150 | texture_depth_cube_array |
| 151 | texture_depth_multisampled_2d |
Ben Clayton | 971318f | 2023-02-14 13:52:43 +0000 | [diff] [blame] | 152 | // https://www.w3.org/TR/WGSL/#sampled-texture-type |
| 153 | texture_1d |
| 154 | texture_2d |
| 155 | texture_2d_array |
| 156 | texture_3d |
| 157 | texture_cube |
| 158 | texture_cube_array |
| 159 | // https://www.w3.org/TR/WGSL/#multisampled-texture-type |
| 160 | texture_multisampled_2d |
Ben Clayton | 1131d31 | 2023-02-10 19:24:24 +0000 | [diff] [blame] | 161 | // https://www.w3.org/TR/WGSL/#texture-storage |
| 162 | texture_storage_1d |
| 163 | texture_storage_2d |
| 164 | texture_storage_2d_array |
| 165 | texture_storage_3d |
Ben Clayton | 4906b03 | 2023-02-09 23:59:07 +0000 | [diff] [blame] | 166 | // https://www.w3.org/TR/WGSL/#external-texture-type |
| 167 | texture_external |
Le Hoang Quyen | e4e4613 | 2024-05-23 22:28:18 +0000 | [diff] [blame] | 168 | // chromium_internal_input_attachments |
| 169 | input_attachment |
James Price | 4d3af66 | 2023-02-27 20:21:03 +0000 | [diff] [blame] | 170 | |
| 171 | // Internal types. |
Ben Clayton | 9073b75 | 2024-02-09 21:23:02 +0000 | [diff] [blame] | 172 | __packed_vec3 // note: not core type, but used by legacy MSL writer |
Ben Clayton | 47dd301 | 2023-04-26 18:27:53 +0000 | [diff] [blame] | 173 | __atomic_compare_exchange_result_i32 |
| 174 | __atomic_compare_exchange_result_u32 |
| 175 | __frexp_result_abstract |
| 176 | __frexp_result_f16 |
| 177 | __frexp_result_f32 |
| 178 | __frexp_result_vec2_abstract |
| 179 | __frexp_result_vec2_f16 |
| 180 | __frexp_result_vec2_f32 |
| 181 | __frexp_result_vec3_abstract |
| 182 | __frexp_result_vec3_f16 |
| 183 | __frexp_result_vec3_f32 |
| 184 | __frexp_result_vec4_abstract |
| 185 | __frexp_result_vec4_f16 |
| 186 | __frexp_result_vec4_f32 |
| 187 | __modf_result_abstract |
| 188 | __modf_result_f16 |
| 189 | __modf_result_f32 |
| 190 | __modf_result_vec2_abstract |
| 191 | __modf_result_vec2_f16 |
| 192 | __modf_result_vec2_f32 |
| 193 | __modf_result_vec3_abstract |
| 194 | __modf_result_vec3_f16 |
| 195 | __modf_result_vec3_f32 |
| 196 | __modf_result_vec4_abstract |
| 197 | __modf_result_vec4_f16 |
| 198 | __modf_result_vec4_f32 |
Ben Clayton | d5d207b | 2022-12-01 13:41:56 +0000 | [diff] [blame] | 199 | } |
| 200 | |
dan sinclair | 077d97a | 2023-02-23 19:08:57 +0000 | [diff] [blame] | 201 | // https://gpuweb.github.io/gpuweb/wgsl/#attributes |
| 202 | // Notes: |
| 203 | // * `diagnostic` is listed, even though it is a keyword, so it appears in suggested alternatives |
| 204 | // * `const` is not listed here as it can not be written in user programs and should not show up |
| 205 | // in error messages |
| 206 | enum attribute { |
| 207 | align |
| 208 | binding |
Corentin Wallez | dfb4eb0 | 2024-01-30 12:06:13 +0000 | [diff] [blame] | 209 | blend_src |
dan sinclair | 077d97a | 2023-02-23 19:08:57 +0000 | [diff] [blame] | 210 | builtin |
| 211 | compute |
| 212 | diagnostic |
| 213 | fragment |
| 214 | group |
| 215 | id |
| 216 | interpolate |
| 217 | invariant |
| 218 | location |
| 219 | must_use |
| 220 | size |
| 221 | vertex |
| 222 | workgroup_size |
Ben Clayton | c36093e | 2023-11-10 09:46:24 +0000 | [diff] [blame] | 223 | |
| 224 | // framebuffer-fetch input |
| 225 | color |
Le Hoang Quyen | 59eb7f3 | 2024-05-23 15:44:53 +0000 | [diff] [blame] | 226 | |
| 227 | // chromium_internal_input_attachments |
| 228 | input_attachment_index |
dan sinclair | 077d97a | 2023-02-23 19:08:57 +0000 | [diff] [blame] | 229 | } |
| 230 | |
dan sinclair | 1688de0 | 2024-07-18 20:04:21 +0000 | [diff] [blame] | 231 | // These are parameter usages which show up in other def files but not in core.def. |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 232 | enum usages { |
dan sinclair | 5bc6476 | 2024-09-18 04:34:52 +0000 | [diff] [blame] | 233 | base |
dan sinclair | dd143d2 | 2024-09-18 04:34:45 +0000 | [diff] [blame] | 234 | bits |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 235 | depth |
dan sinclair | e09d97e | 2024-07-18 03:38:32 +0000 | [diff] [blame] | 236 | compare_value |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 237 | elements |
dan sinclair | a108e6f | 2024-07-12 18:22:35 +0000 | [diff] [blame] | 238 | height |
dan sinclair | 5bc6476 | 2024-09-18 04:34:52 +0000 | [diff] [blame] | 239 | insert |
dan sinclair | 249a21a | 2024-08-01 01:52:08 +0000 | [diff] [blame] | 240 | level |
dan sinclair | e09d97e | 2024-07-18 03:38:32 +0000 | [diff] [blame] | 241 | location |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 242 | num_levels |
dan sinclair | e09d97e | 2024-07-18 03:38:32 +0000 | [diff] [blame] | 243 | original_value |
dan sinclair | a108e6f | 2024-07-12 18:22:35 +0000 | [diff] [blame] | 244 | samples |
| 245 | width |
dan sinclair | 6bbb5d4 | 2024-07-11 16:12:10 +0000 | [diff] [blame] | 246 | } |
| 247 | |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 248 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | e435124 | 2024-02-21 08:11:33 +0000 | [diff] [blame] | 249 | // Primitive types // |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 250 | //////////////////////////////////////////////////////////////////////////////// |
| 251 | |
| 252 | // https://gpuweb.github.io/gpuweb/wgsl/#plain-types-section |
| 253 | type bool |
dan sinclair | 23fa64f | 2024-08-19 22:50:10 +0000 | [diff] [blame] | 254 | type i8 |
| 255 | type u8 |
Zhaoming Jiang | 6058882 | 2022-06-28 14:03:36 +0000 | [diff] [blame] | 256 | @precedence(3) type i32 |
| 257 | @precedence(2) type u32 |
| 258 | @precedence(1) type f32 |
| 259 | @precedence(0) type f16 |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 260 | type vec2<T> |
| 261 | type vec3<T> |
| 262 | type vec4<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 263 | type mat2x2<T> |
| 264 | type mat2x3<T> |
| 265 | type mat2x4<T> |
| 266 | type mat3x2<T> |
| 267 | type mat3x3<T> |
| 268 | type mat3x4<T> |
| 269 | type mat4x2<T> |
| 270 | type mat4x3<T> |
| 271 | type mat4x4<T> |
Ben Clayton | e3e91c0 | 2022-06-01 20:44:50 +0000 | [diff] [blame] | 272 | @display("vec{N}<{T}>") type vec<N: num, T> |
| 273 | @display("mat{N}x{M}<{T}>") type mat<N: num, M: num, T> |
dan sinclair | ff7cf21 | 2022-10-03 14:05:23 +0000 | [diff] [blame] | 274 | type ptr<S: address_space, T, A: access> |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 275 | type atomic<T> |
| 276 | type array<T> |
| 277 | type sampler |
| 278 | type sampler_comparison |
| 279 | type texture_1d<T> |
| 280 | type texture_2d<T> |
| 281 | type texture_2d_array<T> |
| 282 | type texture_3d<T> |
| 283 | type texture_cube<T> |
| 284 | type texture_cube_array<T> |
| 285 | type texture_multisampled_2d<T> |
| 286 | type texture_depth_2d |
| 287 | type texture_depth_2d_array |
| 288 | type texture_depth_cube |
| 289 | type texture_depth_cube_array |
| 290 | type texture_depth_multisampled_2d |
| 291 | type texture_storage_1d<F: texel_format, A: access> |
| 292 | type texture_storage_2d<F: texel_format, A: access> |
| 293 | type texture_storage_2d_array<F: texel_format, A: access> |
| 294 | type texture_storage_3d<F: texel_format, A: access> |
| 295 | type texture_external |
Le Hoang Quyen | c224131 | 2024-05-28 18:29:28 +0000 | [diff] [blame] | 296 | type input_attachment<T> |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 297 | |
Zhaoming Jiang | 20cddbf | 2022-08-05 15:11:44 +0000 | [diff] [blame] | 298 | @display("__modf_result_{T}") type __modf_result<T> |
| 299 | @display("__modf_result_vec{N}_{T}") type __modf_result_vec<N: num, T> |
| 300 | @display("__frexp_result_{T}") type __frexp_result<T> |
| 301 | @display("__frexp_result_vec{N}_{T}") type __frexp_result_vec<N: num, T> |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 302 | |
Antonio Maiorano | 08f4b55 | 2022-05-31 13:20:28 +0000 | [diff] [blame] | 303 | type __atomic_compare_exchange_result<T> |
| 304 | |
dan sinclair | 23fa64f | 2024-08-19 22:50:10 +0000 | [diff] [blame] | 305 | type subgroup_matrix<S: subgroup_matrix_kind, T, M: num, K: num> |
| 306 | |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 307 | //////////////////////////////////////////////////////////////////////////////// |
| 308 | // Type matchers // |
| 309 | // // |
| 310 | // A type matcher that can match one or more types. // |
| 311 | //////////////////////////////////////////////////////////////////////////////// |
| 312 | |
Ben Clayton | 9073b75 | 2024-02-09 21:23:02 +0000 | [diff] [blame] | 313 | match scalar: f32 | f16 | i32 | u32 | bool |
| 314 | match scalar_no_f32: i32 | f16 | u32 | bool |
| 315 | match scalar_no_f16: f32 | i32 | u32 | bool |
| 316 | match scalar_no_i32: f32 | f16 | u32 | bool |
| 317 | match scalar_no_u32: f32 | f16 | i32 | bool |
| 318 | match scalar_no_bool: f32 | f16 | i32 | u32 |
Zhaoming Jiang | 1e98a9b | 2022-07-21 19:55:35 +0000 | [diff] [blame] | 319 | match fiu32_f16: f32 | i32 | u32 | f16 |
| 320 | match fiu32: f32 | i32 | u32 |
| 321 | match fi32_f16: f32 | i32 | f16 |
| 322 | match fi32: f32 | i32 |
| 323 | match f32_f16: f32 | f16 |
| 324 | match iu32: i32 | u32 |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 325 | |
dan sinclair | 23fa64f | 2024-08-19 22:50:10 +0000 | [diff] [blame] | 326 | match subgroup_matrix_elements: f32 | f16 | u32 | i32 | u8 | i8 |
| 327 | match subgroup_matrix_kind_left : subgroup_matrix_kind.left |
| 328 | match subgroup_matrix_kind_right : subgroup_matrix_kind.right |
| 329 | match subgroup_matrix_kind_result : subgroup_matrix_kind.result |
| 330 | |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 331 | //////////////////////////////////////////////////////////////////////////////// |
| 332 | // Enum matchers // |
| 333 | // // |
| 334 | // A number matcher that can match one or more enumerator values. // |
| 335 | // All enumerator values listed in the match declaration need to be from the // |
| 336 | // same enum. // |
| 337 | //////////////////////////////////////////////////////////////////////////////// |
| 338 | |
| 339 | // https://gpuweb.github.io/gpuweb/wgsl/#texel-formats |
Ben Clayton | c768e64 | 2022-07-26 17:49:54 +0000 | [diff] [blame] | 340 | match f32_texel_format |
Ben Clayton | 448c01b | 2024-02-28 00:23:17 +0000 | [diff] [blame] | 341 | : texel_format.r8unorm |
| 342 | | texel_format.bgra8unorm |
Ben Clayton | d03dcee | 2023-01-18 19:42:03 +0000 | [diff] [blame] | 343 | | texel_format.rgba8unorm |
Ben Clayton | c768e64 | 2022-07-26 17:49:54 +0000 | [diff] [blame] | 344 | | texel_format.rgba8snorm |
| 345 | | texel_format.rgba16float |
| 346 | | texel_format.r32float |
| 347 | | texel_format.rg32float |
| 348 | | texel_format.rgba32float |
| 349 | match i32_texel_format |
| 350 | : texel_format.rgba8sint |
| 351 | | texel_format.rgba16sint |
| 352 | | texel_format.r32sint |
| 353 | | texel_format.rg32sint |
| 354 | | texel_format.rgba32sint |
| 355 | match u32_texel_format |
| 356 | : texel_format.rgba8uint |
| 357 | | texel_format.rgba16uint |
| 358 | | texel_format.r32uint |
| 359 | | texel_format.rg32uint |
| 360 | | texel_format.rgba32uint |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 361 | |
Ben Clayton | c768e64 | 2022-07-26 17:49:54 +0000 | [diff] [blame] | 362 | match write: access.write |
| 363 | match read_write: access.read_write |
James Price | 88c231b | 2023-08-15 12:47:28 +0000 | [diff] [blame] | 364 | match readable |
| 365 | : access.read |
| 366 | | access.read_write |
James Price | 807f3ef | 2023-08-11 00:45:54 +0000 | [diff] [blame] | 367 | match writable |
| 368 | : access.write |
| 369 | | access.read_write |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 370 | |
Ben Clayton | c768e64 | 2022-07-26 17:49:54 +0000 | [diff] [blame] | 371 | match function_private_workgroup |
dan sinclair | ff7cf21 | 2022-10-03 14:05:23 +0000 | [diff] [blame] | 372 | : address_space.function |
| 373 | | address_space.private |
| 374 | | address_space.workgroup |
Ben Clayton | c768e64 | 2022-07-26 17:49:54 +0000 | [diff] [blame] | 375 | match workgroup_or_storage |
dan sinclair | ff7cf21 | 2022-10-03 14:05:23 +0000 | [diff] [blame] | 376 | : address_space.workgroup |
| 377 | | address_space.storage |
Ben Clayton | c768e64 | 2022-07-26 17:49:54 +0000 | [diff] [blame] | 378 | match storage |
dan sinclair | ff7cf21 | 2022-10-03 14:05:23 +0000 | [diff] [blame] | 379 | : address_space.storage |
James Price | 128980f | 2023-01-06 02:25:06 +0000 | [diff] [blame] | 380 | match workgroup |
| 381 | : address_space.workgroup |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 382 | |
| 383 | //////////////////////////////////////////////////////////////////////////////// |
| 384 | // Builtin Functions // |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 385 | //////////////////////////////////////////////////////////////////////////////// |
| 386 | |
| 387 | // https://gpuweb.github.io/gpuweb/wgsl/#builtin-functions |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 388 | @must_use @const implicit(T: fiu32_f16) fn abs(T) -> T |
| 389 | @must_use @const implicit(N: num, T: fiu32_f16) fn abs(vec<N, T>) -> vec<N, T> |
| 390 | @must_use @const implicit(T: f32_f16) fn acos(@test_value(0.96891242171) T) -> T |
| 391 | @must_use @const implicit(N: num, T: f32_f16) fn acos(@test_value(0.96891242171) vec<N, T>) -> vec<N, T> |
| 392 | @must_use @const implicit(T: f32_f16) fn acosh(@test_value(1.5430806348) T) -> T |
| 393 | @must_use @const implicit(N: num, T: f32_f16) fn acosh(@test_value(1.5430806348) vec<N, T>) -> vec<N, T> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 394 | @must_use @const fn all(bool) -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 395 | @must_use @const implicit(N: num) fn all(vec<N, bool>) -> bool |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 396 | @must_use @const fn any(bool) -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 397 | @must_use @const implicit(N: num) fn any(vec<N, bool>) -> bool |
| 398 | @must_use implicit(T, A: access) fn arrayLength(ptr<storage, array<T>, A>) -> u32 |
| 399 | @must_use @const implicit(T: f32_f16) fn asin(@test_value(0.479425538604) T) -> T |
| 400 | @must_use @const implicit(N: num, T: f32_f16) fn asin(@test_value(0.479425538604) vec<N, T>) -> vec<N, T> |
| 401 | @must_use @const implicit(T: f32_f16) fn asinh(T) -> T |
| 402 | @must_use @const implicit(N: num, T: f32_f16) fn asinh(vec<N, T>) -> vec<N, T> |
| 403 | @must_use @const implicit(T: f32_f16) fn atan(T) -> T |
| 404 | @must_use @const implicit(N: num, T: f32_f16) fn atan(vec<N, T>) -> vec<N, T> |
| 405 | @must_use @const implicit(T: f32_f16) fn atan2(T, T) -> T |
| 406 | @must_use @const implicit(T: f32_f16, N: num) fn atan2(vec<N, T>, vec<N, T>) -> vec<N, T> |
| 407 | @must_use @const implicit(T: f32_f16) fn atanh(@test_value(0.5) T) -> T |
| 408 | @must_use @const implicit(N: num, T: f32_f16) fn atanh(@test_value(0.5) vec<N, T>) -> vec<N, T> |
| 409 | @must_use @const implicit(T: f32_f16) fn ceil(@test_value(1.5) T) -> T |
| 410 | @must_use @const implicit(N: num, T: f32_f16) fn ceil(@test_value(1.5) vec<N, T>) -> vec<N, T> |
| 411 | @must_use @const implicit(T: fiu32_f16) fn clamp(T, T, T) -> T |
| 412 | @must_use @const implicit(T: fiu32_f16, N: num) fn clamp(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> |
| 413 | @must_use @const implicit(T: f32_f16) fn cos(@test_value(0) T) -> T |
| 414 | @must_use @const implicit(N: num, T: f32_f16) fn cos(@test_value(0) vec<N, T>) -> vec<N, T> |
| 415 | @must_use @const implicit(T: f32_f16) fn cosh(@test_value(0) T) -> T |
| 416 | @must_use @const implicit(N: num, T: f32_f16) fn cosh(@test_value(0) vec<N, T>) -> vec<N, T> |
| 417 | @must_use @const implicit(T: iu32) fn countLeadingZeros(T) -> T |
| 418 | @must_use @const implicit(N: num, T: iu32) fn countLeadingZeros(vec<N, T>) -> vec<N, T> |
| 419 | @must_use @const implicit(T: iu32) fn countOneBits(T) -> T |
| 420 | @must_use @const implicit(N: num, T: iu32) fn countOneBits(vec<N, T>) -> vec<N, T> |
| 421 | @must_use @const implicit(T: iu32) fn countTrailingZeros(T) -> T |
| 422 | @must_use @const implicit(N: num, T: iu32) fn countTrailingZeros(vec<N, T>) -> vec<N, T> |
| 423 | @must_use @const implicit(T: f32_f16) fn cross(vec3<T>, vec3<T>) -> vec3<T> |
| 424 | @must_use @const implicit(T: f32_f16) fn degrees(T) -> T |
| 425 | @must_use @const implicit(N: num, T: f32_f16) fn degrees(vec<N, T>) -> vec<N, T> |
| 426 | @must_use @const implicit(N: num, T: f32_f16) fn determinant(mat<N, N, T>) -> T |
| 427 | @must_use @const implicit(T: f32_f16) fn distance(T, T) -> T |
| 428 | @must_use @const implicit(N: num, T: f32_f16) fn distance(vec<N, T>, vec<N, T>) -> T |
| 429 | @must_use @const implicit(N: num, T: fiu32_f16) fn dot(vec<N, T>, vec<N, T>) -> T |
dan sinclair | 82ac0fd | 2024-03-20 20:43:24 +0000 | [diff] [blame] | 430 | @must_use @const fn dot4I8Packed(u32, u32) -> i32 |
| 431 | @must_use @const fn dot4U8Packed(u32, u32) -> u32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 432 | @must_use @stage("fragment") fn dpdx(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 433 | @must_use @stage("fragment") implicit(N: num) fn dpdx(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 434 | @must_use @stage("fragment") fn dpdxCoarse(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 435 | @must_use @stage("fragment") implicit(N: num) fn dpdxCoarse(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 436 | @must_use @stage("fragment") fn dpdxFine(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 437 | @must_use @stage("fragment") implicit(N: num) fn dpdxFine(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 438 | @must_use @stage("fragment") fn dpdy(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 439 | @must_use @stage("fragment") implicit(N: num) fn dpdy(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 440 | @must_use @stage("fragment") fn dpdyCoarse(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 441 | @must_use @stage("fragment") implicit(N: num) fn dpdyCoarse(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 442 | @must_use @stage("fragment") fn dpdyFine(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 443 | @must_use @stage("fragment") implicit(N: num) fn dpdyFine(vec<N, f32>) -> vec<N, f32> |
| 444 | @must_use @const implicit(T: f32_f16) fn exp(T) -> T |
| 445 | @must_use @const implicit(N: num, T: f32_f16) fn exp(vec<N, T>) -> vec<N, T> |
| 446 | @must_use @const implicit(T: f32_f16) fn exp2(T) -> T |
| 447 | @must_use @const implicit(N: num, T: f32_f16) fn exp2(vec<N, T>) -> vec<N, T> |
| 448 | @must_use @const implicit(T: iu32) fn extractBits(T, u32, u32) -> T |
| 449 | @must_use @const implicit(N: num, T: iu32) fn extractBits(vec<N, T>, u32, u32) -> vec<N, T> |
| 450 | @must_use @const implicit(N: num, T: f32_f16) fn faceForward(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> |
| 451 | @must_use @const implicit(T: iu32) fn firstLeadingBit(T) -> T |
| 452 | @must_use @const implicit(N: num, T: iu32) fn firstLeadingBit(vec<N, T>) -> vec<N, T> |
| 453 | @must_use @const implicit(T: iu32) fn firstTrailingBit(T) -> T |
| 454 | @must_use @const implicit(N: num, T: iu32) fn firstTrailingBit(vec<N, T>) -> vec<N, T> |
| 455 | @must_use @const implicit(T: f32_f16) fn floor(@test_value(1.5) T) -> T |
| 456 | @must_use @const implicit(N: num, T: f32_f16) fn floor(@test_value(1.5) vec<N, T>) -> vec<N, T> |
| 457 | @must_use @const implicit(T: f32_f16) fn fma(T, T, T) -> T |
| 458 | @must_use @const implicit(N: num, T: f32_f16) fn fma(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> |
| 459 | @must_use @const implicit(T: f32_f16) fn fract(@test_value(1.25) T) -> T |
| 460 | @must_use @const implicit(N: num, T: f32_f16) fn fract(@test_value(1.25) vec<N, T>) -> vec<N, T> |
| 461 | @must_use @const implicit(T: f32_f16) fn frexp(T) -> __frexp_result<T> |
| 462 | @must_use @const implicit(N: num, T: f32_f16) fn frexp(vec<N, T>) -> __frexp_result_vec<N, T> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 463 | @must_use @stage("fragment") fn fwidth(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 464 | @must_use @stage("fragment") implicit(N: num) fn fwidth(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 465 | @must_use @stage("fragment") fn fwidthCoarse(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 466 | @must_use @stage("fragment") implicit(N: num) fn fwidthCoarse(vec<N, f32>) -> vec<N, f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 467 | @must_use @stage("fragment") fn fwidthFine(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 468 | @must_use @stage("fragment") implicit(N: num) fn fwidthFine(vec<N, f32>) -> vec<N, f32> |
| 469 | @must_use @const implicit(T: iu32) fn insertBits(T, T, u32, u32) -> T |
| 470 | @must_use @const implicit(N: num, T: iu32) fn insertBits(vec<N, T>, vec<N, T>, u32, u32) -> vec<N, T> |
| 471 | @must_use @const implicit(T: f32_f16) fn inverseSqrt(T) -> T |
| 472 | @must_use @const implicit(N: num, T: f32_f16) fn inverseSqrt(vec<N, T>) -> vec<N, T> |
| 473 | @must_use @const implicit(T: f32_f16, U: i32) fn ldexp(T, U) -> T |
| 474 | @must_use @const implicit(N: num, T: f32_f16, U: i32) fn ldexp(vec<N, T>, vec<N, U>) -> vec<N, T> |
| 475 | @must_use @const implicit(T: f32_f16) fn length(@test_value(0.0) T) -> T |
| 476 | @must_use @const implicit(N: num, T: f32_f16) fn length(@test_value(0.0) vec<N, T>) -> T |
| 477 | @must_use @const implicit(T: f32_f16) fn log(T) -> T |
| 478 | @must_use @const implicit(N: num, T: f32_f16) fn log(vec<N, T>) -> vec<N, T> |
| 479 | @must_use @const implicit(T: f32_f16) fn log2(T) -> T |
| 480 | @must_use @const implicit(N: num, T: f32_f16) fn log2(vec<N, T>) -> vec<N, T> |
| 481 | @must_use @const implicit(T: fiu32_f16) fn max(T, T) -> T |
| 482 | @must_use @const implicit(N: num, T: fiu32_f16) fn max(vec<N, T>, vec<N, T>) -> vec<N, T> |
| 483 | @must_use @const implicit(T: fiu32_f16) fn min(T, T) -> T |
| 484 | @must_use @const implicit(N: num, T: fiu32_f16) fn min(vec<N, T>, vec<N, T>) -> vec<N, T> |
| 485 | @must_use @const implicit(T: f32_f16) fn mix(T, T, T) -> T |
| 486 | @must_use @const implicit(N: num, T: f32_f16) fn mix(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T> |
| 487 | @must_use @const implicit(N: num, T: f32_f16) fn mix(vec<N, T>, vec<N, T>, T) -> vec<N, T> |
| 488 | @must_use @const implicit(T: f32_f16) fn modf(@test_value(-1.5) T) -> __modf_result<T> |
| 489 | @must_use @const implicit(N: num, T: f32_f16) fn modf(@test_value(-1.5) vec<N, T>) -> __modf_result_vec<N, T> |
| 490 | @must_use @const implicit(N: num, T: f32_f16) fn normalize(vec<N, T>) -> vec<N, T> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 491 | @must_use @const fn pack2x16float(vec2<f32>) -> u32 |
| 492 | @must_use @const fn pack2x16snorm(vec2<f32>) -> u32 |
| 493 | @must_use @const fn pack2x16unorm(vec2<f32>) -> u32 |
| 494 | @must_use @const fn pack4x8snorm(vec4<f32>) -> u32 |
| 495 | @must_use @const fn pack4x8unorm(vec4<f32>) -> u32 |
Jiawei Shao | c8ca47f | 2023-12-19 19:20:32 +0000 | [diff] [blame] | 496 | @must_use @const fn pack4xI8(vec4<i32>) -> u32 |
| 497 | @must_use @const fn pack4xU8(vec4<u32>) -> u32 |
Jiawei Shao | 0a40886 | 2024-01-05 03:14:11 +0000 | [diff] [blame] | 498 | @must_use @const fn pack4xI8Clamp(vec4<i32>) -> u32 |
| 499 | @must_use @const fn pack4xU8Clamp(vec4<u32>) -> u32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 500 | @must_use @const implicit(T: f32_f16) fn pow(T, T) -> T |
| 501 | @must_use @const implicit(N: num, T: f32_f16) fn pow(vec<N, T>, vec<N, T>) -> vec<N, T> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 502 | @must_use @const fn quantizeToF16(f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 503 | @must_use @const implicit(N: num) fn quantizeToF16(vec<N, f32>) -> vec<N, f32> |
| 504 | @must_use @const implicit(T: f32_f16) fn radians(T) -> T |
| 505 | @must_use @const implicit(N: num, T: f32_f16) fn radians(vec<N, T>) -> vec<N, T> |
| 506 | @must_use @const implicit(N: num, T: f32_f16) fn reflect(vec<N, T>, vec<N, T>) -> vec<N, T> |
| 507 | @must_use @const implicit(N: num, T: f32_f16) fn refract(vec<N, T>, vec<N, T>, T) -> vec<N, T> |
| 508 | @must_use @const implicit(T: iu32) fn reverseBits(T) -> T |
| 509 | @must_use @const implicit(N: num, T: iu32) fn reverseBits(vec<N, T>) -> vec<N, T> |
| 510 | @must_use @const implicit(T: f32_f16) fn round(@test_value(3.5) T) -> T |
| 511 | @must_use @const implicit(N: num, T: f32_f16) fn round(@test_value(3.5) vec<N, T>) -> vec<N, T> |
| 512 | @must_use @const implicit(T: f32_f16) fn saturate(@test_value(2) T) -> T |
| 513 | @must_use @const implicit(T: f32_f16, N: num) fn saturate(@test_value(2) vec<N, T>) -> vec<N, T> |
| 514 | @must_use @const("select_bool") implicit(T: scalar) fn select(T, T, bool) -> T |
| 515 | @must_use @const("select_bool") implicit(T: scalar, N: num) fn select(vec<N, T>, vec<N, T>, bool) -> vec<N, T> |
| 516 | @must_use @const("select_boolvec") implicit(N: num, T: scalar) fn select(vec<N, T>, vec<N, T>, vec<N, bool>) -> vec<N, T> |
| 517 | @must_use @const implicit(T: fi32_f16) fn sign(T) -> T |
| 518 | @must_use @const implicit(N: num, T: fi32_f16) fn sign(vec<N, T>) -> vec<N, T> |
| 519 | @must_use @const implicit(T: f32_f16) fn sin(@test_value(1.57079632679) T) -> T |
| 520 | @must_use @const implicit(N: num, T: f32_f16) fn sin(@test_value(1.57079632679) vec<N, T>) -> vec<N, T> |
| 521 | @must_use @const implicit(T: f32_f16) fn sinh(T) -> T |
| 522 | @must_use @const implicit(N: num, T: f32_f16) fn sinh(vec<N, T>) -> vec<N, T> |
| 523 | @must_use @const implicit(T: f32_f16) fn smoothstep(@test_value(2) T, @test_value(4) T, @test_value(3) T) -> T |
| 524 | @must_use @const implicit(N: num, T: f32_f16) fn smoothstep(@test_value(2) vec<N, T>, @test_value(4) vec<N, T>, @test_value(3) vec<N, T>) -> vec<N, T> |
| 525 | @must_use @const implicit(T: f32_f16) fn sqrt(T) -> T |
| 526 | @must_use @const implicit(N: num, T: f32_f16) fn sqrt(vec<N, T>) -> vec<N, T> |
| 527 | @must_use @const implicit(T: f32_f16) fn step(T, T) -> T |
| 528 | @must_use @const implicit(N: num, T: f32_f16) fn step(vec<N, T>, vec<N, T>) -> vec<N, T> |
Ben Clayton | e3e91c0 | 2022-06-01 20:44:50 +0000 | [diff] [blame] | 529 | @stage("compute") fn storageBarrier() |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 530 | @must_use @const implicit(T: f32_f16) fn tan(T) -> T |
| 531 | @must_use @const implicit(N: num, T: f32_f16) fn tan(vec<N, T>) -> vec<N, T> |
| 532 | @must_use @const implicit(T: f32_f16) fn tanh(T) -> T |
| 533 | @must_use @const implicit(N: num, T: f32_f16) fn tanh(vec<N, T>) -> vec<N, T> |
| 534 | @must_use @const implicit(M: num, N: num, T: f32_f16) fn transpose(mat<M, N, T>) -> mat<N, M, T> |
| 535 | @must_use @const implicit(T: f32_f16) fn trunc(@test_value(1.5) T) -> T |
| 536 | @must_use @const implicit(N: num, T: f32_f16) fn trunc(@test_value(1.5) vec<N, T>) -> vec<N, T> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 537 | @must_use @const fn unpack2x16float(u32) -> vec2<f32> |
| 538 | @must_use @const fn unpack2x16snorm(u32) -> vec2<f32> |
| 539 | @must_use @const fn unpack2x16unorm(u32) -> vec2<f32> |
| 540 | @must_use @const fn unpack4x8snorm(u32) -> vec4<f32> |
| 541 | @must_use @const fn unpack4x8unorm(u32) -> vec4<f32> |
Jiawei Shao | 0a40886 | 2024-01-05 03:14:11 +0000 | [diff] [blame] | 542 | @must_use @const fn unpack4xI8(u32) -> vec4<i32> |
| 543 | @must_use @const fn unpack4xU8(u32) -> vec4<u32> |
Ben Clayton | e3e91c0 | 2022-06-01 20:44:50 +0000 | [diff] [blame] | 544 | @stage("compute") fn workgroupBarrier() |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 545 | |
James Price | 79f4a07 | 2023-08-11 00:45:54 +0000 | [diff] [blame] | 546 | @stage("compute") fn textureBarrier() |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 547 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_1d<T>) -> u32 |
| 548 | @must_use implicit(T: fiu32, L: iu32) fn textureDimensions(texture: texture_1d<T>, level: L) -> u32 |
| 549 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_2d<T>) -> vec2<u32> |
| 550 | @must_use implicit(T: fiu32, L: iu32) fn textureDimensions(texture: texture_2d<T>, level: L) -> vec2<u32> |
| 551 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_2d_array<T>) -> vec2<u32> |
| 552 | @must_use implicit(T: fiu32, L: iu32) fn textureDimensions(texture: texture_2d_array<T>, level: L) -> vec2<u32> |
| 553 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_3d<T>) -> vec3<u32> |
| 554 | @must_use implicit(T: fiu32, L: iu32) fn textureDimensions(texture: texture_3d<T>, level: L) -> vec3<u32> |
| 555 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_cube<T>) -> vec2<u32> |
| 556 | @must_use implicit(T: fiu32, L: iu32) fn textureDimensions(texture: texture_cube<T>, level: L) -> vec2<u32> |
| 557 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_cube_array<T>) -> vec2<u32> |
| 558 | @must_use implicit(T: fiu32, L: iu32) fn textureDimensions(texture: texture_cube_array<T>, level: L) -> vec2<u32> |
| 559 | @must_use implicit(T: fiu32) fn textureDimensions(texture: texture_multisampled_2d<T>) -> vec2<u32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 560 | @must_use fn textureDimensions(texture: texture_depth_2d) -> vec2<u32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 561 | @must_use implicit(L: iu32) fn textureDimensions(texture: texture_depth_2d, level: L) -> vec2<u32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 562 | @must_use fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 563 | @must_use implicit(L: iu32) fn textureDimensions(texture: texture_depth_2d_array, level: L) -> vec2<u32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 564 | @must_use fn textureDimensions(texture: texture_depth_cube) -> vec2<u32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 565 | @must_use implicit(L: iu32) fn textureDimensions(texture: texture_depth_cube, level: L) -> vec2<u32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 566 | @must_use fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 567 | @must_use implicit(L: iu32) fn textureDimensions(texture: texture_depth_cube_array, level: L) -> vec2<u32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 568 | @must_use fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 569 | @must_use implicit(F: texel_format, A: access) fn textureDimensions(texture: texture_storage_1d<F, A>) -> u32 |
| 570 | @must_use implicit(F: texel_format, A: access) fn textureDimensions(texture: texture_storage_2d<F, A>) -> vec2<u32> |
| 571 | @must_use implicit(F: texel_format, A: access) fn textureDimensions(texture: texture_storage_2d_array<F, A>) -> vec2<u32> |
| 572 | @must_use implicit(F: texel_format, A: access) fn textureDimensions(texture: texture_storage_3d<F, A>) -> vec3<u32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 573 | @must_use fn textureDimensions(texture: texture_external) -> vec2<u32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 574 | @must_use implicit(T: fiu32, C: iu32) fn textureGather(@const component: C, texture: texture_2d<T>, sampler: sampler, coords: vec2<f32>) -> vec4<T> |
| 575 | @must_use implicit(T: fiu32, C: iu32) fn textureGather(@const component: C, texture: texture_2d<T>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<T> |
| 576 | @must_use implicit(T: fiu32, C: iu32, A: iu32) fn textureGather(@const component: C, texture: texture_2d_array<T>, sampler: sampler, coords: vec2<f32>, array_index: A) -> vec4<T> |
| 577 | @must_use implicit(T: fiu32, C: iu32, A: iu32) fn textureGather(@const component: C, texture: texture_2d_array<T>, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> vec4<T> |
| 578 | @must_use implicit(T: fiu32, C: iu32) fn textureGather(@const component: C, texture: texture_cube<T>, sampler: sampler, coords: vec3<f32>) -> vec4<T> |
| 579 | @must_use implicit(T: fiu32, C: iu32, A: iu32) fn textureGather(@const component: C, texture: texture_cube_array<T>, sampler: sampler, coords: vec3<f32>, array_index: A) -> vec4<T> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 580 | @must_use fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>) -> vec4<f32> |
| 581 | @must_use fn textureGather(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 582 | @must_use implicit(A: iu32) fn textureGather(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A) -> vec4<f32> |
| 583 | @must_use implicit(A: iu32) fn textureGather(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 584 | @must_use fn textureGather(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 585 | @must_use implicit(A: iu32) fn textureGather(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 586 | @must_use fn textureGatherCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> vec4<f32> |
| 587 | @must_use fn textureGatherCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 588 | @must_use implicit(A: iu32) fn textureGatherCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32) -> vec4<f32> |
| 589 | @must_use implicit(A: iu32) fn textureGatherCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 590 | @must_use fn textureGatherCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 591 | @must_use implicit(A: iu32) fn textureGatherCompare(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: A, depth_ref: f32) -> vec4<f32> |
| 592 | @must_use implicit(T: fiu32) fn textureNumLayers(texture: texture_2d_array<T>) -> u32 |
| 593 | @must_use implicit(T: fiu32) fn textureNumLayers(texture: texture_cube_array<T>) -> u32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 594 | @must_use fn textureNumLayers(texture: texture_depth_2d_array) -> u32 |
Ben Clayton | 068eb3e | 2023-03-08 02:48:34 +0000 | [diff] [blame] | 595 | @must_use fn textureNumLayers(texture: texture_depth_cube_array) -> u32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 596 | @must_use implicit(F: texel_format, A: access) fn textureNumLayers(texture: texture_storage_2d_array<F, A>) -> u32 |
| 597 | @must_use implicit(T: fiu32) fn textureNumLevels(texture: texture_1d<T>) -> u32 |
| 598 | @must_use implicit(T: fiu32) fn textureNumLevels(texture: texture_2d<T>) -> u32 |
| 599 | @must_use implicit(T: fiu32) fn textureNumLevels(texture: texture_2d_array<T>) -> u32 |
| 600 | @must_use implicit(T: fiu32) fn textureNumLevels(texture: texture_3d<T>) -> u32 |
| 601 | @must_use implicit(T: fiu32) fn textureNumLevels(texture: texture_cube<T>) -> u32 |
| 602 | @must_use implicit(T: fiu32) fn textureNumLevels(texture: texture_cube_array<T>) -> u32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 603 | @must_use fn textureNumLevels(texture: texture_depth_2d) -> u32 |
| 604 | @must_use fn textureNumLevels(texture: texture_depth_2d_array) -> u32 |
| 605 | @must_use fn textureNumLevels(texture: texture_depth_cube) -> u32 |
| 606 | @must_use fn textureNumLevels(texture: texture_depth_cube_array) -> u32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 607 | @must_use implicit(T: fiu32) fn textureNumSamples(texture: texture_multisampled_2d<T>) -> u32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 608 | @must_use fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32 |
| 609 | @must_use @stage("fragment") fn textureSample(texture: texture_1d<f32>, sampler: sampler, coords: f32) -> vec4<f32> |
| 610 | @must_use @stage("fragment") fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32> |
| 611 | @must_use @stage("fragment") fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 612 | @must_use @stage("fragment") implicit(A: iu32) fn textureSample(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A) -> vec4<f32> |
| 613 | @must_use @stage("fragment") implicit(A: iu32) fn textureSample(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 614 | @must_use @stage("fragment") fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32> |
| 615 | @must_use @stage("fragment") fn textureSample(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32> |
| 616 | @must_use @stage("fragment") fn textureSample(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 617 | @must_use @stage("fragment") implicit(A: iu32) fn textureSample(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 618 | @must_use @stage("fragment") fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>) -> f32 |
| 619 | @must_use @stage("fragment") fn textureSample(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 620 | @must_use @stage("fragment") implicit(A: iu32) fn textureSample(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A) -> f32 |
| 621 | @must_use @stage("fragment") implicit(A: iu32) fn textureSample(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, @const offset: vec2<i32>) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 622 | @must_use @stage("fragment") fn textureSample(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 623 | @must_use @stage("fragment") implicit(A: iu32) fn textureSample(texture: texture_depth_cube_array, sampler: sampler, coords: vec3<f32>, array_index: A) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 624 | @must_use @stage("fragment") fn textureSampleBias(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, bias: f32) -> vec4<f32> |
| 625 | @must_use @stage("fragment") fn textureSampleBias(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, bias: f32, @const offset: vec2<i32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 626 | @must_use @stage("fragment") implicit(A: iu32) fn textureSampleBias(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, bias: f32) -> vec4<f32> |
| 627 | @must_use @stage("fragment") implicit(A: iu32) fn textureSampleBias(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, bias: f32, @const offset: vec2<i32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 628 | @must_use @stage("fragment") fn textureSampleBias(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, bias: f32) -> vec4<f32> |
| 629 | @must_use @stage("fragment") fn textureSampleBias(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, bias: f32, @const offset: vec3<i32>) -> vec4<f32> |
| 630 | @must_use @stage("fragment") fn textureSampleBias(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, bias: f32) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 631 | @must_use @stage("fragment") implicit(A: iu32) fn textureSampleBias(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, bias: f32) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 632 | @must_use @stage("fragment") fn textureSampleCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> f32 |
| 633 | @must_use @stage("fragment") fn textureSampleCompare(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 634 | @must_use @stage("fragment") implicit(A: iu32) fn textureSampleCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32) -> f32 |
| 635 | @must_use @stage("fragment") implicit(A: iu32) fn textureSampleCompare(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32, @const offset: vec2<i32>) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 636 | @must_use @stage("fragment") fn textureSampleCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 637 | @must_use @stage("fragment") implicit(A: iu32) fn textureSampleCompare(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: A, depth_ref: f32) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 638 | @must_use fn textureSampleCompareLevel(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32) -> f32 |
| 639 | @must_use fn textureSampleCompareLevel(texture: texture_depth_2d, sampler: sampler_comparison, coords: vec2<f32>, depth_ref: f32, @const offset: vec2<i32>) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 640 | @must_use implicit(A: iu32) fn textureSampleCompareLevel(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32) -> f32 |
| 641 | @must_use implicit(A: iu32) fn textureSampleCompareLevel(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: A, depth_ref: f32, @const offset: vec2<i32>) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 642 | @must_use fn textureSampleCompareLevel(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> f32 |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 643 | @must_use implicit(A: iu32) fn textureSampleCompareLevel(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: A, depth_ref: f32) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 644 | @must_use fn textureSampleGrad(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32> |
| 645 | @must_use fn textureSampleGrad(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 646 | @must_use implicit(A: iu32) fn textureSampleGrad(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, ddx: vec2<f32>, ddy: vec2<f32>) -> vec4<f32> |
| 647 | @must_use implicit(A: iu32) fn textureSampleGrad(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, ddx: vec2<f32>, ddy: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 648 | @must_use fn textureSampleGrad(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32> |
| 649 | @must_use fn textureSampleGrad(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>, @const offset: vec3<i32>) -> vec4<f32> |
| 650 | @must_use fn textureSampleGrad(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 651 | @must_use implicit(A: iu32) fn textureSampleGrad(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, ddx: vec3<f32>, ddy: vec3<f32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 652 | @must_use fn textureSampleLevel(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: f32) -> vec4<f32> |
| 653 | @must_use fn textureSampleLevel(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, level: f32, @const offset: vec2<i32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 654 | @must_use implicit(A: iu32) fn textureSampleLevel(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: f32) -> vec4<f32> |
| 655 | @must_use implicit(A: iu32) fn textureSampleLevel(texture: texture_2d_array<f32>, sampler: sampler, coords: vec2<f32>, array_index: A, level: f32, @const offset: vec2<i32>) -> vec4<f32> |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 656 | @must_use fn textureSampleLevel(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: f32) -> vec4<f32> |
| 657 | @must_use fn textureSampleLevel(texture: texture_3d<f32>, sampler: sampler, coords: vec3<f32>, level: f32, @const offset: vec3<i32>) -> vec4<f32> |
| 658 | @must_use fn textureSampleLevel(texture: texture_cube<f32>, sampler: sampler, coords: vec3<f32>, level: f32) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 659 | @must_use implicit(A: iu32) fn textureSampleLevel(texture: texture_cube_array<f32>, sampler: sampler, coords: vec3<f32>, array_index: A, level: f32) -> vec4<f32> |
| 660 | @must_use implicit(L: iu32) fn textureSampleLevel(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: L) -> f32 |
| 661 | @must_use implicit(L: iu32) fn textureSampleLevel(texture: texture_depth_2d, sampler: sampler, coords: vec2<f32>, level: L, @const offset: vec2<i32>) -> f32 |
| 662 | @must_use implicit(A: iu32, L: iu32) fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: L) -> f32 |
| 663 | @must_use implicit(A: iu32, L: iu32) fn textureSampleLevel(texture: texture_depth_2d_array, sampler: sampler, coords: vec2<f32>, array_index: A, level: L, @const offset: vec2<i32>) -> f32 |
| 664 | @must_use implicit(L: iu32) fn textureSampleLevel(texture: texture_depth_cube, sampler: sampler, coords: vec3<f32>, level: L) -> f32 |
| 665 | @must_use implicit(A: iu32, L: iu32) fn textureSampleLevel(texture: texture_depth_cube_array,sampler: sampler, coords: vec3<f32>, array_index: A, level: L) -> f32 |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 666 | @must_use fn textureSampleBaseClampToEdge(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32> |
| 667 | @must_use fn textureSampleBaseClampToEdge(texture: texture_external, sampler: sampler, coords: vec2<f32>) -> vec4<f32> |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 668 | implicit(C: iu32) fn textureStore(texture: texture_storage_1d<f32_texel_format, writable>, coords: C, value: vec4<f32>) |
| 669 | implicit(C: iu32) fn textureStore(texture: texture_storage_2d<f32_texel_format, writable>, coords: vec2<C>, value: vec4<f32>) |
| 670 | implicit(C: iu32, A: iu32) fn textureStore(texture: texture_storage_2d_array<f32_texel_format, writable>, coords: vec2<C>, array_index: A, value: vec4<f32>) |
| 671 | implicit(C: iu32) fn textureStore(texture: texture_storage_3d<f32_texel_format, writable>, coords: vec3<C>, value: vec4<f32>) |
| 672 | implicit(C: iu32) fn textureStore(texture: texture_storage_1d<i32_texel_format, writable>, coords: C, value: vec4<i32>) |
| 673 | implicit(C: iu32) fn textureStore(texture: texture_storage_2d<i32_texel_format, writable>, coords: vec2<C>, value: vec4<i32>) |
| 674 | implicit(C: iu32, A: iu32) fn textureStore(texture: texture_storage_2d_array<i32_texel_format, writable>, coords: vec2<C>, array_index: A, value: vec4<i32>) |
| 675 | implicit(C: iu32) fn textureStore(texture: texture_storage_3d<i32_texel_format, writable>, coords: vec3<C>, value: vec4<i32>) |
| 676 | implicit(C: iu32) fn textureStore(texture: texture_storage_1d<u32_texel_format, writable>, coords: C, value: vec4<u32>) |
| 677 | implicit(C: iu32) fn textureStore(texture: texture_storage_2d<u32_texel_format, writable>, coords: vec2<C>, value: vec4<u32>) |
| 678 | implicit(C: iu32, A: iu32) fn textureStore(texture: texture_storage_2d_array<u32_texel_format, writable>, coords: vec2<C>, array_index: A, value: vec4<u32>) |
| 679 | implicit(C: iu32) fn textureStore(texture: texture_storage_3d<u32_texel_format, writable>, coords: vec3<C>, value: vec4<u32>) |
| 680 | @must_use implicit(T: fiu32, C: iu32, L: iu32) fn textureLoad(texture: texture_1d<T>, coords: C, level: L) -> vec4<T> |
| 681 | @must_use implicit(T: fiu32, C: iu32, L: iu32) fn textureLoad(texture: texture_2d<T>, coords: vec2<C>, level: L) -> vec4<T> |
| 682 | @must_use implicit(T: fiu32, C: iu32, A: iu32, L: iu32) fn textureLoad(texture: texture_2d_array<T>, coords: vec2<C>, array_index: A, level: L) -> vec4<T> |
| 683 | @must_use implicit(T: fiu32, C: iu32, L: iu32) fn textureLoad(texture: texture_3d<T>, coords: vec3<C>, level: L) -> vec4<T> |
| 684 | @must_use implicit(T: fiu32, C: iu32, S: iu32) fn textureLoad(texture: texture_multisampled_2d<T>, coords: vec2<C>, sample_index: S) -> vec4<T> |
| 685 | @must_use implicit(C: iu32, L: iu32) fn textureLoad(texture: texture_depth_2d, coords: vec2<C>, level: L) -> f32 |
| 686 | @must_use implicit(C: iu32, A: iu32, L: iu32) fn textureLoad(texture: texture_depth_2d_array, coords: vec2<C>, array_index: A, level: L) -> f32 |
| 687 | @must_use implicit(C: iu32, S: iu32) fn textureLoad(texture: texture_depth_multisampled_2d, coords: vec2<C>, sample_index: S) -> f32 |
| 688 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_external, coords: vec2<C>) -> vec4<f32> |
| 689 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_1d<f32_texel_format, readable>, coords: C) -> vec4<f32> |
| 690 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_1d<i32_texel_format, readable>, coords: C) -> vec4<i32> |
| 691 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_1d<u32_texel_format, readable>, coords: C) -> vec4<u32> |
| 692 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_2d<f32_texel_format, readable>, coords: vec2<C>) -> vec4<f32> |
| 693 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_2d<i32_texel_format, readable>, coords: vec2<C>) -> vec4<i32> |
| 694 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_2d<u32_texel_format, readable>, coords: vec2<C>) -> vec4<u32> |
| 695 | @must_use implicit(C: iu32, A: iu32) fn textureLoad(texture: texture_storage_2d_array<f32_texel_format, readable>, coords: vec2<C>, array_index: A) -> vec4<f32> |
| 696 | @must_use implicit(C: iu32, A: iu32) fn textureLoad(texture: texture_storage_2d_array<i32_texel_format, readable>, coords: vec2<C>, array_index: A) -> vec4<i32> |
| 697 | @must_use implicit(C: iu32, A: iu32) fn textureLoad(texture: texture_storage_2d_array<u32_texel_format, readable>, coords: vec2<C>, array_index: A) -> vec4<u32> |
| 698 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_3d<f32_texel_format, readable>, coords: vec3<C>) -> vec4<f32> |
| 699 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_3d<i32_texel_format, readable>, coords: vec3<C>) -> vec4<i32> |
| 700 | @must_use implicit(C: iu32) fn textureLoad(texture: texture_storage_3d<u32_texel_format, readable>, coords: vec3<C>) -> vec4<u32> |
Ben Clayton | b85e692 | 2022-02-02 23:07:11 +0000 | [diff] [blame] | 701 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 702 | @stage("fragment") implicit(T: fiu32) fn inputAttachmentLoad(input_attachment: input_attachment<T>) -> vec4<T> |
Le Hoang Quyen | c224131 | 2024-05-28 18:29:28 +0000 | [diff] [blame] | 703 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 704 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicLoad(ptr<S, atomic<T>, read_write>) -> T |
| 705 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicStore(ptr<S, atomic<T>, read_write>, T) |
| 706 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicAdd(ptr<S, atomic<T>, read_write>, T) -> T |
| 707 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicSub(ptr<S, atomic<T>, read_write>, T) -> T |
| 708 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicMax(ptr<S, atomic<T>, read_write>, T) -> T |
| 709 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicMin(ptr<S, atomic<T>, read_write>, T) -> T |
| 710 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicAnd(ptr<S, atomic<T>, read_write>, T) -> T |
| 711 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicOr(ptr<S, atomic<T>, read_write>, T) -> T |
| 712 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicXor(ptr<S, atomic<T>, read_write>, T) -> T |
| 713 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicExchange(ptr<S, atomic<T>, read_write>, T) -> T |
| 714 | @stage("fragment", "compute") implicit(T: iu32, S: workgroup_or_storage) fn atomicCompareExchangeWeak(ptr<S, atomic<T>, read_write>, T, T) -> __atomic_compare_exchange_result<T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 715 | |
Natalie Chouinard | 8f3ec78 | 2024-08-08 13:41:53 +0000 | [diff] [blame] | 716 | @must_use @stage("fragment", "compute") fn subgroupBallot(bool) -> vec4<u32> |
Natalie Chouinard | f15cc07 | 2024-08-09 20:50:15 +0000 | [diff] [blame] | 717 | @must_use @stage("fragment", "compute") fn subgroupElect() -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 718 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupBroadcast(value: T, @const sourceLaneIndex: iu32) -> T |
| 719 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupBroadcast(value: vec<N, T>, @const sourceLaneIndex: iu32) -> vec<N, T> |
| 720 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupBroadcastFirst(value: T) -> T |
| 721 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupBroadcastFirst(value: vec<N, T>) -> vec<N, T> |
| 722 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupShuffle(value: T, sourceLaneIndex: iu32) -> T |
| 723 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupShuffle(value: vec<N, T>, sourceLaneIndex: iu32) -> vec<N, T> |
| 724 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupShuffleXor(value: T, mask: u32) -> T |
| 725 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupShuffleXor(value: vec<N, T>, mask: u32) -> vec<N, T> |
| 726 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupShuffleUp(value: T, delta: u32) -> T |
| 727 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupShuffleUp(value: vec<N, T>, delta: u32) -> vec<N, T> |
| 728 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupShuffleDown(value: T, delta: u32) -> T |
| 729 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupShuffleDown(value: vec<N, T>, delta: u32) -> vec<N, T> |
| 730 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupAdd(value: T) -> T |
| 731 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupAdd(value: vec<N, T>) -> vec<N, T> |
| 732 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupExclusiveAdd(value: T) -> T |
| 733 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupExclusiveAdd(value: vec<N, T>) -> vec<N, T> |
| 734 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupMul(value: T) -> T |
| 735 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupMul(value: vec<N, T>) -> vec<N, T> |
| 736 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupExclusiveMul(value: T) -> T |
| 737 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupExclusiveMul(value: vec<N, T>) -> vec<N, T> |
| 738 | @must_use @stage("fragment", "compute") implicit(T: iu32) fn subgroupAnd(value: T) -> T |
| 739 | @must_use @stage("fragment", "compute") implicit(N: num, T: iu32) fn subgroupAnd(value: vec<N, T>) -> vec<N, T> |
| 740 | @must_use @stage("fragment", "compute") implicit(T: iu32) fn subgroupOr(value: T) -> T |
| 741 | @must_use @stage("fragment", "compute") implicit(N: num, T: iu32) fn subgroupOr(value: vec<N, T>) -> vec<N, T> |
| 742 | @must_use @stage("fragment", "compute") implicit(T: iu32) fn subgroupXor(value: T) -> T |
| 743 | @must_use @stage("fragment", "compute") implicit(N: num, T: iu32) fn subgroupXor(value: vec<N, T>) -> vec<N, T> |
| 744 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupMin(value: T) -> T |
| 745 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupMin(value: vec<N, T>) -> vec<N, T> |
| 746 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn subgroupMax(value: T) -> T |
| 747 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn subgroupMax(value: vec<N, T>) -> vec<N, T> |
Natalie Chouinard | 9562469 | 2024-08-09 19:03:38 +0000 | [diff] [blame] | 748 | @must_use @stage("fragment", "compute") fn subgroupAll(bool) -> bool |
| 749 | @must_use @stage("fragment", "compute") fn subgroupAny(bool) -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 750 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn quadBroadcast(e: T, @const id: iu32) -> T |
| 751 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn quadBroadcast(e: vec<N, T>, @const id: iu32) -> vec<N, T> |
| 752 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn quadSwapX(e: T) -> T |
| 753 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn quadSwapX(e: vec<N, T>) -> vec<N, T> |
| 754 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn quadSwapY(e: T) -> T |
| 755 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn quadSwapY(e: vec<N, T>) -> vec<N, T> |
| 756 | @must_use @stage("fragment", "compute") implicit(T: fiu32_f16) fn quadSwapDiagonal(e: T) -> T |
| 757 | @must_use @stage("fragment", "compute") implicit(N: num, T: fiu32_f16) fn quadSwapDiagonal(e: vec<N, T>) -> vec<N, T> |
James Price | 77980d1 | 2023-08-01 09:13:41 +0000 | [diff] [blame] | 758 | |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 759 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 760 | // Value constructors // |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 761 | //////////////////////////////////////////////////////////////////////////////// |
| 762 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 763 | // Zero value constructors |
| 764 | @must_use @const("Zero") ctor i32() -> i32 |
| 765 | @must_use @const("Zero") ctor u32() -> u32 |
| 766 | @must_use @const("Zero") ctor f32() -> f32 |
| 767 | @must_use @const("Zero") ctor f16() -> f16 |
| 768 | @must_use @const("Zero") ctor bool() -> bool |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 769 | @must_use @const("Zero") ctor vec2<T: scalar>() -> vec2<T> |
| 770 | @must_use @const("Zero") ctor vec3<T: scalar>() -> vec3<T> |
| 771 | @must_use @const("Zero") ctor vec4<T: scalar>() -> vec4<T> |
| 772 | @must_use @const("Zero") ctor mat2x2<T: f32_f16>() -> mat2x2<T> |
| 773 | @must_use @const("Zero") ctor mat2x3<T: f32_f16>() -> mat2x3<T> |
| 774 | @must_use @const("Zero") ctor mat2x4<T: f32_f16>() -> mat2x4<T> |
| 775 | @must_use @const("Zero") ctor mat3x2<T: f32_f16>() -> mat3x2<T> |
| 776 | @must_use @const("Zero") ctor mat3x3<T: f32_f16>() -> mat3x3<T> |
| 777 | @must_use @const("Zero") ctor mat3x4<T: f32_f16>() -> mat3x4<T> |
| 778 | @must_use @const("Zero") ctor mat4x2<T: f32_f16>() -> mat4x2<T> |
| 779 | @must_use @const("Zero") ctor mat4x3<T: f32_f16>() -> mat4x3<T> |
| 780 | @must_use @const("Zero") ctor mat4x4<T: f32_f16>() -> mat4x4<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 781 | |
dan sinclair | 23fa64f | 2024-08-19 22:50:10 +0000 | [diff] [blame] | 782 | @must_use @stage("compute") ctor subgroup_matrix_left<T: subgroup_matrix_elements, M: num, K: num>() -> subgroup_matrix<subgroup_matrix_kind_left, T, M, K> |
| 783 | @must_use @stage("compute") ctor subgroup_matrix_right<T: subgroup_matrix_elements, K: num, N: num>() -> subgroup_matrix<subgroup_matrix_kind_right, T, K, N> |
| 784 | @must_use @stage("compute") ctor subgroup_matrix_result<T: subgroup_matrix_elements, M: num, N: num>() -> subgroup_matrix<subgroup_matrix_kind_result, T, M, N> |
| 785 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 786 | // Identity constructors |
| 787 | @must_use @const("Identity") ctor i32(i32) -> i32 |
| 788 | @must_use @const("Identity") ctor u32(u32) -> u32 |
| 789 | @must_use @const("Identity") ctor f32(f32) -> f32 |
| 790 | @must_use @const("Identity") ctor f16(f16) -> f16 |
| 791 | @must_use @const("Identity") ctor bool(bool) -> bool |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 792 | @must_use @const("Identity") ctor vec2<T: scalar>(vec2<T>) -> vec2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 793 | @must_use @const("Identity") ctor vec3<T: scalar>(vec3<T>) -> vec3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 794 | @must_use @const("Identity") ctor vec4<T: scalar>(vec4<T>) -> vec4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 795 | @must_use @const("Identity") ctor mat2x2<T: f32_f16>(mat2x2<T>) -> mat2x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 796 | @must_use @const("Identity") ctor mat2x3<T: f32_f16>(mat2x3<T>) -> mat2x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 797 | @must_use @const("Identity") ctor mat2x4<T: f32_f16>(mat2x4<T>) -> mat2x4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 798 | @must_use @const("Identity") ctor mat3x2<T: f32_f16>(mat3x2<T>) -> mat3x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 799 | @must_use @const("Identity") ctor mat3x3<T: f32_f16>(mat3x3<T>) -> mat3x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 800 | @must_use @const("Identity") ctor mat3x4<T: f32_f16>(mat3x4<T>) -> mat3x4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 801 | @must_use @const("Identity") ctor mat4x2<T: f32_f16>(mat4x2<T>) -> mat4x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 802 | @must_use @const("Identity") ctor mat4x3<T: f32_f16>(mat4x3<T>) -> mat4x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 803 | @must_use @const("Identity") ctor mat4x4<T: f32_f16>(mat4x4<T>) -> mat4x4<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 804 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 805 | // Vector constructors (splat) |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 806 | @must_use @const("VecSplat") ctor vec2<T: scalar>(T) -> vec2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 807 | @must_use @const("VecSplat") ctor vec3<T: scalar>(T) -> vec3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 808 | @must_use @const("VecSplat") ctor vec4<T: scalar>(T) -> vec4<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 809 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 810 | // Vector constructors (scalar) |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 811 | @must_use @const("VecInitS") ctor vec2<T: scalar>(x: T, y: T) -> vec2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 812 | @must_use @const("VecInitS") ctor vec3<T: scalar>(x: T, y: T, z: T) -> vec3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 813 | @must_use @const("VecInitS") ctor vec4<T: scalar>(x: T, y: T, z: T, w: T) -> vec4<T> |
Ben Clayton | 6a80ce6 | 2022-07-15 22:27:50 +0000 | [diff] [blame] | 814 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 815 | // Vector constructors (mixed) |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 816 | @must_use @const("VecInitM") ctor vec3<T: scalar>(xy: vec2<T>, z: T) -> vec3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 817 | @must_use @const("VecInitM") ctor vec3<T: scalar>(x: T, yz: vec2<T>) -> vec3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 818 | @must_use @const("VecInitM") ctor vec4<T: scalar>(xy: vec2<T>, z: T, w: T) -> vec4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 819 | @must_use @const("VecInitM") ctor vec4<T: scalar>(x: T, yz: vec2<T>, w: T) -> vec4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 820 | @must_use @const("VecInitM") ctor vec4<T: scalar>(x: T, y: T, zw: vec2<T>) -> vec4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 821 | @must_use @const("VecInitM") ctor vec4<T: scalar>(xy: vec2<T>, zw: vec2<T>) -> vec4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 822 | @must_use @const("VecInitM") ctor vec4<T: scalar>(xyz: vec3<T>, w: T) -> vec4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 823 | @must_use @const("VecInitM") ctor vec4<T: scalar>(x: T, zyw: vec3<T>) -> vec4<T> |
Ben Clayton | 6a80ce6 | 2022-07-15 22:27:50 +0000 | [diff] [blame] | 824 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 825 | // Matrix constructors (scalar) |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 826 | @must_use @const("MatInitS") |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 827 | ctor mat2x2<T: f32_f16>(T, T, |
| 828 | T, T) -> mat2x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 829 | |
| 830 | @must_use @const("MatInitS") |
| 831 | ctor mat2x3<T: f32_f16>(T, T, T, |
| 832 | T, T, T) -> mat2x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 833 | |
| 834 | @must_use @const("MatInitS") |
| 835 | ctor mat2x4<T: f32_f16>(T, T, T, T, |
| 836 | T, T, T, T) -> mat2x4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 837 | |
| 838 | @must_use @const("MatInitS") |
| 839 | ctor mat3x2<T: f32_f16>(T, T, |
| 840 | T, T, |
| 841 | T, T) -> mat3x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 842 | |
| 843 | @must_use @const("MatInitS") |
| 844 | ctor mat3x3<T: f32_f16>(T, T, T, |
| 845 | T, T, T, |
| 846 | T, T, T) -> mat3x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 847 | |
| 848 | @must_use @const("MatInitS") |
| 849 | ctor mat3x4<T: f32_f16>(T, T, T, T, |
| 850 | T, T, T, T, |
| 851 | T, T, T, T) -> mat3x4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 852 | |
| 853 | @must_use @const("MatInitS") |
| 854 | ctor mat4x2<T: f32_f16>(T, T, |
| 855 | T, T, |
| 856 | T, T, |
| 857 | T, T) -> mat4x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 858 | |
| 859 | @must_use @const("MatInitS") |
| 860 | ctor mat4x3<T: f32_f16>(T, T, T, |
| 861 | T, T, T, |
| 862 | T, T, T, |
| 863 | T, T, T) -> mat4x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 864 | |
| 865 | @must_use @const("MatInitS") |
| 866 | ctor mat4x4<T: f32_f16>(T, T, T, T, |
| 867 | T, T, T, T, |
| 868 | T, T, T, T, |
| 869 | T, T, T, T) -> mat4x4<T> |
| 870 | |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 871 | // Matrix constructors (column vectors) |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 872 | @must_use @const("MatInitV") ctor mat2x2<T: f32_f16>(vec2<T>, vec2<T>) -> mat2x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 873 | @must_use @const("MatInitV") ctor mat2x3<T: f32_f16>(vec3<T>, vec3<T>) -> mat2x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 874 | @must_use @const("MatInitV") ctor mat2x4<T: f32_f16>(vec4<T>, vec4<T>) -> mat2x4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 875 | @must_use @const("MatInitV") ctor mat3x2<T: f32_f16>(vec2<T>, vec2<T>, vec2<T>) -> mat3x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 876 | @must_use @const("MatInitV") ctor mat3x3<T: f32_f16>(vec3<T>, vec3<T>, vec3<T>) -> mat3x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 877 | @must_use @const("MatInitV") ctor mat3x4<T: f32_f16>(vec4<T>, vec4<T>, vec4<T>) -> mat3x4<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 878 | @must_use @const("MatInitV") ctor mat4x2<T: f32_f16>(vec2<T>, vec2<T>, vec2<T>, vec2<T>) -> mat4x2<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 879 | @must_use @const("MatInitV") ctor mat4x3<T: f32_f16>(vec3<T>, vec3<T>, vec3<T>, vec3<T>) -> mat4x3<T> |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 880 | @must_use @const("MatInitV") ctor mat4x4<T: f32_f16>(vec4<T>, vec4<T>, vec4<T>, vec4<T>) -> mat4x4<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 881 | |
| 882 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | 54a104e | 2023-02-22 20:04:40 +0000 | [diff] [blame] | 883 | // Value conversions // |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 884 | //////////////////////////////////////////////////////////////////////////////// |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 885 | @must_use @const implicit(T: scalar_no_f32) conv f32(T) -> f32 |
| 886 | @must_use @const implicit(T: scalar_no_f16) conv f16(T) -> f16 |
| 887 | @must_use @const implicit(T: scalar_no_i32) conv i32(T) -> i32 |
| 888 | @must_use @const implicit(T: scalar_no_u32) conv u32(T) -> u32 |
| 889 | @must_use @const implicit(T: scalar_no_bool) conv bool(T) -> bool |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 890 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 891 | @must_use @const implicit(U: scalar_no_f32) conv vec2<T: f32>(vec2<U>) -> vec2<T> |
| 892 | @must_use @const implicit(U: scalar_no_f16) conv vec2<T: f16>(vec2<U>) -> vec2<T> |
| 893 | @must_use @const implicit(U: scalar_no_i32) conv vec2<T: i32>(vec2<U>) -> vec2<T> |
| 894 | @must_use @const implicit(U: scalar_no_u32) conv vec2<T: u32>(vec2<U>) -> vec2<T> |
| 895 | @must_use @const implicit(U: scalar_no_bool) conv vec2<T: bool>(vec2<U>) -> vec2<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 896 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 897 | @must_use @const implicit(U: scalar_no_f32) conv vec3<T: f32>(vec3<U>) -> vec3<T> |
| 898 | @must_use @const implicit(U: scalar_no_f16) conv vec3<T: f16>(vec3<U>) -> vec3<T> |
| 899 | @must_use @const implicit(U: scalar_no_i32) conv vec3<T: i32>(vec3<U>) -> vec3<T> |
| 900 | @must_use @const implicit(U: scalar_no_u32) conv vec3<T: u32>(vec3<U>) -> vec3<T> |
| 901 | @must_use @const implicit(U: scalar_no_bool) conv vec3<T: bool>(vec3<U>) -> vec3<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 902 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 903 | @must_use @const implicit(U: scalar_no_f32) conv vec4<T: f32>(vec4<U>) -> vec4<T> |
| 904 | @must_use @const implicit(U: scalar_no_f16) conv vec4<T: f16>(vec4<U>) -> vec4<T> |
| 905 | @must_use @const implicit(U: scalar_no_i32) conv vec4<T: i32>(vec4<U>) -> vec4<T> |
| 906 | @must_use @const implicit(U: scalar_no_u32) conv vec4<T: u32>(vec4<U>) -> vec4<T> |
| 907 | @must_use @const implicit(U: scalar_no_bool) conv vec4<T: bool>(vec4<U>) -> vec4<T> |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 908 | |
Ben Clayton | 17770f5 | 2024-02-20 17:34:27 +0000 | [diff] [blame] | 909 | @must_use @const conv mat2x2<T: f16>(mat2x2<f32>) -> mat2x2<T> |
| 910 | @must_use @const conv mat2x2<T: f32>(mat2x2<f16>) -> mat2x2<T> |
| 911 | @must_use @const conv mat2x3<T: f16>(mat2x3<f32>) -> mat2x3<T> |
| 912 | @must_use @const conv mat2x3<T: f32>(mat2x3<f16>) -> mat2x3<T> |
| 913 | @must_use @const conv mat2x4<T: f16>(mat2x4<f32>) -> mat2x4<T> |
| 914 | @must_use @const conv mat2x4<T: f32>(mat2x4<f16>) -> mat2x4<T> |
| 915 | @must_use @const conv mat3x2<T: f16>(mat3x2<f32>) -> mat3x2<T> |
| 916 | @must_use @const conv mat3x2<T: f32>(mat3x2<f16>) -> mat3x2<T> |
| 917 | @must_use @const conv mat3x3<T: f16>(mat3x3<f32>) -> mat3x3<T> |
| 918 | @must_use @const conv mat3x3<T: f32>(mat3x3<f16>) -> mat3x3<T> |
| 919 | @must_use @const conv mat3x4<T: f16>(mat3x4<f32>) -> mat3x4<T> |
| 920 | @must_use @const conv mat3x4<T: f32>(mat3x4<f16>) -> mat3x4<T> |
| 921 | @must_use @const conv mat4x2<T: f16>(mat4x2<f32>) -> mat4x2<T> |
| 922 | @must_use @const conv mat4x2<T: f32>(mat4x2<f16>) -> mat4x2<T> |
| 923 | @must_use @const conv mat4x3<T: f16>(mat4x3<f32>) -> mat4x3<T> |
| 924 | @must_use @const conv mat4x3<T: f32>(mat4x3<f16>) -> mat4x3<T> |
| 925 | @must_use @const conv mat4x4<T: f16>(mat4x4<f32>) -> mat4x4<T> |
| 926 | @must_use @const conv mat4x4<T: f32>(mat4x4<f16>) -> mat4x4<T> |
Zhaoming Jiang | 6058882 | 2022-06-28 14:03:36 +0000 | [diff] [blame] | 927 | |
Ben Clayton | 6ae608c | 2022-05-16 20:54:42 +0000 | [diff] [blame] | 928 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | b61e045 | 2022-05-09 21:22:24 +0000 | [diff] [blame] | 929 | // Unary Operators // |
| 930 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 931 | @must_use @const op ! (bool) -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 932 | @must_use @const implicit(N: num) op ! (vec<N, bool>) -> vec<N, bool> |
Ben Clayton | b61e045 | 2022-05-09 21:22:24 +0000 | [diff] [blame] | 933 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 934 | @must_use @const implicit(T: iu32) op ~ (T) -> T |
| 935 | @must_use @const implicit(T: iu32, N: num) op ~ (vec<N, T>) -> vec<N, T> |
Ben Clayton | b61e045 | 2022-05-09 21:22:24 +0000 | [diff] [blame] | 936 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 937 | @must_use @const("UnaryMinus") implicit(T: fi32_f16) op - (T) -> T |
| 938 | @must_use @const("UnaryMinus") implicit(T: fi32_f16, N: num) op - (vec<N, T>) -> vec<N, T> |
Ben Clayton | b61e045 | 2022-05-09 21:22:24 +0000 | [diff] [blame] | 939 | |
| 940 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 941 | // Binary Operators // |
| 942 | //////////////////////////////////////////////////////////////////////////////// |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 943 | @must_use @const implicit(T: fiu32_f16) op + (T, T) -> T |
| 944 | @must_use @const implicit(T: fiu32_f16, N: num) op + (vec<N, T>, vec<N, T>) -> vec<N, T> |
| 945 | @must_use @const implicit(T: fiu32_f16, N: num) op + (vec<N, T>, T) -> vec<N, T> |
| 946 | @must_use @const implicit(T: fiu32_f16, N: num) op + (T, vec<N, T>) -> vec<N, T> |
| 947 | @must_use @const implicit(T: f32_f16, N: num, M: num) op + (mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 948 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 949 | @must_use @const implicit(T: fiu32_f16) op - (T, T) -> T |
| 950 | @must_use @const implicit(T: fiu32_f16, N: num) op - (vec<N, T>, vec<N, T>) -> vec<N, T> |
| 951 | @must_use @const implicit(T: fiu32_f16, N: num) op - (vec<N, T>, T) -> vec<N, T> |
| 952 | @must_use @const implicit(T: fiu32_f16, N: num) op - (T, vec<N, T>) -> vec<N, T> |
| 953 | @must_use @const implicit(T: f32_f16, N: num, M: num) op - (mat<N, M, T>, mat<N, M, T>) -> mat<N, M, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 954 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 955 | @must_use @const("Multiply") implicit(T: fiu32_f16) op * (T, T) -> T |
| 956 | @must_use @const("Multiply") implicit(T: fiu32_f16, N: num) op * (vec<N, T>, vec<N, T>) -> vec<N, T> |
| 957 | @must_use @const("Multiply") implicit(T: fiu32_f16, N: num) op * (vec<N, T>, T) -> vec<N, T> |
| 958 | @must_use @const("Multiply") implicit(T: fiu32_f16, N: num) op * (T, vec<N, T>) -> vec<N, T> |
| 959 | @must_use @const("Multiply") implicit(T: f32_f16, N: num, M: num) op * (T, mat<N, M, T>) -> mat<N, M, T> |
| 960 | @must_use @const("Multiply") implicit(T: f32_f16, N: num, M: num) op * (mat<N, M, T>, T) -> mat<N, M, T> |
| 961 | @must_use @const("MultiplyMatVec") implicit(T: f32_f16, C: num, R: num) op * (mat<C, R, T>, vec<C, T>) -> vec<R, T> |
| 962 | @must_use @const("MultiplyVecMat") implicit(T: f32_f16, C: num, R: num) op * (vec<R, T>, mat<C, R, T>) -> vec<C, T> |
| 963 | @must_use @const("MultiplyMatMat") implicit(T: f32_f16, K: num, C: num, R: num) op * (mat<K, R, T>, mat<C, K, T>) -> mat<C, R, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 964 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 965 | @must_use @const implicit(T: fiu32_f16) op / (T, T) -> T |
| 966 | @must_use @const implicit(T: fiu32_f16, N: num) op / (vec<N, T>, vec<N, T>) -> vec<N, T> |
| 967 | @must_use @const implicit(T: fiu32_f16, N: num) op / (vec<N, T>, T) -> vec<N, T> |
| 968 | @must_use @const implicit(T: fiu32_f16, N: num) op / (T, vec<N, T>) -> vec<N, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 969 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 970 | @must_use @const implicit(T: fiu32_f16) op % (T, T) -> T |
| 971 | @must_use @const implicit(T: fiu32_f16, N: num) op % (vec<N, T>, vec<N, T>) -> vec<N, T> |
| 972 | @must_use @const implicit(T: fiu32_f16, N: num) op % (vec<N, T>, T) -> vec<N, T> |
| 973 | @must_use @const implicit(T: fiu32_f16, N: num) op % (T, vec<N, T>) -> vec<N, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 974 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 975 | @must_use @const implicit(T: iu32) op ^ (T, T) -> T |
| 976 | @must_use @const implicit(T: iu32, N: num) op ^ (vec<N, T>, vec<N, T>) -> vec<N, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 977 | |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 978 | @must_use @const op & (bool, bool) -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 979 | @must_use @const implicit(N: num) op & (vec<N, bool>, vec<N, bool>) -> vec<N, bool> |
| 980 | @must_use @const implicit(T: iu32) op & (T, T) -> T |
| 981 | @must_use @const implicit(T: iu32, N: num) op & (vec<N, T>, vec<N, T>) -> vec<N, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 982 | |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 983 | @must_use @const op | (bool, bool) -> bool |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 984 | @must_use @const implicit(N: num) op | (vec<N, bool>, vec<N, bool>) -> vec<N, bool> |
| 985 | @must_use @const implicit(T: iu32) op | (T, T) -> T |
| 986 | @must_use @const implicit(T: iu32, N: num) op | (vec<N, T>, vec<N, T>) -> vec<N, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 987 | |
Ben Clayton | d849032 | 2023-02-22 13:52:21 +0000 | [diff] [blame] | 988 | @must_use @const op && (bool, bool) -> bool |
| 989 | @must_use @const op || (bool, bool) -> bool |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 990 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 991 | @must_use @const implicit(T: scalar) op == (T, T) -> bool |
| 992 | @must_use @const implicit(T: scalar, N: num) op == (vec<N, T>, vec<N, T>) -> vec<N, bool> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 993 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 994 | @must_use @const implicit(T: scalar) op != (T, T) -> bool |
| 995 | @must_use @const implicit(T: scalar, N: num) op != (vec<N, T>, vec<N, T>) -> vec<N, bool> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 996 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 997 | @must_use @const implicit(T: fiu32_f16) op < (T, T) -> bool |
| 998 | @must_use @const implicit(T: fiu32_f16, N: num) op < (vec<N, T>, vec<N, T>) -> vec<N, bool> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 999 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 1000 | @must_use @const implicit(T: fiu32_f16) op > (T, T) -> bool |
| 1001 | @must_use @const implicit(T: fiu32_f16, N: num) op > (vec<N, T>, vec<N, T>) -> vec<N, bool> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 1002 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 1003 | @must_use @const implicit(T: fiu32_f16) op <= (T, T) -> bool |
| 1004 | @must_use @const implicit(T: fiu32_f16, N: num) op <= (vec<N, T>, vec<N, T>) -> vec<N, bool> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 1005 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 1006 | @must_use @const implicit(T: fiu32_f16) op >= (T, T) -> bool |
| 1007 | @must_use @const implicit(T: fiu32_f16, N: num) op >= (vec<N, T>, vec<N, T>) -> vec<N, bool> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 1008 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 1009 | @must_use @const implicit(T: iu32) op << (T, u32) -> T |
| 1010 | @must_use @const implicit(T: iu32, N: num) op << (vec<N, T>, vec<N, u32>) -> vec<N, T> |
Ben Clayton | 9fb29a3 | 2022-05-09 20:00:13 +0000 | [diff] [blame] | 1011 | |
dan sinclair | 4ac9ba9 | 2024-08-19 19:21:19 +0000 | [diff] [blame] | 1012 | @must_use @const implicit(T: iu32) op >> (T, u32) -> T |
| 1013 | @must_use @const implicit(T: iu32, N: num) op >> (vec<N, T>, vec<N, u32>) -> vec<N, T> |