mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d: Track command list recording state.
This commit is contained in:
parent
c311a61dc9
commit
00fec8232b
@ -60,6 +60,8 @@ static HRESULT vkd3d_command_allocator_allocate_command_list(struct d3d12_comman
|
|||||||
if ((vr = VK_CALL(vkBeginCommandBuffer(list->vk_command_buffer, &begin_info))))
|
if ((vr = VK_CALL(vkBeginCommandBuffer(list->vk_command_buffer, &begin_info))))
|
||||||
ERR("Failed to begin command buffer, vr %d.\n", vr);
|
ERR("Failed to begin command buffer, vr %d.\n", vr);
|
||||||
|
|
||||||
|
list->is_recording = TRUE;
|
||||||
|
|
||||||
allocator->current_command_list = list;
|
allocator->current_command_list = list;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
@ -415,11 +417,23 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandL
|
|||||||
|
|
||||||
TRACE("iface %p.\n", iface);
|
TRACE("iface %p.\n", iface);
|
||||||
|
|
||||||
|
if (!list->is_recording)
|
||||||
|
{
|
||||||
|
WARN("Command list is not in the recording state.\n");
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
vk_procs = &list->device->vk_procs;
|
vk_procs = &list->device->vk_procs;
|
||||||
vr = VK_CALL(vkEndCommandBuffer(list->vk_command_buffer));
|
if ((vr = VK_CALL(vkEndCommandBuffer(list->vk_command_buffer))))
|
||||||
|
{
|
||||||
|
WARN("Failed to end command buffer, vr %d.\n", vr);
|
||||||
return hresult_from_vk_result(vr);
|
return hresult_from_vk_result(vr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list->is_recording = FALSE;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandList *iface,
|
static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandList *iface,
|
||||||
ID3D12CommandAllocator *allocator, ID3D12PipelineState *initial_state)
|
ID3D12CommandAllocator *allocator, ID3D12PipelineState *initial_state)
|
||||||
{
|
{
|
||||||
|
@ -136,6 +136,7 @@ struct d3d12_command_list
|
|||||||
D3D12_COMMAND_LIST_TYPE type;
|
D3D12_COMMAND_LIST_TYPE type;
|
||||||
|
|
||||||
VkCommandBuffer vk_command_buffer;
|
VkCommandBuffer vk_command_buffer;
|
||||||
|
BOOL is_recording;
|
||||||
|
|
||||||
struct d3d12_command_allocator *allocator;
|
struct d3d12_command_allocator *allocator;
|
||||||
struct d3d12_device *device;
|
struct d3d12_device *device;
|
||||||
|
@ -855,7 +855,7 @@ static void test_reset_command_allocator(void)
|
|||||||
todo(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
todo(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = ID3D12GraphicsCommandList_Close(command_list);
|
hr = ID3D12GraphicsCommandList_Close(command_list);
|
||||||
ok(SUCCEEDED(hr), "Close failed, hr %#x.\n", hr);
|
todo(SUCCEEDED(hr), "Close failed, hr %#x.\n", hr);
|
||||||
hr = ID3D12GraphicsCommandList_Reset(command_list, command_allocator, NULL);
|
hr = ID3D12GraphicsCommandList_Reset(command_list, command_allocator, NULL);
|
||||||
todo(SUCCEEDED(hr), "Resetting command list failed, hr %#x.\n", hr);
|
todo(SUCCEEDED(hr), "Resetting command list failed, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user