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
  • renderer
  • vulkan
  • RenderTargetVk.cpp
Find file
BlameHistoryPermalink
  • Shahbaz Youssefi's avatar
    Vulkan: Implement EXT_draw_buffers · 9fa248e1
    Shahbaz Youssefi authored May 06, 2019
    In GLES, color attachments are referenced by their indices.  These
    indices match between the API and GLSL.  For example, if a shader has:
    
    layout(location=0) out color;
    layout(location=3) out roughness;
    
    Then GLES would bind and enable GL_COLOR_ATTACHMENT0 and
    GL_COLOR_ATTACHMENT3.
    
    In Vulkan, the framebuffer object and the corresponding renderpass
    define the color attachments, and they don't allow gaps in color
    attachments as GLES does.  A render subpass creates the mapping between
    the color attachments as defined in the framebuffer and the attachments
    used by the shader (with possible gaps).
    
    This change packs the enabled GL color attachments for the sake of the
    framebuffer, and sets the subpass up in such a way that the shaders
    continue to use the same color output indices as GLES.
    
    In the example above, we have the attachment indices as follows:
    
     Status  | GLES | GLSL | RenderPass | Subpass
    
    enabled     0      0         0           0
    disabled    1      -                 VK_ATTACHMENT_UNUSED
    disabled    2      -                 VK_ATTACHMENT_UNUSED
    enabled     3      3         1           1
    
    That is, the array of color attachments in the Vulkan
    framebuffer/renderpass is:
    
    [0] = GL color attachment 0
    [1] = GL color attachment 3
    
    And the array of color attachment references in the Vulkan render
    subpass is:
    
    [0] = 0 (index 0 of the renderpass attachment array)
    [1] = VK_ATTACHMENT_UNUSED
    [2] = VK_ATTACHMENT_UNUSED
    [3] = 1 (index 1 of the renderpass attachment array)
    
    Bug: angleproject:2394
    Change-Id: Ib6cd2b60882643ea152986eee453270d09cd4aed
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595442
    Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
    Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
    9fa248e1
RenderTargetVk.cpp 5.64 KB
EditWeb IDE
×

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