Skip to content
  1. Sep 27, 2021
    • Jim Blandy's avatar
      Simplify interpolation defaulting. · d44e2ad2
      Jim Blandy authored
      Replace `Module::apply_common_default_interpolation` with a simpler function
      that handles a single `Binding` at a time. In exchange for the simplicity, the
      function must be called at each point function arguments, function results, and
      struct members are prepared. (Any missed spots will be caught by the verifier.)
      
      This approach no longer requires mutating types in the arena, a prerequisite for
      properly handling type identity.
      
      Applying defaults to struct members when the struct declaration is parsed does
      have a disadvantage, compared to the old whole-module pass: at struct parse
      time, we don't yet know which pipeline stages the struct will be used in. The
      best we can do is apply defaults to anything with a `Location` binding. This
      causes needless qualifiers to appear in some output. However, it seems that our
      back end languages all tolerate such qualifiers.
      d44e2ad2
    • João Capucho's avatar
      [Typifier] Some relational functions output vectors · 73f9d072
      João Capucho authored
      Previously the typifier flagged all relational functions as producing a
      scalar boolean but with the exception of `all` and `any`, according to
      the wgsl spec, all other relational functions output a type the same
      size as the input.
      73f9d072
  2. Sep 23, 2021
  3. Sep 22, 2021
  4. Sep 21, 2021
  5. Sep 20, 2021
  6. Sep 19, 2021
  7. Sep 17, 2021
  8. Sep 16, 2021
  9. Sep 15, 2021
  10. Sep 14, 2021
    • Jim Blandy's avatar
      [wgsl-in] Rework Load Rule handling and indirection. · 3fdd8592
      Jim Blandy authored
      Make the parser code more closely follow the spec's grammar around
      `unary_expression`, `postfix_expression`, and `singular_expression`.
      
      Change the handling of postfix expressions (indexing, member/component access,
      and swizzling) to apply the indirection at the appropriate time, resulting in
      code improvements on all output formats. For example, where we used to generate
      the following MSL:
      
          metal::float4 _e13 = bar.matrix[3];
          float b = _e13.x;
      
      we now generate, simply:
      
          float b = bar.matrix[3].x;
      
      Propagate WGSL reference types correctly, so that parenthesizing expressions no
      longer causes the Load Rule to be applied.
      
      Together with #1332 (already landed), this is a replacement for #1312, and
      unblocks #1352.
      
      Fixes #1351.
      3fdd8592