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
  • EmulatePrecision.cpp
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Support precision emulation on HLSL · b741c761
    Olli Etuaho authored Jun 29, 2016
    Re-submit with missing virtual destructor and angle::NonCopyable
    added.
    
    Add precision emulation support to HLSL 4.1 output. This makes it
    possible for developers to test their shaders for precision issues
    easily on Chrome on Windows without having to use the GL backend. The
    patch has been verified with Chrome on Windows to reproduce some
    precision bugs in real-world WebGL content, including old versions of
    the babylon.js library.
    
    The EmulatePrecision AST transformation still relies on writing out
    raw shader code for the rounding functions, with raw HLSL code added
    alongside pre-existing GLSL and ESSL code. In some ways it would be
    nicer to do the EmulatePrecision step as a pure AST transformation,
    but on the other hand the raw code is much more readable and easier
    to optimize.
    
    To better support multiple output languages in EmulatePrecision, add a
    RoundingHelperWriter class that has different subclasses for writing
    the rounding functions in different languages.
    
    The unit tests are expanded to cover the HLSL output of precision
    emulation. The parts of the tests that require the HLSL output are
    only active on Windows where ANGLE_ENABLE_HLSL define is added to the
    unit tests. Putting the HLSL tests in an entirely separate file is a
    worse alternative, since it would require either a lot of code
    duplication or add a lot of boilerplate to the individual tests.
    
    BUG=angleproject:1437
    TEST=angle_unittests
    
    Change-Id: I47d501037c206f4bd8b976d3acab9b21c717084c
    Reviewed-on: https://chromium-review.googlesource.com/360152Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    b741c761
EmulatePrecision.cpp 24.4 KB
EditWeb IDE
×

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