mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 04:29:14 +01:00
Add Custom PCI Vendor and Device ID Support (#137)
* Add Custom PCI Vendor and Device ID Support Allow the user to configure DXVK to use a custom PCI Vendor and Device ID, so that the program behaves the same on different cards. * Remove AMD/NVIDIA/INTEL Shortcuts * Remove extra semicolon * Return DxvkGpuVendor to being an enum class * Fixed hexadecimal output
This commit is contained in:
parent
3dad074fc4
commit
1bad90ae96
@ -32,6 +32,21 @@ namespace dxvk {
|
|||||||
VkPhysicalDeviceProperties properties;
|
VkPhysicalDeviceProperties properties;
|
||||||
m_vki->vkGetPhysicalDeviceProperties(m_handle, &properties);
|
m_vki->vkGetPhysicalDeviceProperties(m_handle, &properties);
|
||||||
|
|
||||||
|
const std::string customVendorID = env::getEnvVar(L"DXVK_CUSTOM_VENDOR_ID");
|
||||||
|
const std::string customDeviceID = env::getEnvVar(L"DXVK_CUSTOM_DEVICE_ID");
|
||||||
|
|
||||||
|
if (!customVendorID.empty()) {
|
||||||
|
Logger::info("Using Custom PCI Vendor ID " + customVendorID + " instead of " + str::format(std::hex, properties.vendorID));
|
||||||
|
|
||||||
|
properties.vendorID = std::stoul(customVendorID, nullptr, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!customDeviceID.empty()) {
|
||||||
|
Logger::info("Using Custom PCI Device ID " + customDeviceID + " instead of " + str::format(std::hex, properties.deviceID));
|
||||||
|
|
||||||
|
properties.deviceID = std::stoul(customDeviceID, nullptr, 16);
|
||||||
|
}
|
||||||
|
|
||||||
if (DxvkGpuVendor(properties.vendorID) == DxvkGpuVendor::Nvidia) {
|
if (DxvkGpuVendor(properties.vendorID) == DxvkGpuVendor::Nvidia) {
|
||||||
properties.driverVersion = VK_MAKE_VERSION(
|
properties.driverVersion = VK_MAKE_VERSION(
|
||||||
VK_VERSION_MAJOR(properties.driverVersion),
|
VK_VERSION_MAJOR(properties.driverVersion),
|
||||||
@ -238,4 +253,4 @@ namespace dxvk {
|
|||||||
Logger::info(str::format(" ", names.name(i)));
|
Logger::info(str::format(" ", names.name(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "./vulkan/dxvk_vulkan_extensions.h"
|
#include "./vulkan/dxvk_vulkan_extensions.h"
|
||||||
|
|
||||||
#include "dxvk_include.h"
|
#include "dxvk_include.h"
|
||||||
@ -167,4 +169,4 @@ namespace dxvk {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user