1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxvk] Pass description of the client API to the DXVK device

This commit is contained in:
Philip Rebohle 2019-02-15 17:38:52 +01:00
parent cbaeca8f43
commit 10123ce9ab
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 23 additions and 4 deletions

View File

@ -1964,7 +1964,12 @@ namespace dxvk {
Rc<DxvkDevice> D3D11DXGIDevice::CreateDevice(D3D_FEATURE_LEVEL FeatureLevel) {
DxvkDeviceFeatures deviceFeatures = D3D11Device::GetDeviceFeatures(m_dxvkAdapter, FeatureLevel);
return m_dxvkAdapter->createDevice(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(apiName, deviceFeatures);
}
}

View File

@ -231,7 +231,7 @@ namespace dxvk {
}
Rc<DxvkDevice> DxvkAdapter::createDevice(DxvkDeviceFeatures enabledFeatures) {
Rc<DxvkDevice> DxvkAdapter::createDevice(std::string clientApi, DxvkDeviceFeatures enabledFeatures) {
DxvkDeviceExtensions devExtensions;
std::array<DxvkExt*, 15> devExtensionList = {{
@ -337,7 +337,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(this,
Rc<DxvkDevice> result = new DxvkDevice(clientApi, this,
new vk::DeviceFn(true, m_vki->instance(), device),
devExtensions, enabledFeatures);
result->initResources();

View File

@ -197,10 +197,12 @@ namespace dxvk {
* \brief Creates a DXVK device
*
* Creates a logical device for this adapter.
* \param [in] clientApi Name of the client API
* \param [in] enabledFeatures Device features
* \returns Device handle
*/
Rc<DxvkDevice> createDevice(
std::string clientApi,
DxvkDeviceFeatures enabledFeatures);
/**

View File

@ -4,11 +4,13 @@
namespace dxvk {
DxvkDevice::DxvkDevice(
std::string clientApi,
const Rc<DxvkAdapter>& adapter,
const Rc<vk::DeviceFn>& vkd,
const DxvkDeviceExtensions& extensions,
const DxvkDeviceFeatures& features)
: m_options (adapter->instance()->options()),
: m_clientApi (clientApi),
m_options (adapter->instance()->options()),
m_adapter (adapter),
m_vkd (vkd),
m_extensions (extensions),

View File

@ -64,6 +64,7 @@ namespace dxvk {
public:
DxvkDevice(
std::string clientApi,
const Rc<DxvkAdapter>& adapter,
const Rc<vk::DeviceFn>& vkd,
const DxvkDeviceExtensions& extensions,
@ -87,6 +88,14 @@ 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
@ -369,6 +378,7 @@ namespace dxvk {
private:
std::string m_clientApi;
DxvkOptions m_options;
Rc<DxvkAdapter> m_adapter;