1. 06 Jan, 2017 2 commits
  2. 05 Jan, 2017 5 commits
  3. 04 Jan, 2017 2 commits
  4. 03 Jan, 2017 7 commits
  5. 02 Jan, 2017 1 commit
  6. 30 Dec, 2016 2 commits
  7. 29 Dec, 2016 1 commit
    • HLSL default function parameters · 26d31453
      steve-lunarg authored
      This PR adds support for default function parameters in the following cases:
      
      1. Simple constants, such as void fn(int x, float myparam = 3)
      2. Expressions that can be const folded, such a ... myparam = sin(some_const)
      3. Initializer lists that can be const folded, such as ... float2 myparam = {1,2}
      
      New tests are added: hlsl.params.default.frag and hlsl.params.default.err.frag
      (for testing error situations, such as ambiguity or non-const-foldable).
      
      In order to avoid sampler method ambiguity, the hlsl better() lambda now
      considers sampler matches.  Previously, all sampler types looked identical
      since only the basic type of EbtSampler was considered.
  8. 27 Dec, 2016 2 commits
    • HLSL: allow scalar type keywords as identifiers, and add half type support. · 5ca85ad9
      steve-lunarg authored
      HLSL allows type keywords to also be identifiers, so a sequence such as "float half = 3" is
      valid, or more bizzarely, something like "float.float = int.uint + bool;"
      
      There are places this is not supported.  E.g, it's permitted for struct members, but not struct
      names or functions.  Also, vector or matrix types such as "float3" are not permitted as
      identifiers.
      
      This PR adds that support, as well as support for the "half" type.  In production shaders,
      this was seen with variables named "half".  The PR attempts to support this without breaking
      useful grammar errors such as "; expected" at the end of unterminated statements, so it errs
      on that side at the possible expense of failing to accept valid constructs containing a type
      keyword identifier.  If others are discovered, they can be added.
      
      Also, half is now accepted as a valid type, alongside the min*float types.
    • HLSL: struct splitting: assignments of hierarchical split types · 132d3318
      steve-lunarg authored
      This commit adds support for copying nested hierarchical types of split
      types.  E.g, a struct of a struct containing both user and builtin interstage
      IO variables.
      
      When copying split types, if any subtree does NOT contain builtin interstage
      IO, we can copy the whole subtree with one assignment, which saves a bunch
      of AST verbosity for memberwise copies of that subtree.
  9. 26 Dec, 2016 1 commit
    • HLSL: inter-stage structure splitting. · a2e75310
      steve-lunarg authored
      This adds structure splitting, which among other things will enable GS support where input structs
      are passed, and thus become input arrays of structs in the GS inputs.  That is a common GS case.
      
      The salient points of this PR are:
      
      * Structure splitting has been changed from "always between stages" to "only into the VS and out of
        the PS".  It had previously happened between stages because it's not legal to pass a struct
        containing a builtin IO variable.
      
      * Structs passed between stages are now split into a struct containing ONLY user types, and a
        collection of loose builtin IO variables, if any.  The user-part is passed as a normal struct
        between stages, which is valid SPIR-V now that the builtin IO is removed.
      
      * Internal to the shader, a sanitized struct (with IO qualifiers removed) is used, so that e.g,
        functions can work unmodified.
      
      * If a builtin IO such as Position occurs in an arrayed struct, for example as an input to a GS,
        the array reference is moved to the split-off loose variable, which is given the array dimension
        itself.
      
      When passing things around inside the shader, such as over a function call, the the original type
      is used in a sanitized form that removes the builtIn qualifications and makes them temporaries.
      This means internal function calls do not have to change.  However, the type when returned from
      the shader will be member-wise copied from the internal sanitized one to the external type.
      The sanitized type is used in variable declarations.
      
      When copying split types and unsplit, if a sub-struct contains only user variables, it is copied
      as a single entity to avoid more AST verbosity.
      
      Above strategy arrived at with talks with @johnkslang.
      
      This is a big complex change.  I'm inclined to leave it as a WIP until it can get some exposure to
      real world cases.
  10. 22 Dec, 2016 1 commit
  11. 21 Dec, 2016 10 commits
  12. 20 Dec, 2016 6 commits