[dxvk] Use static variables for extension provider instances

Also, remove redundant interface documentation.
This commit is contained in:
Philip Rebohle 2019-11-07 01:35:10 +01:00
parent dbf2407fd3
commit b18c50d5ab
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
5 changed files with 14 additions and 68 deletions

View File

@ -6,8 +6,8 @@
namespace dxvk {
DxvkExtensionProviderList DxvkExtensionProvider::s_extensionProviders = {
&g_platformInstance,
&g_vrInstance
&DxvkPlatformExts::s_instance,
&VrInstance::s_instance,
};
const DxvkExtensionProviderList& DxvkExtensionProvider::getExtensionProviders() {

View File

@ -32,7 +32,7 @@ namespace dxvk {
};
VrFunctions g_vrFunctions;
VrInstance g_vrInstance;
VrInstance VrInstance::s_instance;
VrInstance:: VrInstance() { }
VrInstance::~VrInstance() { }

View File

@ -33,47 +33,20 @@ namespace dxvk {
VrInstance();
~VrInstance();
/**
* \brief Extension provider name
* \returns The extension provider's name
*/
std::string_view getName();
/**
* \brief Query instance extensions
* \returns Instance extensions
*/
DxvkNameSet getInstanceExtensions();
/**
* \brief Query device extensions
*
* Retrieves the extensions required for a specific
* physical device. The adapter index should remain
* the same across multiple Vulkan instances.
* \param [in] adapterId Adapter index
*/
DxvkNameSet getDeviceExtensions(
uint32_t adapterId);
/**
* \brief Initializes instance extension set
*
* Should be called before creating
* the first Vulkan instance.
*/
void initInstanceExtensions();
/**
* \brief Initializes device extension sets
*
* Should be called after setting
* up the Vulkan physical devices.
* \param [in] instance DXVK instance
*/
void initDeviceExtensions(
const DxvkInstance* instance);
static VrInstance s_instance;
private:
std::mutex m_mutex;

View File

@ -6,48 +6,19 @@ namespace dxvk {
public:
/**
* \brief Extension provider name
* \returns The extension provider's name
*/
std::string_view getName();
/**
* \brief Query instance extensions
* \returns Instance extensions
*/
DxvkNameSet getInstanceExtensions();
/**
* \brief Query device extensions
*
* Retrieves the extensions required for a specific
* physical device. The adapter index should remain
* the same across multiple Vulkan instances.
* \param [in] adapterId Adapter index
*/
DxvkNameSet getDeviceExtensions(
uint32_t adapterId);
/**
* \brief Initializes instance extension set
*
* Should be called before creating
* the first Vulkan instance.
*/
void initInstanceExtensions();
/**
* \brief Initializes device extension sets
*
* Should be called after setting
* up the Vulkan physical devices.
* \param [in] instance DXVK instance
*/
void initDeviceExtensions(
const DxvkInstance* instance);
static DxvkPlatformExts s_instance;
};
extern DxvkPlatformExts g_platformInstance;
}

View File

@ -2,6 +2,7 @@
namespace dxvk {
DxvkPlatformExts DxvkPlatformExts::s_instance;
std::string_view DxvkPlatformExts::getName() {
return "Win32 WSI";
@ -20,15 +21,16 @@ namespace dxvk {
uint32_t adapterId) {
return DxvkNameSet();
}
void DxvkPlatformExts::initInstanceExtensions() {}
void DxvkPlatformExts::initInstanceExtensions() {
}
void DxvkPlatformExts::initDeviceExtensions(
const DxvkInstance* instance) {}
const DxvkInstance* instance) {
DxvkPlatformExts g_platformInstance;
}
}