Commit 5304c3c
committed
[naga wgsl-in] Apply automatic conversions to sampling arguments.
Properly apply WGSL's automatic conversions to the arguments
to texture sampling functions.
Introduce helper function `Lowerer::expression_with_leaf_scalar`.
Although this can't affect behavior, use
`Lowerer::expression_for_abstract` for the `image` and `sampler`
arguments, simply because we want to move away from
`Lower::expression`'s automatic concretization, and move towards
having callers say explicitly what sort of conversions they need.
Although this can't affect behavior, use
`Lowerer::expression_with_leaf_scalar` for the `offset` argument, so
that the code spells out that this requires an `i32` value, rather
than depending on blind concretization giving it that.
Continue to use `Lowerer::expression` for `gather` and `array_index`,
since those happen to behave correctly with blind concretization, and
can be cleaned up later.
Fixes gfx-rs#7427.1 parent 6cd6561 commit 5304c3c
4 files changed
Lines changed: 90 additions & 12 deletions
File tree
- naga
- src/front/wgsl/lower
- tests
- in/wgsl
- out/msl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2025 | 2025 | | |
2026 | 2026 | | |
2027 | 2027 | | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
2028 | 2038 | | |
2029 | 2039 | | |
2030 | 2040 | | |
| |||
3272 | 3282 | | |
3273 | 3283 | | |
3274 | 3284 | | |
3275 | | - | |
| 3285 | + | |
3276 | 3286 | | |
3277 | 3287 | | |
3278 | 3288 | | |
| |||
3316 | 3326 | | |
3317 | 3327 | | |
3318 | 3328 | | |
3319 | | - | |
| 3329 | + | |
3320 | 3330 | | |
3321 | | - | |
| 3331 | + | |
3322 | 3332 | | |
3323 | | - | |
| 3333 | + | |
3324 | 3334 | | |
3325 | 3335 | | |
3326 | 3336 | | |
| |||
3333 | 3343 | | |
3334 | 3344 | | |
3335 | 3345 | | |
3336 | | - | |
| 3346 | + | |
| 3347 | + | |
3337 | 3348 | | |
3338 | 3349 | | |
3339 | 3350 | | |
| |||
3343 | 3354 | | |
3344 | 3355 | | |
3345 | 3356 | | |
3346 | | - | |
| 3357 | + | |
3347 | 3358 | | |
3348 | 3359 | | |
3349 | 3360 | | |
3350 | 3361 | | |
3351 | | - | |
| 3362 | + | |
| 3363 | + | |
3352 | 3364 | | |
3353 | 3365 | | |
3354 | 3366 | | |
3355 | 3367 | | |
3356 | | - | |
| 3368 | + | |
| 3369 | + | |
3357 | 3370 | | |
3358 | 3371 | | |
3359 | 3372 | | |
3360 | 3373 | | |
3361 | | - | |
3362 | | - | |
| 3374 | + | |
| 3375 | + | |
3363 | 3376 | | |
3364 | 3377 | | |
3365 | 3378 | | |
3366 | 3379 | | |
3367 | | - | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
3368 | 3395 | | |
3369 | 3396 | | |
3370 | 3397 | | |
3371 | 3398 | | |
3372 | 3399 | | |
3373 | 3400 | | |
3374 | 3401 | | |
3375 | | - | |
| 3402 | + | |
3376 | 3403 | | |
3377 | 3404 | | |
3378 | 3405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments