vkd3d: Use at least D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT for textures.

It's the smallest alignment for textures supported by D3D12. Vulkan
implementations may return lower values.

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 2018-11-16 13:28:24 +01:00 committed by Alexandre Julliard
parent 06c3d1779e
commit a5646b3aff
2 changed files with 5 additions and 0 deletions

View File

@ -2062,6 +2062,7 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour
}
else
{
/* FIXME: Should we support D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT for small MSSA resources? */
if (desc->SampleDesc.Count != 1)
default_alignment = D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT;
@ -2070,6 +2071,8 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour
WARN("Failed to get allocation info for texture.\n");
valid = false;
}
info->Alignment = max(info->Alignment, D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT);
}
if (valid && desc->Alignment % info->Alignment)

View File

@ -21218,6 +21218,8 @@ static void test_suballocate_small_textures(void)
check_alignment(info.SizeInBytes, info.Alignment);
}
ok(info.Alignment >= D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT, "Got alignment %"PRIu64".\n", info.Alignment);
heap_desc.SizeInBytes = ARRAY_SIZE(textures) * info.SizeInBytes;
memset(&heap_desc.Properties, 0, sizeof(heap_desc.Properties));
heap_desc.Properties.Type = D3D12_HEAP_TYPE_DEFAULT;