mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 11:52:11 +01:00
Move Custom PCI ID to DXGI
This commit is contained in:
parent
c931b4ba87
commit
b3cd7547ca
@ -98,8 +98,24 @@ namespace dxvk {
|
|||||||
if (pDesc == nullptr)
|
if (pDesc == nullptr)
|
||||||
return DXGI_ERROR_INVALID_CALL;
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
const auto deviceProp = m_adapter->deviceProperties();
|
auto deviceProp = m_adapter->deviceProperties();
|
||||||
const auto memoryProp = m_adapter->memoryProperties();
|
auto memoryProp = m_adapter->memoryProperties();
|
||||||
|
|
||||||
|
//Custom Vendor ID
|
||||||
|
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, deviceProp.vendorID));
|
||||||
|
|
||||||
|
deviceProp.vendorID = std::stoul(customVendorID, nullptr, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!customDeviceID.empty()) {
|
||||||
|
Logger::info("Using Custom PCI Device ID " + customDeviceID + " instead of " + str::format(std::hex, deviceProp.deviceID));
|
||||||
|
|
||||||
|
deviceProp.deviceID = std::stoul(customDeviceID, nullptr, 16);
|
||||||
|
}
|
||||||
|
|
||||||
std::memset(pDesc->Description, 0, sizeof(pDesc->Description));
|
std::memset(pDesc->Description, 0, sizeof(pDesc->Description));
|
||||||
std::mbstowcs(pDesc->Description, deviceProp.deviceName, _countof(pDesc->Description) - 1);
|
std::mbstowcs(pDesc->Description, deviceProp.deviceName, _countof(pDesc->Description) - 1);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <dxvk_adapter.h>
|
#include <dxvk_adapter.h>
|
||||||
|
|
||||||
|
@ -32,21 +32,6 @@ 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),
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user