diff --git a/.pick_status.json b/.pick_status.json index 1b2be0a1e02..a2e2b5478cf 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -364,7 +364,7 @@ "description": "tu: Fix flushing when using a staging buffer for copies", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/freedreno/vulkan/tu_clear_blit.cc b/src/freedreno/vulkan/tu_clear_blit.cc index 1222a4d7233..fbe0ad5064f 100644 --- a/src/freedreno/vulkan/tu_clear_blit.cc +++ b/src/freedreno/vulkan/tu_clear_blit.cc @@ -2999,8 +2999,16 @@ tu_copy_image_to_image(struct tu_cmd_buffer *cmd, /* When executed by the user there has to be a pipeline barrier here, * but since we're doing it manually we'll have to flush ourselves. + * Because we may reuse the staging buffer with different + * layouts/formats, we also have to invalidate CCU, which when executed + * by the user would be done before the next use of the staging buffer + * when transitioning from UNDEFINED. Here it's more optimal to + * invalidate right away after flushing instead of before the next copy + * using the staging buffer however, because we don't have to insert + * another WFI. */ tu_emit_event_write(cmd, cs, FD_CCU_CLEAN_COLOR); + tu_emit_event_write(cmd, cs, FD_CCU_INVALIDATE_COLOR); tu_emit_event_write(cmd, cs, FD_CACHE_INVALIDATE); tu_cs_emit_wfi(cs);