vkd3d: Ignore barriers with unexpected sub-resource index.

For planar formats.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-02-14 12:22:30 +01:00 committed by Alexandre Julliard
parent 7829461d6d
commit 552f7b8eeb

View File

@ -3207,6 +3207,13 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsC
}
else
{
/* FIXME: Some formats in D3D12 are planar. Each plane is a separate sub-resource. */
if (sub_resource_idx >= d3d12_resource_desc_get_sub_resource_count(&resource->desc))
{
FIXME("Unhandled sub-resource idx %u.\n", sub_resource_idx);
continue;
}
vk_barrier.subresourceRange.baseMipLevel = sub_resource_idx % resource->desc.MipLevels;
vk_barrier.subresourceRange.levelCount = 1;
vk_barrier.subresourceRange.baseArrayLayer = sub_resource_idx / resource->desc.MipLevels;