Skip to content
Snippets Groups Projects
  1. Oct 26, 2016
    • steve-lunarg's avatar
      HLSL: Enable component-wise vector comparisons from operators · 85244d74
      steve-lunarg authored
      This PR only changes a few lines of code, but is subtle.
      
      In HLSL, comparison operators (<,>,<=,>=,==,!=) operate component-wise
      when given a vector operand.  If a whole vector equality or inequality is
      desired, then all() or any() can be used on the resulting bool vector.
      
      This PR enables this change.  Existing shape conversion is used when
      one of the two arguments is a vector and one is a scalar.
      
      Some existing HLSL tests had assumed == and != meant vector-wise
      instead of component-wise comparisons.  These tests have been changed
      to add an explicit any() or all() to the test source.  This verifably
      does not change the final SPIR-V binary relative to the old behavior
      for == and !=.  The AST does change for the (now explicit, formerly
      implicit) any() and all().  Also, a few tests changes where they
      previously had the return type wrong, e.g, from a vec < vec comparison
      in hlsl.shapeConv.frag.
      
      Promotion of comparison opcodes to vector forms
      (EOpEqual->EOpVectorEqual) is handled in promoteBinary(), as is setting
      the proper vector type of the result.
      
      EOpVectorEqual and EOpVectorNotEqual are now accepted as either
      aggregate or binary nodes, similar to how the other operators are
      handled.  Partial support already existed for this: it has been
      fleshed out in the printing functions in intermOut.cpp.
      
      There is an existing defect around shape conversion with 1-vectors, but
      that is orthogonal to this PR and not addressed by it.
      85244d74
  2. Oct 25, 2016
  3. Oct 21, 2016
  4. Oct 20, 2016
    • steve-lunarg's avatar
      HLSL: fix defect in EOpMethodSampleCmp* texture decomposition · 6b596682
      steve-lunarg authored
      HLSL holds the compare value in a separate intrinsic arg, but the AST wants
      a vector including the cmp val, except in the 4-dim coord case, where it
      doesn't fit and is in fact a separate AST parameter.  This is awkward but
      necessary, given AST semantics.  In the process, a new vector is constructed
      for the combined result, but this vector was not being given the correct
      TType, so was causing some downstream troubles.
      
      Now it is.  A similar defect existed in OpTextureBias, and has also been
      fixed.
      6b596682
  5. Oct 19, 2016
  6. Oct 18, 2016
    • steve-lunarg's avatar
      HLSL: Fix unary and binary operator type conversion issues · e5921f13
      steve-lunarg authored
      This fixes defects as follows:
      
      1. handleLvalue could be called on a non-L-value, and it shouldn't be.
      
      2. HLSL allows unary negation on non-bool values.  TUnaryOperator::promote
         can now promote other types (e.g, int, float) to bool for this op.
      
      3. HLSL allows binary logical operations (&&, ||) on arbitrary types, similar
         (2).
      
      4. HLSL allows mod operation on arbitrary types, which will be promoted.
         E.g, int % float -> float % float.
      e5921f13
  7. Oct 16, 2016
  8. Oct 15, 2016
  9. Oct 14, 2016
  10. Oct 13, 2016
Loading