From the Vulkan 1.2.203 spec:
vkCmdCopyQueryPoolResults is considered to be a transfer operation, and its writes to buffer memory must be synchronized using VK_PIPELINE_STAGE_TRANSFER_BIT and VK_ACCESS_TRANSFER_WRITE_BIT before using the results.
Our other transfers happen via CCU but
happens via CP so we have to manually flush the results from CCU
to make them visible to CP.
The same applies in inverse - we have to make next flush to wait for mem writes.
Was found due to
test_resolve_non_issued_query_data vkd3d test failure.
bug.108909 crucible test.
Thanks to @cwabbott0 for explaining how it should work and why!