mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
Direct3D 12: Avoid terrible leak related to command allocators
This commit is contained in:
parent
107f2961cc
commit
6057ec9b06
@ -1828,7 +1828,9 @@ bool RenderingDeviceDriverD3D12::command_buffer_begin(CommandBufferID p_cmd_buff
|
||||
#ifdef DEBUG_ENABLED
|
||||
ERR_FAIL_COND_V(cmd_buf_info->cmd_list->GetType() != D3D12_COMMAND_LIST_TYPE_DIRECT, false);
|
||||
#endif
|
||||
HRESULT res = cmd_buf_info->cmd_list->Reset(cmd_buf_info->cmd_allocator.Get(), nullptr);
|
||||
HRESULT res = cmd_buf_info->cmd_allocator->Reset();
|
||||
ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), false, "Reset failed with error " + vformat("0x%08ux", (uint64_t)res) + ".");
|
||||
res = cmd_buf_info->cmd_list->Reset(cmd_buf_info->cmd_allocator.Get(), nullptr);
|
||||
ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), false, "Reset failed with error " + vformat("0x%08ux", (uint64_t)res) + ".");
|
||||
return true;
|
||||
}
|
||||
@ -1838,7 +1840,9 @@ bool RenderingDeviceDriverD3D12::command_buffer_begin_secondary(CommandBufferID
|
||||
#ifdef DEBUG_ENABLED
|
||||
ERR_FAIL_COND_V(cmd_buf_info->cmd_list->GetType() != D3D12_COMMAND_LIST_TYPE_BUNDLE, false);
|
||||
#endif
|
||||
HRESULT res = cmd_buf_info->cmd_list->Reset(cmd_buf_info->cmd_allocator.Get(), nullptr);
|
||||
HRESULT res = cmd_buf_info->cmd_allocator->Reset();
|
||||
ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), false, "Reset failed with error " + vformat("0x%08ux", (uint64_t)res) + ".");
|
||||
res = cmd_buf_info->cmd_list->Reset(cmd_buf_info->cmd_allocator.Get(), nullptr);
|
||||
ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), false, "Reset failed with error " + vformat("0x%08ux", (uint64_t)res) + ".");
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user