summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-20 20:06:37 +0800
committerGitHub <noreply@github.com>2023-04-20 20:06:37 +0800
commit4d24f55226870055c8dcbb3409efc5355da134d7 (patch)
tree479c4341e38dcea2f1b9a831cf6ce0dea20234ac /source/core
parent588991f6df3d6813378721166a7260990835817e (diff)
Changes for vkd3d proton (#2813)
* Add some caches to .gitignore * Remove appendWideChars Use String::toWString instead * s/Sleep/sleepCurrentThread * formatting * Expand set of shared libraries which have buggy dlclose Work around https://github.com/microsoft/DirectXShaderCompiler/issues/5119 and https://github.com/doitsujin/dxvk/issues/3330 libdxcompiler.so invokes UB on dlclose, the dxvk libs break GDB when closed * Add assert for specialization failure on DX11 As a band aid for https://github.com/shader-slang/slang/issues/2805 * More fine grained selection of directx features
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-platform.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp
index 4f9b0698c..9185559a2 100644
--- a/source/core/slang-platform.cpp
+++ b/source/core/slang-platform.cpp
@@ -173,13 +173,24 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
/* static */SlangResult SharedLibrary::loadWithPlatformPath(char const* platformFileName, Handle& handleOut)
{
handleOut = nullptr;
- const auto dxcName = "libdxcompiler";
- const bool isDXC = strncmp(platformFileName, dxcName, strlen(dxcName)) == 0;
+ // Work around
+ // https://github.com/microsoft/DirectXShaderCompiler/issues/5119 and
+ // https://github.com/doitsujin/dxvk/issues/3330
+ // libdxcompiler.so invokes UB on dlclose, the dxvk libs break GDB when
+ // closed
+ const auto unclosableLibNames = {"libdxcompiler", "libdxvk_d3d11", "libdxvk_dxgi"};
+ bool isUnclosable = false;
+ for(auto n : unclosableLibNames)
+ {
+ if(strncmp(platformFileName, n, strlen(n)) == 0)
+ {
+ isUnclosable = true;
+ break;
+ }
+ }
if (strlen(platformFileName) == 0)
platformFileName = nullptr;
- // Work around https://github.com/microsoft/DirectXShaderCompiler/issues/5119
- // libdxcompiler.so invokes UB on dlclose
- const auto mode = RTLD_NOW | RTLD_GLOBAL | (isDXC ? RTLD_NODELETE : 0);
+ const auto mode = RTLD_NOW | RTLD_GLOBAL | (isUnclosable ? RTLD_NODELETE : 0);
void *h = dlopen(platformFileName, mode);
if (!h)
{