On Tue Jul 11 00:59:58 2023 +0000, Henri Verbeet wrote:
Why did we want to buffer these in vkd3d again?
The main reason is to handle the sequence:
Resource is used in command list 1, so its initial transition is added there. Resource is then used in command list 2. Command list 2 is executed on a queue. Command list 1 is executed on a queue.
This occurs in AC:Valhalla.
It also makes available accurate layout information so we can stop all the validation failures on layout mismatches, lets us correctly implement d3d12 state promotion, and maybe handle specific performance issues which could arise from non-optimal layouts.
It fixes the todo in `test_resolve_query_data_in_reordered_command_list()`.
And it makes it much simpler to move initial transitions to the front so they don't end render passes, if that should prove useful.
We currently ignore [state promotion](https://learn.microsoft.com/en-us/windows/win32/direct3d12/using-resource-ba...). I think for simultaneous access textures we should just leave them in `VK_IMAGE_LAYOUT_GENERAL`, but normal texures in common state can be used as a shader resource, copy source or copy dest without a state transition. I think we need to transition the layout for the latter two, and for shader resource just leave it in `GENERAL` because checking for such use is impractical.