1. 13 Nov, 2016 1 commit
    • HLSL: allow promotion from 1-vector types to scalars, e.g, float<-float1 · d9cb832f
      steve-lunarg authored
      Previously, an error was thrown when assigning a float1 to a scalar float,
      or similar for other basic types.  This allows that.
      
      Also, this allows calling functions accepting scalars with float1 params,
      so for example sin(float1) will work.  This is a minor change in
      HlslParseContext::findFunction().
  2. 11 Nov, 2016 2 commits
  3. 05 Nov, 2016 1 commit
    • Whole stack: Fix stale types in the AST linker object nodes, fixing #557. · d3f1122a
      John Kessenich authored
      Rationalizes the entire tracking of the linker object nodes, effecting
      GLSL, HLSL, and SPIR-V, to allow tracked objects to be fully edited before
      their type snapshot for linker objects.
      
      Should only effect things when the rest of the AST contained no reference to
      the symbol, because normal AST nodes were not stale. Also will only effect such
      objects when their types were edited.
  4. 01 Nov, 2016 6 commits
  5. 31 Oct, 2016 3 commits
    • Use std::atoi instead of std::stoi · e301f678
      David Neto authored
      Some Android cross cross-compilers don't have std::stoi.
      
      E.g. i686-linux-android-g++ from Android NDK r10e don't have std::stoi.
    • HLSL: Add min*{float,int,uint} types · 3226b083
      steve-lunarg authored
      These HLSL types are guaranteed to have at least the given number of bits, but may have more.
      
      min{16,10}float is mapped to EbtFloat at medium precision -> SPIRV RelaxedPrecision
      min{16,12}int and min16uint are mapped to mediump -> SPIR-V RelaxedPrecision
    • HLSL: implement numthreads for compute shaders · 1868b144
      steve-lunarg authored
      This PR adds handling of the numthreads attribute for compute shaders, as well as a general
      infrastructure for returning attribute values from acceptAttributes, which may be needed in other
      cases, e.g, unroll(x), or merely to know if some attribute without params was given.
      
      A map of enum values from TAttributeType to TIntermAggregate nodes is built and returned.  It
      can be queried with operator[] on the map.  In the future there may be a need to also handle
      strings (e.g, for patchconstantfunc), and those can be easily added into the class if needed.
      
      New test is in hlsl.numthreads.comp.
  6. 29 Oct, 2016 1 commit
  7. 28 Oct, 2016 2 commits
  8. 27 Oct, 2016 4 commits
  9. 26 Oct, 2016 2 commits
    • HLSL: allow component-wise operations for logical || and &&. · 27939caa
      steve-lunarg authored
      HLSL || and && can operate component-wise.
    • 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.
  10. 25 Oct, 2016 1 commit
  11. 21 Oct, 2016 9 commits
  12. 20 Oct, 2016 1 commit
    • 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.
  13. 19 Oct, 2016 3 commits
  14. 18 Oct, 2016 1 commit
    • 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.
  15. 16 Oct, 2016 3 commits