1. 06 Oct, 2017 2 commits
    • HLSL: split textures used for both shadow and non-shadow modes · 73c57bbe
      LoopDawg authored
      A single texture can statically appear in code mixed with a shadow sampler
      and a non-shadow sampler.  This would be create invalid SPIR-V, unless
      one of them is provably dead.
      
      The previous detection of this happened before DCE, so some shaders would
      trigger the error even though they wouldn't after DCE.  To handle that
      case, this PR splits the texture into two: one with each mode.  It sets
      "needsLegalization" (if that happens for any texture) to warn that this shader
      will need post-compilation legalization.
      
      If the texture is only used with one of the two modes, behavior is as it
      was before.
  2. 04 Oct, 2017 3 commits
  3. 03 Oct, 2017 1 commit
  4. 02 Oct, 2017 2 commits
    • Merge pull request #1075 from LoopDawg/subpass-input · 24919659
      John Kessenich authored
      HLSL: add subpass input types and methods
    • HLSL: add subpass input types and methods · 7f93d56e
      LoopDawg authored
      Add support for Subpass Input proposal of issue #1069.
      
      Subpass input types are given as:
      
          layout(input_attachment_index = 1) SubpassInput<float4> subpass_f;
          layout(input_attachment_index = 2) SubpassInput<int4>   subpass_i;
          layout(input_attachment_index = 3) SubpassInput<uint4>  subpass_u;
      
          layout(input_attachment_index = 1) SubpassInputMS<float4> subpass_ms_f;
          layout(input_attachment_index = 2) SubpassInputMS<int4>   subpass_ms_i;
          layout(input_attachment_index = 3) SubpassInputMS<uint4>  subpass_ms_u;
      
      The input attachment may also be specified using attribute syntax:
      
          [[vk::input_attachment_index(7)]] SubpassInput subpass_2;
      
      The template type may be a shorter-than-vec4 vector, but currently user
      structs are not supported.  (An unimplemented error will be issued).
      
      The load operations are methods on objects of the above type:
      
          float4 result = subpass_f.SubpassLoad();
          int4   result = subpass_i.SubpassLoad();
          uint4  result = subpass_u.SubpassLoad();
      
          float4 result = subpass_ms_f.SubpassLoad(samp);
          int4   result = subpass_ms_i.SubpassLoad(samp);
          uint4  result = subpass_ms_u.SubpassLoad(samp);
      
      Additionally, the AST printer could not print EOpSubpass* nodes.  Now it can.
      
      Fixes #1069
  5. 30 Sep, 2017 2 commits
  6. 29 Sep, 2017 7 commits
  7. 28 Sep, 2017 4 commits
  8. 27 Sep, 2017 8 commits
  9. 26 Sep, 2017 1 commit
  10. 25 Sep, 2017 1 commit
  11. 23 Sep, 2017 1 commit
  12. 22 Sep, 2017 1 commit
  13. 21 Sep, 2017 1 commit
    • CMake changes for HLSL legalization · fd34f0e6
      GregF authored
      Cmake now looks for External/spirv-tools. If found, it links in
      SPIRV-Tools-opt and SPVRemapper, and adds -DENABLE_OPT to build.
  14. 20 Sep, 2017 1 commit
    • Remapper: make remapper robust against non-exiting error handlers · 8004d365
      LoopDawg authored
      Remapper errors are generally fatal: there has been some unexpected situation while
      parsing the SPV binary, and there is no reasonable way to carry on.  The
      errorHandler() function is called in this case, which by default exits, but
      it is possible to submit a handler which does not.  In that case the remapper would
      carry on in a bad state.
      
      This change ensures a graceful termination of the remap() function.
      
      While a try {} catch {} construct would be the ideal and safe way to do this,
      that's off limits for certain environments, so this tries to do the same thing
      with explicit code, to catch all the bailout paths.
  15. 19 Sep, 2017 1 commit
  16. 16 Sep, 2017 1 commit
  17. 15 Sep, 2017 3 commits