Mesa (master): d3d12: Only play DLL path tricks on Windows
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Dec 16 16:42:47 UTC 2020
Module: Mesa
Branch: master
Commit: ed286325a0ecbf5fceeb9c8f5d5fc677154fad00
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed286325a0ecbf5fceeb9c8f5d5fc677154fad00
Author: Jesse Natalie <jenatali at microsoft.com>
Date: Wed Dec 9 17:10:45 2020 -0800
d3d12: Only play DLL path tricks on Windows
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
---
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
}
}
More information about the mesa-commit
mailing list