shaderc_shared.dll is not found when compiling shaders. It was working on my development machine but not on a build server. I found that the code in LibraryLoader was not finding the file and falling back to the OS default and was finding it in the Vulkan SDK folder which is in PATH.
I verified this by using this code:
IntPtr handle;
#if NETSTANDARD2_0
handle = LoadPlatformLibrary(libraryPath);
#else
handle = NativeLibrary.Load(libraryPath);
#endif
if (handle == IntPtr.Zero)
throw new DllNotFoundException($"Unable to load library '{libraryName}'.");
var sbPath = new StringBuilder(1024);
var count = Win32.GetModuleFileNameA(handle, sbPath, sbPath.Capacity);
Console.WriteLine(sbPath);
[DllImport(SystemLibrary, SetLastError = true, CharSet = CharSet.Ansi)]
public static extern int GetModuleFileNameA(IntPtr hModule, StringBuilder lpFileName, int nSize);
shaderc_shared.dll is not found when compiling shaders. It was working on my development machine but not on a build server. I found that the code in
LibraryLoader
was not finding the file and falling back to the OS default and was finding it in the Vulkan SDK folder which is inPATH
.I verified this by using this code: