Skip to content

subpasses example uses incorrect input attachment fragment shader indices #295

@nanley

Description

@nanley

According to 14.4. Fragment Input Attachment Interface,

A subpass input variable identified with an InputAttachmentIndex decoration of i reads from the input attachment indicated by pInputAttachments[i] member of VkSubpassDescription

However, the fragment shaders set input_attachment_index equal to the index of the attachment of the render pass (pInputAttachments[j].attachment, 0 <= j < inputAttachmentCount). Decreasing the index by 1 in all the fragment shaders fixes the issue.

Unfortunately, it doesn't seem like the validation layer catches this issue although there seems to be code for it at layers/core_validation.cpp:2652 . Do you think this issue has enough information to file an issue with the validation layers?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions