- Aug 24, 2021
-
-
Hans Christian Schmitz authored
* Implement lexing for all WGSL number literal types * Move number literal test cases * Adjust tests to match WGSL spec on number literals Suffixes are not type names and currently only a plain `u` is supported for uints. More specifically, `i` and `f` suffixes or suffixes with widths in bits like `u32` are not supported at the moment. * Add more tests for invalid number literal suffixes * Replace code too new for Rust 1.43 * Implement parsing for hexadecimal integers * Switch to enum number types, and Bytes for width * Check for negative and leading zeros in int literals * Implement parsing of hex floats with hexf-parse * Update error message tests * Update snapshot test output files * Clean up lexer state machine code * Clean up unexpected token error code * Move number literal parsing to own submodule
-
- Aug 23, 2021
-
-
Jim Blandy authored
-
Jim Blandy authored
-
Jim Blandy authored
Using 1D images should require either the `Sampled1D` or `Image1D` capability. Using cube array images should require either the `SampledCubeArray` or `ImageCubeArray` capability.
-
Dzmitry Malyshau authored
-
Jim Blandy authored
-
Jim Blandy authored
Introduce a helper type that manages the details of emitting SPIR-V conditionals, tracking labels, branches, merge annotations and phi nodes. Change index bounds checks to use this helper.
-
Jim Blandy authored
For ease of review, there should be no meaningful code changes in this commit. Match arms are merely moved out into their own functions, whose arguments are the enum variant's fields, along with any free variables from the function containing the match.
-
Jim Blandy authored
-
Jim Blandy authored
-
Jim Blandy authored
-
João Capucho authored
Fixes #1266
-
Dzmitry Malyshau authored
* [hlsl-out] flatten the entry point inputs Previously, the logic was re-ordering the inputs according to the binding. This breaks if one of the inputs is a struct. With this change, the struct fields are also flattened into the fake entry point struct. We also construct the original arguments at the beginning of the function. * hlsl-out: completely separate the flattened IO structs from the original IR structs Previously, we had heuristics to detect if a particular struct needs the fields to be re-ordered. We'd re-order interface structs without layout, and the detection was very fragile and easily wrong. The new logic is spawning separate struct types if we need any re-ordering to happen. It's solid, there are no heuristics.
-
Jim Blandy authored
-
Igor Shaposhnik authored
* [hlsl-out] Implement switch statement * [hlsl-out] Implement switch statement * Add switch tests to control-flow snapshot
-
João Capucho authored
-
Mikko Lehtonen authored
-
Connor Fitzgerald authored
-
- Aug 21, 2021
-
-
Dzmitry Malyshau authored
-
João Capucho authored
Fixes #1246
-
João Capucho authored
-
Jim Blandy authored
Remove `forbidden_caps`. Accumulate capabilities actually used separately from the permitted capabilities, so that the latter can be retained across Writer resets, while the former is cleared between modules.
-
- Aug 20, 2021
-
-
Zicklag authored
-
João Capucho authored
-
João Capucho authored
Hlsl and wgsl don't support them directly so a polyfill is used taken from the msl spec. `asinh` = `log(x + sqrt(x * x + 1.0))` `acosh` = `log(x + sqrt(x * x - 1.0))` `atanh` = `0.5 * log((1.0 + x) / (1.0 – x))`
-
Dzmitry Malyshau authored
-
sigaloid authored
-
João Capucho authored
-
João Capucho authored
-
João Capucho authored
Fixes #1243
-
João Capucho authored
Fixes #1245
-
João Capucho authored
-
João Capucho authored
-
Jim Blandy authored
Fixes #1241.
-
- Aug 19, 2021
-
-
João Capucho authored
Previously we always set the lhs flag when lowering to generate a pointer so that dynamic indexing would work, this would produce an error on constant variables since they can't be in a lhs context. Now we introduce an enum which distinguishes not only between lhs and rhs but also in array base, if lowering in a lhs context the base is also lowered in a lhs context but if lowering in rhs the base is lowered in a special array base context which bypasses the mutability check. Fixes #1237
-
João Capucho authored
This would otherwise cause the parser to enter an infinite loop. Fixes #1232
-
João Capucho authored
-
João Capucho authored
-
Connor Fitzgerald authored
-
Dzmitry Malyshau authored
-