1. 06 Apr, 2016 2 commits
  2. 04 Apr, 2016 3 commits
  3. 03 Apr, 2016 4 commits
  4. 02 Apr, 2016 3 commits
  5. 31 Mar, 2016 5 commits
  6. 30 Mar, 2016 1 commit
    • Spec Constant Operations · 13545206
      qining authored
      Approach:
      Add a flag in `Builder` to indicate 'spec constant mode' and 'normal
      mode'. When the builder is in 'normal mode', nothing changed. When the
      builder is in 'spec constant mode', binary, unary and other instruction
      creation rountines will be redirected to `createSpecConstantOp()` to
      create instrution at module level with `OpSpecConstantOp <original
      opcode> <operands>`.
      
      'spec constant mode' should be enabled if and only if we are creating
      spec constants. So a flager setter/recover guard is added when handling
      binary/unary nodes in `createSpvConstantsFromConstSubTree()`.
      
      Note when handling spec constants which are represented as ConstantUnion
      Node, we should not use `OpSpecConstantOp` to initialize the composite
      constant, so builder is set to 'normal mode'.
      
      Tests:
      Tests are added in Test/spv.specConstantOperations.vert, including:
      
      1) Arithmetic, shift opeations for both scalar and composite type spec constants.
      2) Size conversion from/to float and double for both scalar and vector.
      3) Bitwise and/or/xor for both scalar and vector.
      4) Unary negate/not for both scalar and vector.
      5) Vector swizzles.
      6) Comparisons for scalars.
      7) == and != for composite type spec constants
      
      Issues:
      1) To implement == and != for composite type spec constants, the Spec needs
      to allow OpAll, OpAny, OpFOrdEqual, OpFUnordEqual, OpOrdNotEqual,
      OpFUnordNotEqual. Currently none of them are allowed in the Spec.
  7. 27 Mar, 2016 1 commit
  8. 25 Mar, 2016 1 commit
  9. 24 Mar, 2016 1 commit
    • Support specialization composite constants · 0840838d
      qining authored
      Fix issue #163, support creation and reference of composite type
      specialization constants.
      
      e.g.:
      ```
      layout(constant_id = 200) const float myfloat = 1.25;
      layout(constant_id = 201) const int myint = 14;
      struct structtype {
        float f;
        int i;
      };
      const structtype outer_struct_var = {myfloat, myint};
      void main(){}
      ```
      generated code (use glslangValidator):
      ```
      // Module Version 10000
      // Generated by (magic number): 80001
      // Id's are bound by 12
      
                                    Capability Shader
                     1:             ExtInstImport  "GLSL.std.450"
                                    MemoryModel Logical GLSL450
                                    EntryPoint Vertex 4  "main"
                                    Source GLSL 450
                                    Name 4  "main"
                                    Name 10  "structtype"
                                    MemberName 10(structtype) 0  "f"
                                    MemberName 10(structtype) 1  "i"
                                    Decorate 7 SpecId 200
                                    Decorate 9 SpecId 201
                     2:             TypeVoid
                     3:             TypeFunction 2
                     6:             TypeFloat 32
                     7:    6(float) SpecConstant 1067450368
                     8:             TypeInt 32 1
                     9:      8(int) SpecConstant 14
        10(structtype):             TypeStruct 6(float) 8(int)
                    11:10(structtype) SpecConstantComposite 7 9
               4(main):           2 Function None 3
                     5:             Label
                                    Return
                                    FunctionEnd
      ```
      
      Rname two function names to match their functionalities.
      1) Rename `GlslangToSpvTraverser::createSpvSpecConstant()` to
      `createSpvConstant()`;
      2) Rename `GlslangToSpvTraverser::createSpvConstant()` to
      `createSpvConstantFromConstUnionArray()`
      
      Add function `GlslangToSpvTraverser::createSpvConstantFromSubTree()` to
      handle constant creation from sub trees (e.g.: specialization constants).
      
      Related PR: #208
  10. 22 Mar, 2016 2 commits
  11. 21 Mar, 2016 6 commits
  12. 20 Mar, 2016 3 commits
  13. 18 Mar, 2016 2 commits
  14. 16 Mar, 2016 2 commits
  15. 15 Mar, 2016 2 commits
  16. 14 Mar, 2016 2 commits