mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxvk] Pass DXVK instance to DXVK device directly, not through the adapter
This commit is contained in:
parent
212f5ba1f3
commit
b2317cad4d
@ -2814,7 +2814,7 @@ namespace dxvk {
|
|||||||
uint32_t flLo = (uint32_t(FeatureLevel) >> 8) & 0x7;
|
uint32_t flLo = (uint32_t(FeatureLevel) >> 8) & 0x7;
|
||||||
|
|
||||||
std::string apiName = str::format("D3D11 FL ", flHi, "_", flLo);
|
std::string apiName = str::format("D3D11 FL ", flHi, "_", flLo);
|
||||||
return m_dxvkAdapter->createDevice(apiName, deviceFeatures);
|
return m_dxvkAdapter->createDevice(m_dxvkInstance, apiName, deviceFeatures);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,10 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rc<DxvkDevice> DxvkAdapter::createDevice(std::string clientApi, DxvkDeviceFeatures enabledFeatures) {
|
Rc<DxvkDevice> DxvkAdapter::createDevice(
|
||||||
|
const Rc<DxvkInstance>& instance,
|
||||||
|
std::string clientApi,
|
||||||
|
DxvkDeviceFeatures enabledFeatures) {
|
||||||
DxvkDeviceExtensions devExtensions;
|
DxvkDeviceExtensions devExtensions;
|
||||||
|
|
||||||
std::array<DxvkExt*, 25> devExtensionList = {{
|
std::array<DxvkExt*, 25> devExtensionList = {{
|
||||||
@ -390,7 +393,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, this,
|
Rc<DxvkDevice> result = new DxvkDevice(clientApi, 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();
|
||||||
|
@ -199,11 +199,13 @@ namespace dxvk {
|
|||||||
* \brief Creates a DXVK device
|
* \brief Creates a DXVK device
|
||||||
*
|
*
|
||||||
* Creates a logical device for this adapter.
|
* Creates a logical device for this adapter.
|
||||||
|
* \param [in] instance Parent instance
|
||||||
* \param [in] clientApi Name of the client API
|
* \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,
|
||||||
std::string clientApi,
|
std::string clientApi,
|
||||||
DxvkDeviceFeatures enabledFeatures);
|
DxvkDeviceFeatures enabledFeatures);
|
||||||
|
|
||||||
|
@ -5,12 +5,14 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkDevice::DxvkDevice(
|
DxvkDevice::DxvkDevice(
|
||||||
std::string clientApi,
|
std::string clientApi,
|
||||||
|
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_clientApi (clientApi),
|
||||||
m_options (adapter->instance()->options()),
|
m_options (instance->options()),
|
||||||
|
m_instance (instance),
|
||||||
m_adapter (adapter),
|
m_adapter (adapter),
|
||||||
m_vkd (vkd),
|
m_vkd (vkd),
|
||||||
m_extensions (extensions),
|
m_extensions (extensions),
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "dxvk_extensions.h"
|
#include "dxvk_extensions.h"
|
||||||
#include "dxvk_framebuffer.h"
|
#include "dxvk_framebuffer.h"
|
||||||
#include "dxvk_image.h"
|
#include "dxvk_image.h"
|
||||||
|
#include "dxvk_instance.h"
|
||||||
#include "dxvk_memory.h"
|
#include "dxvk_memory.h"
|
||||||
#include "dxvk_meta_clear.h"
|
#include "dxvk_meta_clear.h"
|
||||||
#include "dxvk_objects.h"
|
#include "dxvk_objects.h"
|
||||||
@ -79,6 +80,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkDevice(
|
DxvkDevice(
|
||||||
std::string clientApi,
|
std::string clientApi,
|
||||||
|
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,
|
||||||
@ -138,6 +140,16 @@ namespace dxvk {
|
|||||||
!= m_queues.graphics.queueHandle;
|
!= m_queues.graphics.queueHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The instance
|
||||||
|
*
|
||||||
|
* The DXVK instance that created this device.
|
||||||
|
* \returns Instance
|
||||||
|
*/
|
||||||
|
Rc<DxvkInstance> instance() const {
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief The adapter
|
* \brief The adapter
|
||||||
*
|
*
|
||||||
@ -456,6 +468,7 @@ namespace dxvk {
|
|||||||
std::string m_clientApi;
|
std::string m_clientApi;
|
||||||
DxvkOptions m_options;
|
DxvkOptions m_options;
|
||||||
|
|
||||||
|
Rc<DxvkInstance> m_instance;
|
||||||
Rc<DxvkAdapter> m_adapter;
|
Rc<DxvkAdapter> m_adapter;
|
||||||
Rc<vk::DeviceFn> m_vkd;
|
Rc<vk::DeviceFn> m_vkd;
|
||||||
DxvkDeviceExtensions m_extensions;
|
DxvkDeviceExtensions m_extensions;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#include "../util/config/config.h"
|
#include "../util/config/config.h"
|
||||||
|
|
||||||
#include "dxvk_adapter.h"
|
#include "dxvk_adapter.h"
|
||||||
#include "dxvk_device.h"
|
|
||||||
#include "dxvk_device_filter.h"
|
#include "dxvk_device_filter.h"
|
||||||
|
#include "dxvk_options.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user