hasvk:anv: Add layer with work-around for Doom 64 texture corruption
The DOOM 64 rendering corruption is happening because the game always uses
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_UNDEFINED ->
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)
vkCmdCopyBufferToImage(...)
vkCmdPipelineBarrier(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ->
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
when it wants to update its texture atlas image.
According to spec, transitioning from VK_IMAGE_LAYOUT_UNDEFINED
means
that the current image content might be discarded, but the game relies
on it being fully preserved.
This work-around layer implements super-barebone layout tracking: allows
the first transition from VK_IMAGE_LAYOUT_UNDEFINED
, but replaces
oldLayout
with VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
for each
subsequent transition of that image.
Closes: #7817 (closed) Signed-off-by: Sviatoslav Peleshko sviatoslav.peleshko@globallogic.com