Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
angle
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • angle
  • Repository

Switch branch/tag
  • angle
  • src
  • compiler
  • preprocessor
  • Input.cpp
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Add full support for line continuation in the preprocessor · 26e355b8
    Olli Etuaho authored Aug 14, 2015
    Re-landing earlier change with constant signedness fixed (was causing
    build issues on Linux).
    
    Line continuation in ESSL 3.00 needs to be processed before tokenization,
    since tokens can span the line continuation. On the other hand, ANGLE's
    tokenizer keeps track of line numbers, and whenever a line continuation
    appears the line number still needs to be incremented by one, just like
    on a regular newline.
    
    That's why line continuation is now implemented as follows: when the
    shader strings are concatenated in Input, they are also checked for line
    continuation. Whenever line continuation is encountered, the string
    is cut before that point. When the tokenizer asks for more input, the
    string starting from the character after line continuation is passed
    to it, and the line number is incremented from Input. This way the
    tokenizer can parse tokens that span multiple lines - it never sees the
    line continuation - but still keeps track of the line number correctly.
    
    Relevant spec is in ESSL 3.00 section 3.2 "Source strings".
    
    Support for line continuation also applies to ESSL 1.00. ESSL 3.00
    spec section 1.5 says that line continuation support is mandated when
    an ESSL 1.00 shader is used with the OpenGL ES 3.0 API, and is optional
    when ESSL 1.00 is used with the OpenGL ES 2.0 API.
    
    TEST=dEQP-GLES3.functional.shaders.preprocessor.line_continuation.*
         (all pass),
         angle_unittests
    BUG=angleproject:1125
    
    Change-Id: Ic086aacac53cd75bf93c0fda782416501d2f842b
    Reviewed-on: https://chromium-review.googlesource.com/294200Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
    26e355b8
Input.cpp 3.23 KB
EditWeb IDE
×

Replace Input.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.