Commit Graph
15 Commits
Author SHA1 Message Date
teoxoy db63877c8c [msl-out] omit extra switch case blocks where possible 2022-12-09 10:21:58 -08:00
teoxoy e05706bc48 [wgsl] remove fallthrough statement
also add support for default to be used with other case selectors
2022-12-09 10:21:58 -08:00
teoxoy 91ee407c87 [hlsl-out] fix fallthrough in switch statements 2022-05-30 13:11:56 -07:00
teoxoy b3d5e6d807 [msl-out] zero init variables in function address space 2022-05-10 10:44:40 +02:00
Jim Blandy 688ad474f7 [msl-out] Write 'using metal::uint' at the top, to work around bug. (#1740)
This lets us remove some special cases where `uint` must be fully
qualified, even though other similar types are not.
2022-02-21 13:22:54 -08:00
Taylor Holliday f63003cd36 WGSL storage address space should always correspond to MSL device add… (#1711)
* WGSL storage address space should always correspond to MSL device address space.

See MSL spec section 4.2.

* Update baselines

* Add error for storage address space if MSL version < 2.

* Update default MSL version to 2.0.
2022-02-03 13:00:04 -05:00
Boris-Chengbiao Zhou 1dcde48d09 [valid] Check that switches have a default case (#1529)
From the WGSL spec: "Each switch statement must have exactly one default clause."
2021-11-15 00:07:55 +00:00
Dzmitry Malyshau 8bc3aa824b Refactor namer scheme, fix trailing digits (#1510) 2021-11-09 09:24:41 -05:00
João Capucho 63dbd38edc Make default a switch case (#1477)
* Make default a switch case

Previously the default case of a switch statement was encoded as a block
in the statement but the wgsl spec defines it in such a way that the
default case ordering matters.

* [spv-out] Support for the new switch IR

* [dot-out] Use different labels for default cases
2021-10-26 13:31:54 -04:00
João Capucho d5fc05e8a4 Allow unsigned integers in switch 2021-09-21 17:16:51 -04:00
Hans Christian Schmitz 8417f849b1 Fix GLSL output for non-fallthrough switch cases (#1310)
* Fix GLSL output for non-fallthrough switch cases

Partially reverts 02c74b5002 and
fixes #1309.

* Fix indentation of control-flow WGSL code

* Clean up glsl-out switch case fallthrough handling

Only insert a break if needed
and if a case is fallthrough, insert a comment indicating this.
2021-08-31 17:48:28 -04:00
Jim Blandy cb0ad2504c [spv-out] Handle break and continue in switch statements.
Fixes #1030.
Fixes #1017.
2021-08-27 16:39:59 -07:00
Igor Shaposhnik 464788dc8d [hlsl-out] Implement switch statement (#1265)
* [hlsl-out] Implement switch statement

* [hlsl-out] Implement switch statement

* Add switch tests to control-flow snapshot
2021-08-22 22:30:22 -04:00
Dzmitry Malyshau 8f71a368ef Validate the exact MSL version (#1101) 2021-07-16 23:56:15 -04:00
Gordon-F 6cdd332cef Reorganize test snapshot folder 2021-06-19 10:19:04 -04:00