Skip to content
Snippets Groups Projects
  1. Aug 31, 2017
    • LoopDawg's avatar
      HLSL: add geometry stage support for clip/cull distance · 5e5b12e9
      LoopDawg authored
      Changes:
      
      (1) Allow clip/cull builtins as both input and output in the same shader stage.  Previously,
      not enough data was tracked to handle this.
      
      (2) Handle the extra array dimension in GS inputs.  The synthesized external variable can
      now be created with the extra array dimension if needed, and the form conversion code is
      able to handle it as well.
      
      For example, both of these GS inputs would result in the same synthesized external type:
      
          triangle in float4 clip[3] : SV_ClipDistance
      
          triangle in float2 clip[3][2] : SV_ClipDistance
      
      In the second case, the inner array dimension packs with the 2-vector of floats into an array[4],
      which there is an array[3] of due to the triangle geometry.
      5e5b12e9
  2. Aug 28, 2017
    • John Kessenich's avatar
      Merge pull request #1035 from LoopDawg/clip-cull-type-fix · ea0c1643
      John Kessenich authored
      HLSL: (minor) fix type on clip/cull index result
      ea0c1643
    • LoopDawg's avatar
      HLSL: fix type on clip/cull index result · d6f4d9b4
      LoopDawg authored
      While adding geometry stage support for clip/cull, it transpired that the
      existing clip/cull support was not setting the type of the result of indexing
      into the clup/cull variable.  That's a defect independent of the geometry
      support, so to simplify the geometry PR, this is addressed separately.
      
      It doesn't appear to change the generated SPIR-V, but that's probably down to
      something else tolerating a bad input.
      d6f4d9b4
  3. Aug 26, 2017
  4. Aug 25, 2017
  5. Aug 24, 2017
    • John Kessenich's avatar
      Merge pull request #1028 from LoopDawg/clip-cull-input · 1f312f90
      John Kessenich authored
      HLSL: handle clip and cull distance input builtin type conversion
      1f312f90
    • LoopDawg's avatar
      HLSL: handle clip and cull distance input builtin type conversion · e2cda3c2
      LoopDawg authored
      HLSL allows a range of types for clip and cull distances.  There are
      three dimensions, including arrayness, vectorness, and semantic ID.
      SPIR-V requires clip and cull distance be a single array of floats in
      all cases.
      
      This code provides input side conversion between the SPIR-V form and
      the HLSL form.  (Output conversion was added in PR #947 and #997).
      
      This PR extends HlslParseContext::assignClipCullDistance to cope with
      the input side conversion.  Not as much changed as appears: there was
      also a lot of renaming to reflect the fact that the code now handles
      either direction.
      
      Currently, non-{frag,vert} stages are not handled, and are explicitly
      rejected.
      
      Fixes #1026.
      e2cda3c2
    • John Kessenich's avatar
      Merge pull request #1029 from amdrexu/feature2 · fc343694
      John Kessenich authored
      Implement extension GL_AMD_shader_image_load_store_lod
      fc343694
  6. Aug 23, 2017
  7. Aug 19, 2017
  8. Aug 18, 2017
  9. Aug 15, 2017
    • LoopDawg's avatar
      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.
      5ee05891
    • John Kessenich's avatar
      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.
      03e63fa8
    • John Kessenich's avatar
      Merge pull request #1013 from KhronosGroup/flatten-nonarrayed · 25495fdf
      John Kessenich authored
      HLSL: Flatten structs for all non-arrayed I/O interfaces.
      25495fdf
    • John Kessenich's avatar
      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.
      260f5061
  10. Aug 11, 2017
  11. Aug 10, 2017
  12. Aug 09, 2017
  13. Aug 08, 2017
  14. Aug 07, 2017
    • John Kessenich's avatar
      Merge pull request #1011 from LoopDawg/pragma-pack-matrix · eaed0682
      John Kessenich authored
      HLSL: implement #pragma pack_matrix(layout)
      eaed0682
    • LoopDawg's avatar
      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.
      6a264bed
    • John Kessenich's avatar
      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.
      d5aedc19
  15. Aug 05, 2017
  16. Aug 04, 2017
  17. Aug 02, 2017
Loading