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
  • tests
  • gl_tests
  • GLSLTest.cpp
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Initialize uninitialized locals in GLSL output · 9733ceef
    Olli Etuaho authored May 11, 2017
    Guarantee that local variables are initialized before they are used
    in GLSL output. In HLSL output all variables were already being
    initialized.
    
    Locals are initialized using an AST transform. The local variable init
    can only be run after some simplification of the AST, so that it is
    able to handle complex cases like:
    
    for (int i[2], j = i[0]; i[0] < 3; ++i[0]) {
    }
    
    If we're dealing with ESSL 1.00 which lacks array constructors, in
    this kind of case the uninitialized array initialization code needs to
    be hoisted out of the loop init statement, and the code also needs to
    make sure that j's initializer is run after i is initialized.
    
    Another complex case involves nameless structs. This can be an issue
    also in ESSL 3.00 and above:
    
    for (struct { float f; } s; s.f < 1.0; ++s.f) {
    }
    
    Since the struct doesn't have a name, its constructor can not be used.
    We solve this by initializing the struct members individually,
    similarly to how arrays are initialized in ESSL 1.00.
    
    Initializing local variables is disabled on Mac and Android for now.
    On Mac, invalid behavior was exposed in the WebGL 2.0 tests when
    enabling it. On Android, the dEQP test runs failed for an unknown
    reason. Bugs have been opened to resolve these issues later.
    
    BUG=angleproject:1966
    TEST=angle_end2end_tests, WebGL conformance tests
    
    Change-Id: Ic06927f5b6cc9619bc82c647ee966605cd80bab2
    Reviewed-on: https://chromium-review.googlesource.com/504728
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    9733ceef
GLSLTest.cpp 93.6 KB
EditWeb IDE
×

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