From 0ef09300bbca9ced3eaef161f4e3dcbc16e6d12c Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 20 May 2021 10:12:46 +0100 Subject: [PATCH] Fix code not setting return value for cached dxc module --- renderdoc/driver/d3d12/d3d12_shader_cache.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_shader_cache.cpp b/renderdoc/driver/d3d12/d3d12_shader_cache.cpp index 4f6b098b8..c7262522a 100644 --- a/renderdoc/driver/d3d12/d3d12_shader_cache.cpp +++ b/renderdoc/driver/d3d12/d3d12_shader_cache.cpp @@ -68,7 +68,10 @@ static HMODULE GetDXC() rdcstr path = StringFormat::Wide2UTF8(dxilPath); HMODULE dxcompiler = (HMODULE)Process::LoadModule(get_dirname(path) + "/dxcompiler.dll"); if(dxcompiler) - return dxcompiler; + { + ret = dxcompiler; + return ret; + } } // don't try to load dxcompiler.dll until we've got dxil.dll successfully, or if we're not @@ -79,7 +82,10 @@ static HMODULE GetDXC() HMODULE dxcompiler = (HMODULE)Process::LoadModule(LocatePluginFile("d3d12", "dxcompiler.dll")); if(dxcompiler) - return dxcompiler; + { + ret = dxcompiler; + return ret; + } } // if we didn't find dxcompiler but did find dxil, somehow, then unload it