This very much appears to be a game bug. The problematic resources are placed resources so force_initial_transition works around it.
I still don't understand why it doesn't happen with the flag VKD3D_RESOURCE_GENERAL_LAYOUT.
@K0bin Also check out https://github.com/HansKristian-Work/vkd3d-proton/issues/1216 if you haven't already.
@shelterx Yeah my other PR preconfigures vkd3d-Proton so the game works on Nvidia GPU with DLSS out of the box.
Those errors point to a game bug where it stays in UAV layout, but uses it as SRV. Don't think it has anything to do with initial transitions.
When running Guardians of the Galaxy with validation layers, I get the following validation errors on launch (even before the menu):
The interesting thing is they only show up, if
d3d12_device_supports_unified_layoutsreturns false.I am able to reproduce the issue with 2.14.1, so it's not a regression caused by the KHR_unified_layouts changes. I was also able to narrow it down further: returning true in
d3d12_device_supports_unified_layoutsbut assigning GENERAL as the common layout and the matching flag for every texture regardless as if it was supported already makes the validation errors disappear. So it's not fixed by the changes to the copy code because in that case it should still take the old code paths.I can't really see how
commonLayout = VK_IMAGE_LAYOUT_GENERALorflags |= VKD3D_RESOURCE_GENERAL_LAYOUTwould impact the initialization barrier. If anything there should be more barriers with the non-unified-layout copy code.I'm opening this more as a reminder than anything else.