From 052cd255e896045e0c423004a65bb217d6f8b752 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 31 Aug 2020 10:43:19 +0100 Subject: [PATCH] Don't initialise AMD extensions during capture --- renderdoc/driver/d3d12/d3d12_device.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index cb27149b0..bc4dcc070 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -2680,20 +2680,23 @@ void WrappedID3D12Device::FreeRTV(D3D12_CPU_DESCRIPTOR_HANDLE handle) void WrappedID3D12Device::CreateInternalResources() { - // Initialise AMD extension, if possible - HMODULE mod = GetModuleHandleA("amdxc64.dll"); - - m_pAMDExtObject = NULL; - - if(mod) + if(IsReplayMode(m_State)) { - PFNAmdExtD3DCreateInterface pAmdExtD3dCreateFunc = - (PFNAmdExtD3DCreateInterface)GetProcAddress(mod, "AmdExtD3DCreateInterface"); + // Initialise AMD extension, if possible + HMODULE mod = GetModuleHandleA("amdxc64.dll"); - if(pAmdExtD3dCreateFunc != NULL) + m_pAMDExtObject = NULL; + + if(mod) { - // Initialize extension object - pAmdExtD3dCreateFunc(m_pDevice, __uuidof(IAmdExtD3DFactory), (void **)&m_pAMDExtObject); + PFNAmdExtD3DCreateInterface pAmdExtD3dCreateFunc = + (PFNAmdExtD3DCreateInterface)GetProcAddress(mod, "AmdExtD3DCreateInterface"); + + if(pAmdExtD3dCreateFunc != NULL) + { + // Initialize extension object + pAmdExtD3dCreateFunc(m_pDevice, __uuidof(IAmdExtD3DFactory), (void **)&m_pAMDExtObject); + } } }