2021-01-04 14:33:11 -06:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <mutex>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "dxvk_extension_provider.h"
|
|
|
|
|
|
|
|
#ifdef __WINE__
|
|
|
|
using SoHandle = void*;
|
|
|
|
#else
|
|
|
|
using SoHandle = HMODULE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class DxvkInstance;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief OpenXR instance
|
|
|
|
*
|
|
|
|
* Loads OpenXR to provide access to Vulkan extension queries.
|
|
|
|
*/
|
|
|
|
class DxvkXrProvider : public DxvkExtensionProvider {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxvkXrProvider();
|
|
|
|
~DxvkXrProvider();
|
|
|
|
|
|
|
|
std::string_view getName();
|
|
|
|
|
|
|
|
DxvkNameSet getInstanceExtensions();
|
|
|
|
|
|
|
|
DxvkNameSet getDeviceExtensions(
|
|
|
|
uint32_t adapterId);
|
|
|
|
|
|
|
|
void initInstanceExtensions();
|
|
|
|
|
|
|
|
void initDeviceExtensions(
|
|
|
|
const DxvkInstance* instance);
|
|
|
|
|
|
|
|
static DxvkXrProvider s_instance;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2021-06-28 19:19:29 +02:00
|
|
|
dxvk::mutex m_mutex;
|
2021-01-04 14:33:11 -06:00
|
|
|
SoHandle m_wineOxr = nullptr;
|
|
|
|
|
|
|
|
bool m_loadedOxrApi = false;
|
|
|
|
bool m_initializedInsExt = false;
|
|
|
|
bool m_initializedDevExt = false;
|
|
|
|
|
|
|
|
DxvkNameSet m_insExtensions;
|
|
|
|
DxvkNameSet m_devExtensions;
|
|
|
|
|
|
|
|
DxvkNameSet queryInstanceExtensions() const;
|
|
|
|
|
|
|
|
DxvkNameSet queryDeviceExtensions() const;
|
|
|
|
|
|
|
|
DxvkNameSet parseExtensionList(
|
|
|
|
const std::string& str) const;
|
|
|
|
|
|
|
|
bool loadFunctions();
|
|
|
|
|
|
|
|
void shutdown();
|
|
|
|
|
|
|
|
SoHandle loadLibrary();
|
|
|
|
|
|
|
|
void freeLibrary();
|
|
|
|
|
|
|
|
void* getSym(const char* sym);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|