Giovanni Mascellani (@giomasce) commented about libs/vkd3d/device.c:
+static void d3d12_device_get_resource_allocation_info(struct d3d12_device *device,
D3D12_RESOURCE_ALLOCATION_INFO1 *infos1, unsigned int count, const D3D12_RESOURCE_DESC *resource_descs,
D3D12_RESOURCE_ALLOCATION_INFO *result)
+{
- D3D12_RESOURCE_DESC1 resource_descs1[4];
- D3D12_RESOURCE_DESC1 *descs1 = NULL;
- unsigned int i;
- if (count > ARRAY_SIZE(resource_descs1))
- {
if (!(descs1 = vkd3d_calloc(count, sizeof(*descs1))))
{
ERR("Failed to allocate %u resource descriptions.\n", count);
memset(&infos1[ARRAY_SIZE(resource_descs1)], 0, (count - ARRAY_SIZE(resource_descs1)) * sizeof(*infos1));
count = ARRAY_SIZE(resource_descs1);
[It seems that Microsoft allows declaring an error](https://github.com/MicrosoftDocs/sdk-api/blob/docs/sdk-api-src/content/d3d12...): "If an error occurs, then D3D12_RESOURCE_ALLOCATION_INFO::SizeInBytes equals UINT64_MAX". Maybe we should do that instead of silently (WRT the application) truncate the input.