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
  • VertexAttributeTest.cpp
Find file
BlameHistoryPermalink
  • Le Hoang Quyen's avatar
    Metal: fix vertex attribute's conversion lost after changing buffer binding. · ab42afa6
    Le Hoang Quyen authored Nov 21, 2019
    After vertex buffer's attribute is converted and stored in conversion
    buffer. Binding the same attribute to another buffer, then binding it
    back to previous buffer will result in previous conversion
    information lost. The conversion method would skip the conversion due to
    buffer's content hadn't been changed, however it didn't reuse the old
    conversion result.
    
    This CL also changed the way binding offset is used in Metal backend.
    - Previous, the offset would be assigned to the offset field of
      MTLVertexAttributeDescriptor, then the buffer would simply be bound to
      the command encoder with offset=0
      i.e. setVertexBuffer(buffer, index, 0)
    - However this approach has several disadvantages. Since Metal doesn't
      allow MTLVertexAttributeDescriptor's offset to be larger than the
      vertex attribute's stride, the old approach would force the back-end
      to convert the attribute and store in conversion buffer.
    
    New approach:
    - MTLVertexAttributeDescriptor's offset will be zero. The offset will be
      used to bind the buffer itself to the render command encoder.
      i.e. setVertexBuffer(buffer, index, offset)
      This way the "offset <= stride" restriction no longer exists. The only
      restriction is the offset must be multiple of attribute's size.
    
    Added 3 new tests:
    - SimpleStateChangeTest.RebindTranslatedAttribute
    - VertexAttributeTest.DrawWithLargeBufferOffset
    - VertexAttributeTest.DrawWithLargeBufferOffsetAndLessComponents
    
    Bug: angleproject:2634
    Change-Id: I6c2fa8091436e4a24405d791f86d17d97df02d64
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940009
    Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
    Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com>
    ab42afa6
VertexAttributeTest.cpp 91.9 KB
EditWeb IDE
×

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