From 4c2484cdef99419a3ea40188bb648a617e6819c9 Mon Sep 17 00:00:00 2001 From: Nemirtingas Date: Mon, 9 Dec 2019 11:06:43 +0000 Subject: [PATCH] Update Renderer_Detector.cpp DX12 hook --- overlay_experimental/Renderer_Detector.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/overlay_experimental/Renderer_Detector.cpp b/overlay_experimental/Renderer_Detector.cpp index b684c9a..32893c6 100644 --- a/overlay_experimental/Renderer_Detector.cpp +++ b/overlay_experimental/Renderer_Detector.cpp @@ -93,22 +93,28 @@ HRESULT STDMETHODCALLTYPE Renderer_Detector::MyIDXGISwapChain_Present(IDXGISwapC } if (pDevice) { - DX10_Hook::Inst()->start_hook(); + DX12_Hook::Inst()->start_hook(); } else { - _this->GetDevice(IID_PPV_ARGS(reinterpret_cast(&pDevice))); + if (inst._dx11_hooked) + { + _this->GetDevice(IID_PPV_ARGS(reinterpret_cast(&pDevice))); + } if (pDevice) { DX11_Hook::Inst()->start_hook(); } else { - //_this->GetDevice(IID_PPV_ARGS(reinterpret_cast(&pDevice))); - //if (pDevice) - //{ - // DX12_Hook::Inst()->start_hook(); - //} + if (inst._dx10_hooked) + { + _this->GetDevice(IID_PPV_ARGS(reinterpret_cast(&pDevice))); + } + if (pDevice) + { + DX10_Hook::Inst()->start_hook(); + } } } if (pDevice) pDevice->Release();