From ed286325a0ecbf5fceeb9c8f5d5fc677154fad00 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Wed, 9 Dec 2020 17:10:45 -0800 Subject: [PATCH] d3d12: Only play DLL path tricks on Windows Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/d3d12/d3d12_compiler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp index 996ea2b45df..f42ab1ecd68 100644 --- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp +++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp @@ -1137,12 +1137,15 @@ d3d12_shader_free(struct d3d12_shader_selector *sel) ralloc_free(sel); } +#ifdef _WIN32 // Used to get path to self extern "C" extern IMAGE_DOS_HEADER __ImageBase; +#endif void d3d12_validation_tools::load_dxil_dll() { if (!dxil_module.load(UTIL_DL_PREFIX "dxil" UTIL_DL_EXT)) { +#ifdef _WIN32 char selfPath[MAX_PATH] = ""; uint32_t pathSize = GetModuleFileNameA((HINSTANCE)&__ImageBase, selfPath, sizeof(selfPath)); if (pathSize == 0 || pathSize == sizeof(selfPath)) { @@ -1163,6 +1166,7 @@ void d3d12_validation_tools::load_dxil_dll() } dxil_module.load(selfPath); +#endif } }