diff options
| author | edupode <30982306+edupode@users.noreply.github.com> | 2026-11-22 16:38:48 +0000 |
|---|---|---|
| committer | edupode <30982306+edupode@users.noreply.github.com> | 2026-11-22 16:40:23 +0000 |
| commit | bec58c9aacaaaf0f4fbd6192a4cb3c410493392b (patch) | |
| tree | fc2d91592fbae1c5345e2242af490311590e760d /runtime/shims/dxgi_com.cpp | |
| parent | 49475796c226c8511b9470bf97a4daf57b8af323 (diff) | |
fix: return parent device from DXGI swapchain
Diffstat (limited to 'runtime/shims/dxgi_com.cpp')
| -rw-r--r-- | runtime/shims/dxgi_com.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/shims/dxgi_com.cpp b/runtime/shims/dxgi_com.cpp index 47a53f7a2..bb1484024 100644 --- a/runtime/shims/dxgi_com.cpp +++ b/runtime/shims/dxgi_com.cpp | |||
| @@ -178,7 +178,15 @@ public: | |||
| 178 | HRESULT STDMETHODCALLTYPE GetDevice(REFIID riid, void** out) override { | 178 | HRESULT STDMETHODCALLTYPE GetDevice(REFIID riid, void** out) override { |
| 179 | if (!out) return E_POINTER; | 179 | if (!out) return E_POINTER; |
| 180 | *out = nullptr; | 180 | *out = nullptr; |
| 181 | return device_ ? device_->QueryInterface(riid, out) : E_NOINTERFACE; | 181 | if (!device_) return E_NOINTERFACE; |
| 182 | |||
| 183 | ID3D12DeviceChild* device_child = nullptr; | ||
| 184 | if (SUCCEEDED(device_->QueryInterface(IID_PPV_ARGS(&device_child)))) { | ||
| 185 | const HRESULT hr = device_child->GetDevice(riid, out); | ||
| 186 | device_child->Release(); | ||
| 187 | return hr; | ||
| 188 | } | ||
| 189 | return device_->QueryInterface(riid, out); | ||
| 182 | } | 190 | } |
| 183 | 191 | ||
| 184 | // IDXGISwapChain | 192 | // IDXGISwapChain |