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
    Fix handling integer overflow in constant folding · 1be4d493
    Olli Etuaho authored Sep 27, 2016
    Integer operations that overflow are defined to wrap in the ESSL
    3.00.6 spec. Constant folding that happens inside the shader
    translator should also follow the wrapping rules.
    
    The new implementations of wrapping integer addition and subtraction
    use unsigned integers to perform calculations. Unsigned integers are
    defined to implement arithmetic in modulo 2^n in the C++ spec. This
    behavior is also leveraged to implement wrapping unsigned integer
    multiplication.
    
    The implementation of wrapping signed integer multiplication is
    slightly trickier. The operands are casted to a wider type to perform
    the multiplication in a way that doesn't overflow, and then the result
    is truncated and casted back to the narrower integer type.
    
    Incorrect tests that expected errors to be generated from integer
    overflow in constant folding are removed.
    
    BUG=chromium:637050
    TEST=angle_unittests
    
    Change-Id: I0de7e25881d254803455fbf22907c192f49d09ff
    Reviewed-on: https://chromium-review.googlesource.com/390252
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
    1be4d493
GLSLTest.cpp 77 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.