Skip to content

anv: Use anv_layout_to_aux_usage for color during render passes

Faith Ekstrand requested to merge gfxstrand/mesa:review/anv-render-layout into master

Previously, we tried to treat color image layouts as a special case during render passes. This is largely an artifact of history as our initial understanding of Vulkan placed much more emphasis on render passes than our current understanding. The only real practical use for magic layouts in the middle of a render pass, as far as I can tell, is to allow more clear colors to get passed through to input attachments. However, most apps aren't very creative with their clear colors and very few of them (none coming from DXVK) actually use render passes in any interesting way. Therefore, the risk of being able to pass fewer clear colors through to input attachments should be minimal.

There are, however, three very big advantages to this change:

  1. We are now consistent in our handling of aux usage and layouts between color and depth/stencil.

  2. We are now actually following the layout guidelines from the app and aren't nearly as likely to see strange behavior due to us overriding the image layouts manually.

  3. It's more obviously correct. While I think our old render pass code was probably correct, it was full of corner cases and it's very possible that it was behaving badly in weird ways. This follows the Vulkan API much more blindly and, as such, is more likely to be correct and behave the same as other implementations.

Merge request reports