anv doesn't always resolve aux buffers with private bindings on transition to external queue
System information
- OS: Fuchsia
- GPU: Intel(R) HD Graphics 620 (KBL GT2) (ID: 0), 0x8086:0x5916
- Mesa version: Mesa 21.1.2
Should happen on ToT mesa as well, based on my inspection of the code.
Describe the issue
This bug originally happened on Fuchsia so I don't have reproducer, but I can give the set of circumstances needed to repro:
- A texture is allocated with a y-tiled DRM format modifier that doesn't have support for a shared auxiliary buffer. The image must be created in a format (e.g. VK_FORMAT_R8G8B8A8_SRGB) that supports CCS_D but not CCS_E; binding the image will bind the aux memory to a private binding (see add_aux_surface_if_supported)
- Rendering into it using a fast clear
- Do an ownership transfer to VK_QUEUE_FAMILY_FOREIGN_EXT and layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.
At this point transition_color_buffer should do a partial resolve, since any external devices won't have access to the aux buffer. However, final_fast_clear is ANV_FAST_CLEAR_ANY (because of VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) and the initial aux usage isn't ISL_AUX_USAGE_CCS_E so the resolve_op is ISL_AUX_OP_NONE and the resolve is skipped.
I think to solution would be to set final_fast_clear = ANV_FAST_CLEAR_NONE if private_binding_release is true. This will also fix the fast_clear_supported input to anv_cmd_predicated_ccs_resolve, which is needed for the predication to work correctly.
Regression
No