Skip to content

Commit 72966f9

Browse files
TheRealMJPbaldurk
authored andcommitted
Add proper casts when returning the wrapped command queue
1 parent c859654 commit 72966f9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

renderdoc/driver/d3d12/d3d12_device_wrap.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ HRESULT WrappedID3D12Device::CreateCommandQueue(const D3D12_COMMAND_QUEUE_DESC *
216216
wrapped->GetCreationRecord()->GetResourceID(), eFrameRef_Read);
217217
}
218218

219-
*ppCommandQueue = (ID3D12CommandQueue *)wrapped;
219+
if(riid == __uuidof(ID3D12CommandQueue))
220+
*ppCommandQueue = (ID3D12CommandQueue *)wrapped;
221+
else if(riid == __uuidof(ID3D12CommandQueue1))
222+
*ppCommandQueue = (ID3D12CommandQueue1 *)wrapped;
220223
}
221224
else
222225
{

renderdoc/driver/d3d12/d3d12_device_wrap9.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ HRESULT WrappedID3D12Device::CreateCommandQueue1(const D3D12_COMMAND_QUEUE_DESC
200200
wrapped->GetCreationRecord()->GetResourceID(), eFrameRef_Read);
201201
}
202202

203-
*ppCommandQueue = (ID3D12CommandQueue *)wrapped;
203+
if(riid == __uuidof(ID3D12CommandQueue))
204+
*ppCommandQueue = (ID3D12CommandQueue *)wrapped;
205+
else if(riid == __uuidof(ID3D12CommandQueue1))
206+
*ppCommandQueue = (ID3D12CommandQueue1 *)wrapped;
204207
}
205208
else
206209
{

0 commit comments

Comments
 (0)