vkd3d: Reject OFFSET_APPEND after unbounded ranges in d3d12_root_signature_info_count_descriptors().

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2021-10-06 18:43:28 +02:00 committed by Alexandre Julliard
parent 441d8e24b2
commit c5fdd2f404
2 changed files with 15 additions and 4 deletions

View File

@ -325,6 +325,7 @@ struct d3d12_root_signature_info
static HRESULT d3d12_root_signature_info_count_descriptors(struct d3d12_root_signature_info *info,
const D3D12_ROOT_DESCRIPTOR_TABLE *table, bool use_array)
{
bool unbounded = false;
unsigned int i;
for (i = 0; i < table->NumDescriptorRanges; ++i)
@ -332,12 +333,16 @@ static HRESULT d3d12_root_signature_info_count_descriptors(struct d3d12_root_sig
const D3D12_DESCRIPTOR_RANGE *range = &table->pDescriptorRanges[i];
unsigned int binding_count;
if (range->NumDescriptors == 0xffffffff)
if (unbounded && range->OffsetInDescriptorsFromTableStart == D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
{
FIXME("Unhandled unbound descriptor range.\n");
return E_NOTIMPL;
WARN("An unbounded range with offset D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND occurs after "
"another unbounded range.\n");
return E_INVALIDARG;
}
if (range->NumDescriptors == UINT_MAX)
unbounded = true;
binding_count = use_array ? 1 : range->NumDescriptors;
switch (range->RangeType)
@ -365,6 +370,12 @@ static HRESULT d3d12_root_signature_info_count_descriptors(struct d3d12_root_sig
info->binding_count += binding_count;
}
if (unbounded)
{
FIXME("Unhandled unbounded descriptor range.\n");
return E_NOTIMPL;
}
return S_OK;
}

View File

@ -2814,7 +2814,7 @@ static void test_create_root_signature(void)
* D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND. */
descriptor_ranges[1].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
hr = create_root_signature(device, &root_signature_desc, &root_signature);
todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
/* A bounded range overlapping an unbounded one, mapped to the same
* register space and type. */