From: Conor McCarthy cmccarthy@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- libs/vkd3d/state.c | 17 ++++++++++++++--- tests/d3d12.c | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 9e554b44..ffb3e2f5 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -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; }
diff --git a/tests/d3d12.c b/tests/d3d12.c index 74b4877c..5dea7812 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -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. */