mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-26 01:11:22 +01:00
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 #7427.