From b500207b7954e2f299f24ab29698b650ce80cddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 15 Aug 2018 13:57:57 +0200 Subject: [PATCH] vkd3d: Initialize all fields before calling d3d12_command_allocator_allocate_command_buffer(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d/command.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 501a0676..9455898c 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -4001,12 +4001,6 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d list->allocator = allocator; list->pipeline_state = initial_pipeline_state; - if (FAILED(hr = d3d12_command_allocator_allocate_command_buffer(allocator, list))) - { - ID3D12Device_Release(&device->ID3D12Device_iface); - return hr; - } - memset(list->strides, 0, sizeof(list->strides)); list->ia_desc.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; list->ia_desc.pNext = NULL; @@ -4025,6 +4019,12 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d list->state = NULL; + if (FAILED(hr = d3d12_command_allocator_allocate_command_buffer(allocator, list))) + { + ID3D12Device_Release(&device->ID3D12Device_iface); + return hr; + } + return S_OK; }