mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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) {
|
Rc<DxvkDevice> D3D11DXGIDevice::CreateDevice(D3D_FEATURE_LEVEL FeatureLevel) {
|
||||||
DxvkDeviceFeatures deviceFeatures = D3D11Device::GetDeviceFeatures(m_dxvkAdapter, FeatureLevel);
|
DxvkDeviceFeatures deviceFeatures = D3D11Device::GetDeviceFeatures(m_dxvkAdapter, FeatureLevel);
|
||||||
|
return m_dxvkAdapter->createDevice(m_dxvkInstance, deviceFeatures);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -296,10 +296,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
auto dxvkAdapter = adapter->GetDXVKAdapter();
|
auto dxvkAdapter = adapter->GetDXVKAdapter();
|
||||||
|
|
||||||
std::string clientApi = str::format("D3D9", m_extended ? "Ex" : "");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto dxvkDevice = dxvkAdapter->createDevice(m_instance, clientApi, D3D9DeviceEx::GetDeviceFeatures(dxvkAdapter));
|
auto dxvkDevice = dxvkAdapter->createDevice(m_instance, D3D9DeviceEx::GetDeviceFeatures(dxvkAdapter));
|
||||||
|
|
||||||
auto* device = new D3D9DeviceEx(
|
auto* device = new D3D9DeviceEx(
|
||||||
this,
|
this,
|
||||||
|
@ -239,7 +239,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
Rc<DxvkDevice> DxvkAdapter::createDevice(
|
Rc<DxvkDevice> DxvkAdapter::createDevice(
|
||||||
const Rc<DxvkInstance>& instance,
|
const Rc<DxvkInstance>& instance,
|
||||||
std::string clientApi,
|
|
||||||
DxvkDeviceFeatures enabledFeatures) {
|
DxvkDeviceFeatures enabledFeatures) {
|
||||||
DxvkDeviceExtensions devExtensions;
|
DxvkDeviceExtensions devExtensions;
|
||||||
|
|
||||||
@ -379,7 +378,7 @@ namespace dxvk {
|
|||||||
if (m_vki->vkCreateDevice(m_handle, &info, nullptr, &device) != VK_SUCCESS)
|
if (m_vki->vkCreateDevice(m_handle, &info, nullptr, &device) != VK_SUCCESS)
|
||||||
throw DxvkError("DxvkAdapter: Failed to create device");
|
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),
|
new vk::DeviceFn(true, m_vki->instance(), device),
|
||||||
devExtensions, enabledFeatures);
|
devExtensions, enabledFeatures);
|
||||||
result->initResources();
|
result->initResources();
|
||||||
|
@ -194,13 +194,11 @@ namespace dxvk {
|
|||||||
*
|
*
|
||||||
* Creates a logical device for this adapter.
|
* Creates a logical device for this adapter.
|
||||||
* \param [in] instance Parent instance
|
* \param [in] instance Parent instance
|
||||||
* \param [in] clientApi Name of the client API
|
|
||||||
* \param [in] enabledFeatures Device features
|
* \param [in] enabledFeatures Device features
|
||||||
* \returns Device handle
|
* \returns Device handle
|
||||||
*/
|
*/
|
||||||
Rc<DxvkDevice> createDevice(
|
Rc<DxvkDevice> createDevice(
|
||||||
const Rc<DxvkInstance>& instance,
|
const Rc<DxvkInstance>& instance,
|
||||||
std::string clientApi,
|
|
||||||
DxvkDeviceFeatures enabledFeatures);
|
DxvkDeviceFeatures enabledFeatures);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,14 +4,12 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkDevice::DxvkDevice(
|
DxvkDevice::DxvkDevice(
|
||||||
std::string clientApi,
|
|
||||||
const Rc<DxvkInstance>& instance,
|
const Rc<DxvkInstance>& instance,
|
||||||
const Rc<DxvkAdapter>& adapter,
|
const Rc<DxvkAdapter>& adapter,
|
||||||
const Rc<vk::DeviceFn>& vkd,
|
const Rc<vk::DeviceFn>& vkd,
|
||||||
const DxvkDeviceExtensions& extensions,
|
const DxvkDeviceExtensions& extensions,
|
||||||
const DxvkDeviceFeatures& features)
|
const DxvkDeviceFeatures& features)
|
||||||
: m_clientApi (clientApi),
|
: m_options (instance->options()),
|
||||||
m_options (instance->options()),
|
|
||||||
m_instance (instance),
|
m_instance (instance),
|
||||||
m_adapter (adapter),
|
m_adapter (adapter),
|
||||||
m_vkd (vkd),
|
m_vkd (vkd),
|
||||||
|
@ -79,7 +79,6 @@ namespace dxvk {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
DxvkDevice(
|
DxvkDevice(
|
||||||
std::string clientApi,
|
|
||||||
const Rc<DxvkInstance>& instance,
|
const Rc<DxvkInstance>& instance,
|
||||||
const Rc<DxvkAdapter>& adapter,
|
const Rc<DxvkAdapter>& adapter,
|
||||||
const Rc<vk::DeviceFn>& vkd,
|
const Rc<vk::DeviceFn>& vkd,
|
||||||
@ -104,14 +103,6 @@ namespace dxvk {
|
|||||||
return m_vkd->device();
|
return m_vkd->device();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Client API
|
|
||||||
* \returns Name of the client API
|
|
||||||
*/
|
|
||||||
const std::string& clientApi() const {
|
|
||||||
return m_clientApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Device options
|
* \brief Device options
|
||||||
* \returns Device options
|
* \returns Device options
|
||||||
@ -471,7 +462,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::string m_clientApi;
|
|
||||||
DxvkOptions m_options;
|
DxvkOptions m_options;
|
||||||
|
|
||||||
Rc<DxvkInstance> m_instance;
|
Rc<DxvkInstance> m_instance;
|
||||||
|
@ -30,7 +30,6 @@ namespace dxvk::hud {
|
|||||||
| VK_COLOR_COMPONENT_A_BIT;
|
| VK_COLOR_COMPONENT_A_BIT;
|
||||||
|
|
||||||
addItem<HudVersionItem>("version");
|
addItem<HudVersionItem>("version");
|
||||||
addItem<HudClientApiItem>("api", m_device);
|
|
||||||
addItem<HudDeviceInfoItem>("devinfo", m_device);
|
addItem<HudDeviceInfoItem>("devinfo", m_device);
|
||||||
addItem<HudFpsItem>("fps");
|
addItem<HudFpsItem>("fps");
|
||||||
addItem<HudFrameTimeItem>("frametimes");
|
addItem<HudFrameTimeItem>("frametimes");
|
||||||
|
@ -80,8 +80,8 @@ namespace dxvk::hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HudClientApiItem::HudClientApiItem(const Rc<DxvkDevice>& device)
|
HudClientApiItem::HudClientApiItem(std::string api)
|
||||||
: m_device(device) {
|
: m_api(api) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ namespace dxvk::hud {
|
|||||||
renderer.drawText(16.0f,
|
renderer.drawText(16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
m_device->clientApi());
|
m_api);
|
||||||
|
|
||||||
position.y += 8.0f;
|
position.y += 8.0f;
|
||||||
return position;
|
return position;
|
||||||
|
@ -121,7 +121,7 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
HudClientApiItem(const Rc<DxvkDevice>& device);
|
HudClientApiItem(std::string api);
|
||||||
|
|
||||||
~HudClientApiItem();
|
~HudClientApiItem();
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ namespace dxvk::hud {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Rc<DxvkDevice> m_device;
|
std::string m_api;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user