1. 29 Jul, 2015 1 commit
    • Merge pull request #43 from google/cpp-style-line-directive · d9b89d3e
      John Kessenich authored
      Extend the syntax of #line and __FILE__ to support filename strings.
      
      The implementation is done via introducing a new extension 
      GL_GOOGLE_cpp_style_line_directive using the extension framework.
      
      The purpose is to support cpp-style #line directives, which is
      required by #include.
  2. 28 Jul, 2015 2 commits
  3. 27 Jul, 2015 2 commits
    • Extend the syntax of #line and __FILE__ to support filename strings. · 5011fbeb
      Lei Zhang authored
      According to the GLSL spec, the second parameter to #line should be
      an integer source string number and __FILE__ will be substituted
      with the integer source string number currently processed. This
      patch extends the syntax of #line and __FILE__. Now #line accepts
      as the second parameter a filename string quoted by double quotation
      marks. And if such a #line is set, __FILE__ will be substituted with
      the currently set filename string. The implementation is done via
      introducing a new extension GL_GOOGLE_cpp_style_line_directive using
      the extension framework.
      
      The purpose is to support cpp-style #line directives, which is
      required by #include.
    • Scanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at… · c777fc2c
      John Kessenich authored
      Scanning: 1) rationalize end-of-input everywhere, 2) prevent infinite loop at end-of-input, 3) use positive chars.
      
      Fixes issue #25. (char 255 aliased to -1 and missing tests for end of input).
      
      1) All layers of input scanning now share a single EndOfInput value.
      This avoids translation of it across layers of encapsulation.
      
      2) Some places looking for end of line were not stopping on EndOfInput.
      
      3) Use of "char" for the input made char values > 127 be negative numbers.
      This allowed for aliasing of 255 to -1, etc.  This is fixed by using
      unsigned char.
  4. 26 Jul, 2015 1 commit
  5. 25 Jul, 2015 4 commits
  6. 24 Jul, 2015 2 commits
  7. 23 Jul, 2015 5 commits
  8. 22 Jul, 2015 7 commits
  9. 21 Jul, 2015 7 commits
  10. 20 Jul, 2015 5 commits
  11. 19 Jul, 2015 1 commit
  12. 18 Jul, 2015 2 commits
  13. 17 Jul, 2015 1 commit
    • Generate correctly structured do-while loops. · c22f37cf
      David Neto authored
      The loop test is always emitted before the loop body.
      
      For do-while loops, use a phi node to track whether we're
      on the first loop iteration, and only check the loop test
      on the second and subsequent iterations.
      
      For do-while loops, the loop test branch no longer occurs
      at the top of the loop, so it must get its own selection
      merge instruction.
      
      A block can't be the target of more than one merge instruction.
      So when the loop test executes after the body (as in do-while in GLSL)
      we need to introduce a dummy block to be the target of the selection
      merge just before the loop test conditional branch.
      
      The other arm of the branch exits the loop and hence is the
      "break block" exception in the structured control flow rules.