Conor McCarthy : vkd3d: Narrow the scope of cur_binding in d3d12_root_signature_init_root_descriptor_tables().
Module: vkd3d Branch: master Commit: 341f9745fdc5416a618b5110ed033df30cf2ced2 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=341f9745fdc5416a618b5110... Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Fri Jul 30 14:03:19 2021 +1000 vkd3d: Narrow the scope of cur_binding in d3d12_root_signature_init_root_descriptor_tables(). Simplifies the calling of a helper function to create descriptor arrays. Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/state.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 7a3759e..daa907b 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -580,7 +580,6 @@ static uint32_t vkd3d_descriptor_magic_from_d3d12(D3D12_DESCRIPTOR_RANGE_TYPE ty static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_root_signature *root_signature, const D3D12_ROOT_SIGNATURE_DESC *desc, struct vkd3d_descriptor_set_context *context) { - VkDescriptorSetLayoutBinding *cur_binding = context->current_binding; struct d3d12_root_descriptor_table *table; const D3D12_DESCRIPTOR_RANGE *range; unsigned int i, j, k, range_count; @@ -627,8 +626,12 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo for (j = 0; j < range_count; ++j) { + VkDescriptorSetLayoutBinding *cur_binding; + range = &p->u.DescriptorTable.pDescriptorRanges[j]; + cur_binding = context->current_binding; + vk_binding = d3d12_root_signature_assign_vk_bindings(root_signature, vkd3d_descriptor_type_from_d3d12_range_type(range->RangeType), range->RegisterSpace, range->BaseShaderRegister, range->NumDescriptors, false, true, @@ -660,10 +663,11 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo } table->ranges[j].binding = vk_binding; + + context->current_binding = cur_binding; } } - context->current_binding = cur_binding; return S_OK; }
participants (1)
-
Alexandre Julliard