diff --git a/src/dxvk/dxvk_extension_provider.cpp b/src/dxvk/dxvk_extension_provider.cpp index 520e4296..4e35eeb5 100644 --- a/src/dxvk/dxvk_extension_provider.cpp +++ b/src/dxvk/dxvk_extension_provider.cpp @@ -6,8 +6,8 @@ namespace dxvk { DxvkExtensionProviderList DxvkExtensionProvider::s_extensionProviders = { - &g_platformInstance, - &g_vrInstance + &DxvkPlatformExts::s_instance, + &VrInstance::s_instance, }; const DxvkExtensionProviderList& DxvkExtensionProvider::getExtensionProviders() { diff --git a/src/dxvk/dxvk_openvr.cpp b/src/dxvk/dxvk_openvr.cpp index 5bc29095..6a530057 100644 --- a/src/dxvk/dxvk_openvr.cpp +++ b/src/dxvk/dxvk_openvr.cpp @@ -32,7 +32,7 @@ namespace dxvk { }; VrFunctions g_vrFunctions; - VrInstance g_vrInstance; + VrInstance VrInstance::s_instance; VrInstance:: VrInstance() { } VrInstance::~VrInstance() { } diff --git a/src/dxvk/dxvk_openvr.h b/src/dxvk/dxvk_openvr.h index a8037dda..6f5554b1 100644 --- a/src/dxvk/dxvk_openvr.h +++ b/src/dxvk/dxvk_openvr.h @@ -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; diff --git a/src/dxvk/dxvk_platform_exts.h b/src/dxvk/dxvk_platform_exts.h index c192162c..9982657e 100644 --- a/src/dxvk/dxvk_platform_exts.h +++ b/src/dxvk/dxvk_platform_exts.h @@ -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; - } \ No newline at end of file diff --git a/src/dxvk/platform/dxvk_win32_exts.cpp b/src/dxvk/platform/dxvk_win32_exts.cpp index 706a1083..25c81cc5 100644 --- a/src/dxvk/platform/dxvk_win32_exts.cpp +++ b/src/dxvk/platform/dxvk_win32_exts.cpp @@ -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; + } } \ No newline at end of file