1. 19 Aug, 2017 2 commits
  2. 18 Aug, 2017 1 commit
  3. 15 Aug, 2017 4 commits
    • HLSL: add methods to track user structure in texture return type. · 5ee05891
      LoopDawg authored
      Some languages allow a restricted set of user structure types returned from texture sampling
      operations.  Restrictions include the total vector size of all components may not exceed 4,
      and the basic types of all members must be identical.
      
      This adds underpinnings for that ability.  Because storing a whole TType or even a simple
      TTypeList in the TSampler would be expensive, the structure definition is held in a
      table outside the TType.  The TSampler contains a small bitfield index, currently 4 bits
      to support up to 15 separate texture template structure types, but that can be adjusted
      up or down.  Vector returns are handled as before.
      
      There are abstraction methods accepting and returning a TType (such as may have been parsed
      from a grammar).  The new methods will accept a texture template type and set the
      sampler to the structure if possible, checking a range of error conditions such as whether
      the total structure vector components exceed 4, or whether their basic types differe, or
      whether the struct contains non-vector-or-scalar members.  Another query returns the
      appropriate TType for the sampler.
      
      High level summary of design:
      
      In the TSampler, this holds an index into the texture structure return type table:
      
          unsigned int structReturnIndex : structReturnIndexBits;
      
      These are the methods to set or get the return type from the TSampler.  They work for vector or structure returns, and potentially could be expanded to handle other things (small arrays?) if ever needed.
      
          bool setTextureReturnType(TSampler& sampler, const TType& retType, const TSourceLoc& loc);
          void getTextureReturnType(const TSampler& sampler, const TType& retType, const TSourceLoc& loc) const;
      
      The ``convertReturn`` lambda in ``HlslParseContext::decomposeSampleMethods`` is greatly expanded to know how to copy a vec4 sample return to whatever the structure type should be.  This is a little awkward since it involves introducing a comma expression to return the proper aggregate value after a set of memberwise copies.
    • HLSL: Add fall-back for opaque initializers to just generate long-term expected code. · 03e63fa8
      John Kessenich authored
      This generated code needs an optimization pass to eliminate the assignments
      to the opaque members.
    • Merge pull request #1013 from KhronosGroup/flatten-nonarrayed · 25495fdf
      John Kessenich authored
      HLSL: Flatten structs for all non-arrayed I/O interfaces.
    • SPV: Correct selection of storage-image capabilities. Fixes #986. · 260f5061
      John Kessenich authored
      Code was reflecting an old historical use of sampled as a SPIR-V
      2-valued operand, instead of its current 3 values.
  4. 11 Aug, 2017 2 commits
  5. 10 Aug, 2017 1 commit
  6. 09 Aug, 2017 2 commits
  7. 08 Aug, 2017 1 commit
  8. 07 Aug, 2017 3 commits
    • Merge pull request #1011 from LoopDawg/pragma-pack-matrix · eaed0682
      John Kessenich authored
      HLSL: implement #pragma pack_matrix(layout)
    • HLSL: implement #pragma pack_matrix(layout) · 6a264bed
      LoopDawg authored
      This adds support for #pragma pack_matrix() to the HLSL front end.
      
      The pragma sets the default matrix layout for subsequent unqualified matrices
      in structs or buffers. Explicit qualification overrides the pragma value. Matrix
      layout is not permitted at the structure level in HLSL, so only leaves which are
      matrix types can be so qualified.
      
      Note that due to the semantic (not layout) difference in first matrix indirections
      between HLSL and SPIR-V, the sense of row and column major are flipped.  That's
      independent of this PR: just a factor to note.  A column_major qualifier appears
      as a RowMajor member decoration in SPIR-V modules, and vice versa.
    • HLSL: Correct which things flattening tracks for linkage, based on caller, not type. · d5aedc19
      John Kessenich authored
      Includes related trackLinkage() code removal and name improvements.
  9. 05 Aug, 2017 1 commit
  10. 04 Aug, 2017 5 commits
  11. 02 Aug, 2017 1 commit
  12. 01 Aug, 2017 1 commit
  13. 31 Jul, 2017 7 commits
  14. 29 Jul, 2017 2 commits
  15. 28 Jul, 2017 3 commits
  16. 27 Jul, 2017 2 commits
  17. 26 Jul, 2017 2 commits
    • Merge pull request #997 from LoopDawg/clipcull-semantic · f1f5058a
      John Kessenich authored
      HLSL: handle multiple clip/cull semantic IDs
    • HLSL: handle multiple clip/cull semantic IDs · 307b6507
      LoopDawg authored
      HLSL allows several variables to be declared.  There are packing rules involved:
      e.g, a float3 and a float1 can be packed into a single array[4], while for a
      float3 and another float3, the second one will skip the third array entry to
      avoid straddling
      
      This is implements that ability.  Because there can be multiple variables involved,
      and the final output array will often be a different type altogether (to fuse
      the values into a single destination), a new variable is synthesized, unlike the prior
      clip/cull support which used the declared variable.  The new variable name is
      taken from one of the declared ones, so the old tests are unchanged.
      
      Several new tests are added to test various packing scenarios.
      
      Only two semantic IDs are supported: 0, and 1, per HLSL rules.  This is
      encapsulated in
      
           static const int maxClipCullRegs = 2;
      
      and the algorithm (probably :) ) generalizes to larger values, although there
      are a few issues around how HLSL would pack (e.g, would 4 scalars be packed into
      a single HLSL float4 out reg?  Probably, and this algorithm assumes so).