Use proper interface pointer casting during D3D12 CommandQueue creation

This commit is contained in:
MJP
2026-01-05 19:01:34 -08:00
committed by Baldur Karlsson
parent 79350fe512
commit c8596542b6
2 changed files with 29 additions and 6 deletions
+14 -3
View File
@@ -103,8 +103,14 @@ bool WrappedID3D12Device::Serialise_CreateCommandQueue(SerialiserType &ser,
if(IsReplayingAndReading())
{
void *realptr = NULL;
HRESULT hr = m_pDevice->CreateCommandQueue(&Descriptor, guid, &realptr);
ID3D12CommandQueue *ret = NULL;
HRESULT hr = m_pDevice->CreateCommandQueue(&Descriptor, guid, (void **)&ret);
if(guid == __uuidof(ID3D12CommandQueue))
ret = (ID3D12CommandQueue *)realptr;
else if(guid == __uuidof(ID3D12CommandQueue1))
ret = (ID3D12CommandQueue1 *)realptr;
if(FAILED(hr))
{
@@ -155,9 +161,14 @@ HRESULT WrappedID3D12Device::CreateCommandQueue(const D3D12_COMMAND_QUEUE_DESC *
if(riid != __uuidof(ID3D12CommandQueue) && riid != __uuidof(ID3D12CommandQueue1))
return E_NOINTERFACE;
void *realptr = NULL;
HRESULT ret = m_pDevice->CreateCommandQueue(pDesc, riid, &realptr);
ID3D12CommandQueue *real = NULL;
HRESULT ret;
SERIALISE_TIME_CALL(ret = m_pDevice->CreateCommandQueue(pDesc, riid, (void **)&real));
if(riid == __uuidof(ID3D12CommandQueue))
real = (ID3D12CommandQueue *)realptr;
else if(riid == __uuidof(ID3D12CommandQueue1))
real = (ID3D12CommandQueue1 *)realptr;
if(SUCCEEDED(ret))
{
+15 -3
View File
@@ -80,7 +80,13 @@ bool WrappedID3D12Device::Serialise_CreateCommandQueue1(SerialiserType &ser,
HRESULT hr = E_NOINTERFACE;
if(m_pDevice9)
{
hr = m_pDevice9->CreateCommandQueue1(&Descriptor, creator, guid, (void **)&ret);
void *realptr = NULL;
hr = m_pDevice9->CreateCommandQueue1(&Descriptor, creator, guid, &realptr);
if(guid == __uuidof(ID3D12CommandQueue))
ret = (ID3D12CommandQueue *)realptr;
else if(guid == __uuidof(ID3D12CommandQueue1))
ret = (ID3D12CommandQueue1 *)realptr;
}
else
{
@@ -138,9 +144,15 @@ HRESULT WrappedID3D12Device::CreateCommandQueue1(const D3D12_COMMAND_QUEUE_DESC
if(riid != __uuidof(ID3D12CommandQueue) && riid != __uuidof(ID3D12CommandQueue1))
return E_NOINTERFACE;
ID3D12CommandQueue *real = NULL;
void *realptr = NULL;
HRESULT ret;
SERIALISE_TIME_CALL(ret = m_pDevice9->CreateCommandQueue1(pDesc, CreatorID, riid, (void **)&real));
SERIALISE_TIME_CALL(ret = m_pDevice9->CreateCommandQueue1(pDesc, CreatorID, riid, &realptr));
ID3D12CommandQueue *real = NULL;
if(riid == __uuidof(ID3D12CommandQueue))
real = (ID3D12CommandQueue *)realptr;
else if(riid == __uuidof(ID3D12CommandQueue1))
real = (ID3D12CommandQueue1 *)realptr;
if(SUCCEEDED(ret))
{