Allow uuid for ID3D12CommandList in CreateCommandList

* This is as well as ID3D12GraphicsCommandList which is the actual
  type returned.
This commit is contained in:
baldurk committed 2018-02-19 10:51:50 +00:00
1 parent 40ed57c61a
commit 41112d10e5
2 files changed
+20 -12

No files matched your search

@@ -224,8 +224,9 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(SerialiserType &ser,
if(rerecord)
{
ID3D12GraphicsCommandList *list = NULL;
HRESULT hr = m_pDevice->CreateCommandList(nodeMask, type, pAllocator, pInitialState, riid,
(void **)&list);
HRESULT hr =
m_pDevice->CreateCommandList(nodeMask, type, pAllocator, pInitialState,
__uuidof(ID3D12GraphicsCommandList), (void **)&list);
if(FAILED(hr))
{
@@ -270,7 +271,8 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(SerialiserType &ser,
if(!GetResourceManager()->HasLiveResource(BakedCommandList))
{
ID3D12GraphicsCommandList *list = NULL;
m_pDevice->CreateCommandList(nodeMask, type, pAllocator, pInitialState, riid, (void **)&list);
m_pDevice->CreateCommandList(nodeMask, type, pAllocator, pInitialState,
__uuidof(ID3D12GraphicsCommandList), (void **)&list);
m_pDevice->AddResource(BakedCommandList, ResourceType::CommandBuffer, "Baked Command List");
m_pDevice->GetReplay()->GetResourceDesc(BakedCommandList).initialisationChunks.clear();
@@ -309,9 +311,9 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(SerialiserType &ser,
}
ID3D12GraphicsCommandList *list = NULL;
m_pDevice->CreateCommandList(nodeMask, type,
m_Cmd->m_CrackedAllocators[GetResID(pAllocator)],
pInitialState, riid, (void **)&list);
m_pDevice->CreateCommandList(
nodeMask, type, m_Cmd->m_CrackedAllocators[GetResID(pAllocator)], pInitialState,
__uuidof(ID3D12GraphicsCommandList), (void **)&list);
RDCASSERT(m_Cmd->m_BakedCmdListInfo[BakedCommandList].crackedLists.empty());
m_Cmd->m_BakedCmdListInfo[BakedCommandList].crackedLists.push_back(list);
+12 -6
View File
@@ -234,8 +234,8 @@ bool WrappedID3D12Device::Serialise_CreateCommandList(SerialiserType &ser, UINT
if(IsReplayingAndReading())
{
ID3D12GraphicsCommandList *list = NULL;
HRESULT hr =
CreateCommandList(nodeMask, type, pCommandAllocator, pInitialState, guid, (void **)&list);
HRESULT hr = CreateCommandList(nodeMask, type, pCommandAllocator, pInitialState,
__uuidof(ID3D12GraphicsCommandList), (void **)&list);
if(FAILED(hr))
{
@@ -268,13 +268,14 @@ HRESULT WrappedID3D12Device::CreateCommandList(UINT nodeMask, D3D12_COMMAND_LIST
return m_pDevice->CreateCommandList(nodeMask, type, Unwrap(pCommandAllocator),
Unwrap(pInitialState), riid, NULL);
if(riid != __uuidof(ID3D12GraphicsCommandList))
if(riid != __uuidof(ID3D12GraphicsCommandList) && riid != __uuidof(ID3D12CommandList))
return E_NOINTERFACE;
ID3D12GraphicsCommandList *real = NULL;
HRESULT ret;
SERIALISE_TIME_CALL(ret = m_pDevice->CreateCommandList(nodeMask, type, Unwrap(pCommandAllocator),
Unwrap(pInitialState), riid, (void **)&real));
SERIALISE_TIME_CALL(ret = m_pDevice->CreateCommandList(
nodeMask, type, Unwrap(pCommandAllocator), Unwrap(pInitialState),
__uuidof(ID3D12GraphicsCommandList), (void **)&real));
if(SUCCEEDED(ret))
{
@@ -315,7 +316,12 @@ HRESULT WrappedID3D12Device::CreateCommandList(UINT nodeMask, D3D12_COMMAND_LIST
// during replay, the caller is responsible for calling AddLiveResource as this function
// can be called from ID3D12GraphicsCommandList::Reset serialising
*ppCommandList = (ID3D12GraphicsCommandList *)wrapped;
if(riid == __uuidof(ID3D12GraphicsCommandList))
*ppCommandList = (ID3D12GraphicsCommandList *)wrapped;
else if(riid == __uuidof(ID3D12CommandList))
*ppCommandList = (ID3D12CommandList *)wrapped;
else
RDCERR("Unexpected riid! %s", ToStr(riid).c_str());
}
return ret;