mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-03 13:24:20 +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;
|
||||
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) {
|
||||
properties.driverVersion = VK_MAKE_VERSION(
|
||||
VK_VERSION_MAJOR(properties.driverVersion),
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "./vulkan/dxvk_vulkan_extensions.h"
|
||||
|
||||
#include "dxvk_include.h"
|
||||
|
Loading…
Reference in New Issue
Block a user