KhronosGroup / KhronosGroup/Vulkan-ValidationLayers

BestPractices_ImageBarrierAccessLayout - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT not being allowed for read-only layouts

Open
#8,521 2 comments 0 reactions 0 assignees View on GitHub
BestPractices
Dominant language
C++
Stars
1k
Forks
504
Avg merge
11h 35m
Merged PRs (30d)
224

Description

The [validation](https://github.com/ziga-lunarg/Vulkan-ValidationLayers/blob/3492699f4948b0b47a94e21a7bc1c2477b713631/layers/best_practices/bp_synchronization.cpp#L142) of access-layout combinations in image memory barriers is too restrictive. In addition to `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`, input attachment access should be allowed for the following layouts:

- `VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL`
- `VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL`
- `VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL`
- `VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL`
- `VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL`
- `VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL`
- `VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT`
- `VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR`

Also, some recent layouts like `VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL` and `VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL` were never handled. Could we fix that as well?

Contributor guide

Open the contributing guide

Research direction

Start in layers/best_practices/bp_synchronization.cpp at the access-layout validation around line 142. Compare the existing handling with the listed read-only, attachment, feedback-loop, and rendering-local-read layouts. Done means input attachment access is accepted for the requested layouts and the recently added layouts, including READ_ONLY_OPTIMAL and ATTACHMENT_OPTIMAL, are handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.