| 71 | } |
| 72 | |
| 73 | HRESULT STDMETHODCALLTYPE D3D12CommandQueue::QueryInterface(REFIID riid, void **ppvObj) |
| 74 | { |
| 75 | if (ppvObj == nullptr) |
| 76 | return E_POINTER; |
| 77 | |
| 78 | if (check_and_upgrade_interface(riid)) |
| 79 | { |
| 80 | AddRef(); |
| 81 | *ppvObj = this; |
| 82 | return S_OK; |
| 83 | } |
| 84 | |
| 85 | // Interface ID to query the original object from a proxy object |
| 86 | if (riid == IID_UnwrappedObject) |
| 87 | { |
| 88 | _orig->AddRef(); |
| 89 | *ppvObj = _orig; |
| 90 | return S_OK; |
| 91 | } |
| 92 | |
| 93 | // Special case for d3d12on7 |
| 94 | if (riid == __uuidof(ID3D12CommandQueueDownlevel)) // {38A8C5EF-7CCB-4E81-914F-A6E9D072C494} |
| 95 | { |
| 96 | if (_downlevel == nullptr) |
| 97 | { |
| 98 | // Not a 'com_ptr' since D3D12CommandQueueDownlevel will take ownership |
| 99 | ID3D12CommandQueueDownlevel *downlevel = nullptr; |
| 100 | if (SUCCEEDED(_orig->QueryInterface(&downlevel))) |
| 101 | _downlevel = new D3D12CommandQueueDownlevel(this, downlevel); |
| 102 | } |
| 103 | |
| 104 | if (_downlevel != nullptr) |
| 105 | return _downlevel->QueryInterface(riid, ppvObj); |
| 106 | return E_NOINTERFACE; |
| 107 | } |
| 108 | |
| 109 | return _orig->QueryInterface(riid, ppvObj); |
| 110 | } |
| 111 | ULONG STDMETHODCALLTYPE D3D12CommandQueue::AddRef() |
| 112 | { |
| 113 | _orig->AddRef(); |
no test coverage detected