mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[hud] Don't initialize client API HUD item by default
Removes the client API property from the DXVK device as well. Instead, client APIs should create the HUD item manually.
This commit is contained in:
parent
ca4c03284f
commit
588beb5b2f
@ -2785,12 +2785,7 @@ namespace dxvk {
|
||||
|
||||
Rc<DxvkDevice> D3D11DXGIDevice::CreateDevice(D3D_FEATURE_LEVEL FeatureLevel) {
|
||||
DxvkDeviceFeatures deviceFeatures = D3D11Device::GetDeviceFeatures(m_dxvkAdapter, FeatureLevel);
|
||||
|
||||
uint32_t flHi = (uint32_t(FeatureLevel) >> 12);
|
||||
uint32_t flLo = (uint32_t(FeatureLevel) >> 8) & 0x7;
|
||||
|
||||
std::string apiName = str::format("D3D11 FL ", flHi, "_", flLo);
|
||||
return m_dxvkAdapter->createDevice(m_dxvkInstance, apiName, deviceFeatures);
|
||||
return m_dxvkAdapter->createDevice(m_dxvkInstance, deviceFeatures);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -296,10 +296,8 @@ namespace dxvk {
|
||||
|
||||
auto dxvkAdapter = adapter->GetDXVKAdapter();
|
||||
|
||||
std::string clientApi = str::format("D3D9", m_extended ? "Ex" : "");
|
||||
|
||||
try {
|
||||
auto dxvkDevice = dxvkAdapter->createDevice(m_instance, clientApi, D3D9DeviceEx::GetDeviceFeatures(dxvkAdapter));
|
||||
auto dxvkDevice = dxvkAdapter->createDevice(m_instance, D3D9DeviceEx::GetDeviceFeatures(dxvkAdapter));
|
||||
|
||||
auto* device = new D3D9DeviceEx(
|
||||
this,
|
||||
|
@ -239,7 +239,6 @@ namespace dxvk {
|
||||
|
||||
Rc<DxvkDevice> DxvkAdapter::createDevice(
|
||||
const Rc<DxvkInstance>& instance,
|
||||
std::string clientApi,
|
||||
DxvkDeviceFeatures enabledFeatures) {
|
||||
DxvkDeviceExtensions devExtensions;
|
||||
|
||||
@ -379,7 +378,7 @@ namespace dxvk {
|
||||
if (m_vki->vkCreateDevice(m_handle, &info, nullptr, &device) != VK_SUCCESS)
|
||||
throw DxvkError("DxvkAdapter: Failed to create device");
|
||||
|
||||
Rc<DxvkDevice> result = new DxvkDevice(clientApi, instance, this,
|
||||
Rc<DxvkDevice> result = new DxvkDevice(instance, this,
|
||||
new vk::DeviceFn(true, m_vki->instance(), device),
|
||||
devExtensions, enabledFeatures);
|
||||
result->initResources();
|
||||
|
@ -194,13 +194,11 @@ namespace dxvk {
|
||||
*
|
||||
* Creates a logical device for this adapter.
|
||||
* \param [in] instance Parent instance
|
||||
* \param [in] clientApi Name of the client API
|
||||
* \param [in] enabledFeatures Device features
|
||||
* \returns Device handle
|
||||
*/
|
||||
Rc<DxvkDevice> createDevice(
|
||||
const Rc<DxvkInstance>& instance,
|
||||
std::string clientApi,
|
||||
DxvkDeviceFeatures enabledFeatures);
|
||||
|
||||
/**
|
||||
|
@ -4,14 +4,12 @@
|
||||
namespace dxvk {
|
||||
|
||||
DxvkDevice::DxvkDevice(
|
||||
std::string clientApi,
|
||||
const Rc<DxvkInstance>& instance,
|
||||
const Rc<DxvkAdapter>& adapter,
|
||||
const Rc<vk::DeviceFn>& vkd,
|
||||
const DxvkDeviceExtensions& extensions,
|
||||
const DxvkDeviceFeatures& features)
|
||||
: m_clientApi (clientApi),
|
||||
m_options (instance->options()),
|
||||
: m_options (instance->options()),
|
||||
m_instance (instance),
|
||||
m_adapter (adapter),
|
||||
m_vkd (vkd),
|
||||
|
@ -79,7 +79,6 @@ namespace dxvk {
|
||||
public:
|
||||
|
||||
DxvkDevice(
|
||||
std::string clientApi,
|
||||
const Rc<DxvkInstance>& instance,
|
||||
const Rc<DxvkAdapter>& adapter,
|
||||
const Rc<vk::DeviceFn>& vkd,
|
||||
@ -104,14 +103,6 @@ namespace dxvk {
|
||||
return m_vkd->device();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Client API
|
||||
* \returns Name of the client API
|
||||
*/
|
||||
const std::string& clientApi() const {
|
||||
return m_clientApi;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Device options
|
||||
* \returns Device options
|
||||
@ -471,7 +462,6 @@ namespace dxvk {
|
||||
|
||||
private:
|
||||
|
||||
std::string m_clientApi;
|
||||
DxvkOptions m_options;
|
||||
|
||||
Rc<DxvkInstance> m_instance;
|
||||
|
@ -30,7 +30,6 @@ namespace dxvk::hud {
|
||||
| VK_COLOR_COMPONENT_A_BIT;
|
||||
|
||||
addItem<HudVersionItem>("version");
|
||||
addItem<HudClientApiItem>("api", m_device);
|
||||
addItem<HudDeviceInfoItem>("devinfo", m_device);
|
||||
addItem<HudFpsItem>("fps");
|
||||
addItem<HudFrameTimeItem>("frametimes");
|
||||
|
@ -80,8 +80,8 @@ namespace dxvk::hud {
|
||||
}
|
||||
|
||||
|
||||
HudClientApiItem::HudClientApiItem(const Rc<DxvkDevice>& device)
|
||||
: m_device(device) {
|
||||
HudClientApiItem::HudClientApiItem(std::string api)
|
||||
: m_api(api) {
|
||||
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ namespace dxvk::hud {
|
||||
renderer.drawText(16.0f,
|
||||
{ position.x, position.y },
|
||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||
m_device->clientApi());
|
||||
m_api);
|
||||
|
||||
position.y += 8.0f;
|
||||
return position;
|
||||
|
@ -121,7 +121,7 @@ namespace dxvk::hud {
|
||||
|
||||
public:
|
||||
|
||||
HudClientApiItem(const Rc<DxvkDevice>& device);
|
||||
HudClientApiItem(std::string api);
|
||||
|
||||
~HudClientApiItem();
|
||||
|
||||
@ -131,7 +131,7 @@ namespace dxvk::hud {
|
||||
|
||||
private:
|
||||
|
||||
Rc<DxvkDevice> m_device;
|
||||
std::string m_api;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user