1. 10 Dec, 2016 1 commit
  2. 09 Dec, 2016 1 commit
  3. 08 Dec, 2016 3 commits
  4. 07 Dec, 2016 2 commits
    • HLSL: Recursive composite flattening · a2b01a0d
      steve-lunarg authored
      This PR implements recursive type flattening.  For example, an array of structs of other structs
      can be flattened to individual member variables at the shader interface.
      
      This is sufficient for many purposes, e.g, uniforms containing opaque types, but is not sufficient
      for geometry shader arrayed inputs.  That will be handled separately with structure splitting,
       which is not implemented by this PR.  In the meantime, that case is detected and triggers an error.
      
      The recursive flattening extends the following three aspects of single-level flattening:
      
      - Flattening of structures to individual members with names such as "foo[0].samp[1]";
      
      - Turning constant references to the nested composite type into a reference to a particular
        flattened member.
      
      - Shadow copies between arrays of flattened members and the nested composite type.
      
      Previous single-level flattening only flattened at the shader interface, and that is unchanged by this PR.
      Internally, shadow copies are, such as if the type is passed to a function.
      
      Also, the reasons for flattening are unchanged.  Uniforms containing opaque types, and interface struct
      types are flattened.  (The latter will change with structure splitting).
      
      One existing test changes: hlsl.structin.vert, which did in fact contain a nested composite type to be
      flattened.
      
      Two new tests are added: hlsl.structarray.flatten.frag, and hlsl.structarray.flatten.geom (currently
      issues an error until type splitting is online).
      
      The process of arriving at the individual member from chained postfix expressions is more complex than
      it was with one level.  See large-ish comment above HlslParseContext::flatten() for details.
    • HLSL: opcode specific promotion rules for interlocked ops · 05f75142
      steve-lunarg authored
      PR #577 addresses most but not all of the intrinsic promotion problems.
      This PR resolves all known cases in the remainder.
      
      Interlocked ops need special promotion rules because at the time
      of function selection, the first argument has not been converted
      to a buffer object.  It's just an int or uint, but you don't want
      to convert THAT argument, because that implies converting the
      buffer object itself.  Rather, you can convert other arguments,
      but want to stay in the same "family" of functions.  E.g, if
      the first interlocked arg is a uint, use only the uint family,
      never the int family, you can convert the other args as you please.
      
      This PR allows making such opcode and arg specific choices by
      passing the op and arg to the convertible lambda.  The code in
      the new test "hlsl.promote.atomic.frag" would not compile without
      this change, but it must compile.
      
      Also, it provides better handling of downconversions (to "worse"
      types), which are permitted in HLSL.  The existing method of
      selecting upconversions is unchanged, but if that doesn't find
      any valid ones, then it will allow downconversions.  In effect
      this always uses an upconversion if there is one.
  5. 06 Dec, 2016 3 commits
  6. 05 Dec, 2016 2 commits
  7. 04 Dec, 2016 1 commit
  8. 03 Dec, 2016 3 commits
  9. 02 Dec, 2016 1 commit
  10. 01 Dec, 2016 1 commit
    • allow renaming of shader entry point when creating SPIR-V · f1e0c871
      steve-lunarg authored
      Use "--source-entrypoint name" on the command line, or the
      TShader::setSourceEntryPoint(char*) API.
      
      When the name given to the above interfaces is detected in the
      shader source, it will be renamed to the entry point name supplied
      to the -e option or the TShader::setEntryPoint() method.
  11. 28 Nov, 2016 6 commits
  12. 26 Nov, 2016 3 commits
  13. 23 Nov, 2016 5 commits
    • HLSL: add intrinsic function implicit promotions · ef33ec09
      steve-lunarg authored
      This PR handles implicit promotions for intrinsics when there is no exact match,
      such as for example clamp(int, bool, float).  In this case the int and bool will
      be promoted to a float, and the clamp(float, float, float) form used.
      
      These promotions can be mixed with shape conversions, e.g, clamp(int, bool2, float2).
      
      Output conversions are handled either via the existing addOutputArgumentConversion
      function, which this PR generalizes to handle either aggregates or unaries, or by
      intrinsic decomposition.  If there are methods or intrinsics to be decomposed,
      then decomposition is responsible for any output conversions, which turns out to
      happen automatically in all current cases.  This can be revisited once inout
      conversions are in place.
      
      Some cases of actual ambiguity were fixed in several tests, e.g, spv.register.autoassign.*
      
      Some intrinsics with only uint versions were expanded to signed ints natively, where the
      underlying AST and SPIR-V supports that.  E.g, countbits.  This avoids extraneous
      conversion nodes.
      
      A new function promoteAggregate is added, and used by findFunction.  This is essentially
      a generalization of the "promote 1st or 2nd arg" algorithm in promoteBinary.
      
      The actual selection proceeds in three steps, as described in the comments in
      hlslParseContext::findFunction:
      
      1. Attempt an exact match.  If found, use it.
      2. If not, obtain the operator from step 1, and promote arguments.
      3. Re-select the intrinsic overload from the results of step 2.
    • Merge pull request #601 from BearishSun/master · 1c573fbc
      John Kessenich authored
      A way to query "location" qualifier for vertex attributes, using TProgram reflection API
    • Merge pull request #599 from steve-lunarg/gs · e122f053
      John Kessenich authored
      HLSL: Add GS support
    • Merge pull request #596 from steve-lunarg/hlsl-intrinsic-parsing · 6e848daf
      John Kessenich authored
      HLSL: use HLSL parser for HLSL intrinsic prototypes, enable int/bool mats
    • Merge pull request #597 from steve-lunarg/sample-keyword-fix · d347794e
      John Kessenich authored
      HLSL: allow "sample" as a valid identifier.
  14. 22 Nov, 2016 2 commits
  15. 16 Nov, 2016 2 commits
    • HLSL: allow "sample" as a valid identifier. · 75fd223f
      steve-lunarg authored
      HLSL has keywords for various interpolation modifiers such as "linear",
      "centroid", "sample", etc.  Of these, "sample" appears to be special,
      as it is also accepted as an identifier string, where the others are not.
      
      This PR adds this ability, so the construct "int sample = 42;" no longer
      produces a compilation error.
      
      New test = hlsl.identifier.sample.frag
    • HLSL: use HLSL parser to parse HLSL intrinsic prototypes, enable int/bool mats · 0842dbb3
      steve-lunarg authored
      This PR adds a CreateParseContext() fn analogous to CreateBuiltInParseables(),
      to create a language specific built in parser.  (This code was present before
      but not encapsualted in a fn).  This can now be used to create a source language
      specific parser for builtins.
      
      Along with this, the code creating HLSL intrinsic prototypes can now produce
      them in HLSL syntax, rather than GLSL syntax.  This relaxes certain prior
      restrictions at the parser level.  Lower layers (e.g, SPIR-V) may still have
      such restrictions, such as around Nx1 matrices: this code does not impact
      that.
      
      This PR also fleshes out matrix types for bools and ints, both of which were
      partially in place before.  This was easier than maintaining the restrictions
      in the HLSL prototype generator to avoid creating protoypes with those types.
      
      Many tests change because the result type from intrinsics moves from "global"
      to "temp".
      
      Several new tests are added for the new types.
  16. 15 Nov, 2016 1 commit
  17. 14 Nov, 2016 3 commits