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
  • translator
  • OutputHLSL.cpp
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Defer global initializers when necessary · 3d932d83
    Olli Etuaho authored Apr 12, 2016
    Move global variable initializers that are not constant expressions to
    a function that gets called at the start of main(). This is done
    with an AST transformation. This needs to be done because global
    variable initializers must be constant in native GL, but ANGLE is more
    lenient with what can be put into ESSL 1.00 global initializers to
    remain compatible with legacy WebGL content.
    
    Non-constant global variable initializers also caused issues in HLSL
    output, since in HLSL output some types of expressions get unfolded
    into multiple statements. These include short-circuiting operators and
    array initialization. To make sure that these cases are covered, any
    initializers that can't be constant folded are deferred, even if they
    have the const qualifier.
    
    The old deferring mechanism in OutputHLSL is removed in favor of this
    new AST transformation based approach.
    
    BUG=angleproject:819
    BUG=angleproject:1205
    BUG=angleproject:1350
    BUG=596616
    TEST=WebGL conformance test
         conformance/glsl/misc/global-variable-init.html
    
    Change-Id: I039cc05d6b8c284baeefbdf7f10062cae4bc5716
    Reviewed-on: https://chromium-review.googlesource.com/338291Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    3d932d83
OutputHLSL.cpp 134 KB
EditWeb IDE
×

Replace OutputHLSL.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.