Skip to content

Commit

Permalink
vulkan: Try loading winevulkan.dll before vulkan-1.dll
Browse files Browse the repository at this point in the history
This correlates to doitsujin/dxvk@4d0d455
DXVK and DXVK-NVAPI must use the same Vulkan module since Vulkan handles
exposed by DXVK are used with the Vulkan module loaded by DXVK-NVAPI.

Also log which module has been loaded.
  • Loading branch information
jp7677 committed Jan 21, 2023
1 parent 21a88ea commit ac00a42
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/sysinfo/vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@

namespace dxvk {
Vulkan::Vulkan() {
const auto vkModuleName = "vulkan-1.dll";
const auto vkModuleName = "winevulkan.dll";
const auto vkModuleNameFallback = "vulkan-1.dll";

m_vkModule = ::LoadLibraryA(vkModuleName);
if (m_vkModule != nullptr)
log::write(str::format("Successfully loaded ", vkModuleName));

if (m_vkModule == nullptr && ::GetLastError() == ERROR_MOD_NOT_FOUND) {
m_vkModule = ::LoadLibraryA(vkModuleNameFallback);
if (m_vkModule != nullptr)
log::write(str::format("Successfully loaded ", vkModuleNameFallback));
}

if (m_vkModule == nullptr) {
log::write(str::format("Loading ", vkModuleName, " failed with error code: ", ::GetLastError()));
return;
Expand Down

0 comments on commit ac00a42

Please sign in to comment.