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
  • libANGLE
  • ImageIndex.cpp
Find file
BlameHistoryPermalink
  • Cody Northrop's avatar
    Vulkan: Support texture base and max levels · cb16fb5f
    Cody Northrop authored Aug 29, 2019
    The Vulkan backend uses a vkImage that matches the number
    of effective levels in the GL texture. This is due to the fact
    that GL textures can have really strange layouts that only make
    sense when base level and max level are applied.
    
    For instance, take the following layout with disjoint mip levels:
    
      Level 0: 4x4 RGBA
      Level 1: 2x2 RGBA
      Level 2: 10x10 RGB
    
    If base level is set to zero and max level is set to 1, the image is
    still considered mip-complete:
    
      Level 0: 4x4 RGBA  ==> Base Level 0 ==>  Level 0: 4x4 RGBA
      Level 1: 2x2 RGBA  ==> Max Level 1  ==>  Level 1: 2x2 RGBA
      Level 2: 10x10 RGB
    
    If base and max level are then both set to 2, the texture is still
    considered complete, but of a different size and format:
    
      Level 0: 4x4 RGBA
      Level 1: 2x2 RGBA
      Level 2: 10x10 RGB ==> Base/Max Level 2 ==> Level 2: 10x10 RGB
    
    When the base or max level is changed, we must recreate the vkImage to
    match the new level count.
    
    To support that, we:
    
     - Stage updates from the current image to the new image
     - Only stage updates if there aren't already staged updates for a level
     - Free the current image and so it can be recreated at the next draw
    
    This CL does the following:
    
     - Refactors TextureVk::copyImageDataToBuffer to support staging updates
       without flush
     - Adds TextureVk::copyImageDataToBufferAndGetData to support previous
       use model
     - Adds TextureVk::changeLevels, triggered during syncState, which stages
       updates and releases the current image.
     - Updates ImageHelper::flushStagedUpdates to understand base/max levels
     - Updates TextureVk::ensureImageInitialized and TextureVk::generateMipmap
       to account for base/max level
     - Tracks base and max levels in ImageHelper
     - Adds ImageHelper::stageSubresourceUpdateFromBuffer to support
       this use case
     - Adds ImageHelper::isUpdateStaged to determine if changeLevels
       should propagate data
     - Makes gl::TextureTypeToTarget available for use outside of ImageIndex
     - Enables several deqp and end2end tests
    
    Bug: angleproject:3148
    Test: dEQP-GLES3.functional.texture.mipmap.*base_level*
    Test: dEQP-GLES3.functional.texture.mipmap.*max_level*
    Change-Id: I14ca071c9c62eb310dfed7ef9290dc65fc3ff696
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776933Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
    Commit-Queue: Cody Northrop <cnorthrop@google.com>
    cb16fb5f
ImageIndex.cpp 11.3 KB
EditWeb IDE
×

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