Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • 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
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • src
  • Renderer
  • PixelProcessor.cpp
Find file
BlameHistoryPermalink
  • Nicolas Capens's avatar
    Use aligned allocation for classes with aligned members · 532770bb
    Nicolas Capens authored Jan 21, 2021
    The legacy PixelProcessor and VertexProcessor classes for OpenGL ES
    contain member fields with types like float4, which require 16-byte
    alignment. This isn't guaranteed by the compiler until C++17. On macOS,
    this also requires OS support, which was added in version 10.14
    (Mojave), while Chrome still has to support macOS 10.11.
    
    src/Renderer/PixelProcessor.cpp:75:18: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
    
    Overriding new and delete for these classes allows us to use our custom
    allocator which guarantees alignment. Note that the Renderer class
    already used the same approach. Also note that this hasn't caused issues
    before because these fields aren't actually accessed by instructions
    which demand alignment. However, it's still good for performance and to
    align with the intent (pun intended).
    
    Bug: b/174843857
    Change-Id: Ia5de5f6fe67a4f54805cdde3fed565c30b9318a8
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52029Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
    532770bb
PixelProcessor.cpp 33.6 KB
EditWeb IDE
×

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