wgpu/naga/tests
Jim Blandy 3fda684eb9 [naga msl-out] Defeat the MSL compiler's infinite loop analysis.
See the comments in the code for details.

This patch emits the definition of the macro only when the first loop
is encountered. This does make that first loop's code look a bit odd:
it would be more natural to define the macro at the top of the
file. (See the modified files in `naga/tests/out/msl`.)

Rejected alternatives:

- We could emit the macro definition unconditionally at the top of the
  file. But this changes every MSL snapshot output file, whereas only
  eight of them actually contain loops.

- We could have the validator flag modules that contain loops. But the
  changes end up being not small, and spread across the validator, so
  this seems disproportionate. If we had other consumers of this
  information, it might make sense.

- We could change the MSL backend to allow text to be generated out of
  order, so that we can decide whether to define the macro after we've
  generated all the function bodies. But at the moment this seems like
  unnecessary complexity, although it might be worth doing in the
  future if we had additional uses for it - say, to conditionally emit
  helper function definitions.

Fixes #4972.
2024-09-18 11:01:51 -04:00
..
in spv-in parse more atomic ops (#5824) 2024-09-18 05:39:36 +00:00
out [naga msl-out] Defeat the MSL compiler's infinite loop analysis. 2024-09-18 11:01:51 -04:00
example_wgsl.rs [naga] Make the example_wgsl test build without wgsl-in feature. 2023-11-24 13:17:30 +01:00
root.rs [naga] Test CallResult and AtomicResult population. 2024-05-28 09:17:16 +02:00
snapshots.rs spv-out: configure source language in debug info 2024-09-13 11:37:23 -07:00
spirv_capabilities.rs Add cfg_alias indirection to Naga's x_out features 2024-07-09 09:53:39 +02:00
validation.rs [naga] Make tests compile without the WGSL front end. (#6217) 2024-09-05 10:18:20 +02:00
wgsl_errors.rs [naga wgsl] Impl const_assert (#6198) 2024-09-02 17:37:04 +00:00