1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 02:52:10 +01:00

Merge pull request #171 from Guy1524/customPCI-dxgi

Move Custom PCI ID from DXVK to DXGI
This commit is contained in:
Philip Rebohle 2018-03-17 00:52:20 +01:00 committed by GitHub
commit 2dd266c90a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 19 deletions

View File

@ -98,8 +98,24 @@ namespace dxvk {
if (pDesc == nullptr)
return DXGI_ERROR_INVALID_CALL;
const auto deviceProp = m_adapter->deviceProperties();
const auto memoryProp = m_adapter->memoryProperties();
auto deviceProp = m_adapter->deviceProperties();
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::mbstowcs(pDesc->Description, deviceProp.deviceName, _countof(pDesc->Description) - 1);

View File

@ -4,6 +4,7 @@
#include <memory>
#include <unordered_map>
#include <vector>
#include <string>
#include <dxvk_adapter.h>

View File

@ -32,21 +32,6 @@ 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),

View File

@ -1,7 +1,5 @@
#pragma once
#include <string>
#include "./vulkan/dxvk_vulkan_extensions.h"
#include "dxvk_include.h"