2018-09-10 13:21:02 +10:00
|
|
|
#pragma once
|
|
|
|
|
2019-01-05 23:30:52 +11:00
|
|
|
#include <cruft/vk/vk.hpp>
|
2019-03-03 11:53:31 +11:00
|
|
|
#include <cruft/vk/load/vtable.hpp>
|
2018-09-10 13:21:02 +10:00
|
|
|
|
|
|
|
#include <cruft/util/library.hpp>
|
2019-03-02 22:47:03 +11:00
|
|
|
#include <cruft/util/std.hpp>
|
2018-09-10 13:21:02 +10:00
|
|
|
|
|
|
|
#include <string>
|
2018-12-05 19:12:03 +11:00
|
|
|
#include <filesystem>
|
2018-09-10 13:21:02 +10:00
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2019-03-03 11:53:31 +11:00
|
|
|
namespace cruft::vk::load {
|
2018-09-10 13:21:02 +10:00
|
|
|
struct icd_t {
|
|
|
|
std::string file_format_version;
|
|
|
|
struct {
|
2018-12-05 19:12:03 +11:00
|
|
|
std::filesystem::path library_path;
|
2018-09-10 13:21:02 +10:00
|
|
|
std::string api_version;
|
|
|
|
} icd;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<icd_t>
|
2019-03-03 12:18:58 +11:00
|
|
|
enumerate [[gnu::visibility("default")]] (void);
|
2018-09-10 13:21:02 +10:00
|
|
|
|
|
|
|
|
2019-03-02 22:47:03 +11:00
|
|
|
struct vendor_table {
|
|
|
|
VkResult (*vk_icdNegotiateLoaderICDInterfaceVersion)(u32*) = nullptr;
|
|
|
|
void* (*vk_icdGetInstanceProcAddr) (VkInstance, char const*) = nullptr;
|
|
|
|
void* (*vk_icdGetPhysicalDeviceProcAddr) (VkInstance, char const*) = nullptr;
|
|
|
|
};
|
|
|
|
|
2019-03-03 12:18:58 +11:00
|
|
|
class [[gnu::visibility("default")]] vendor {
|
2018-09-10 13:21:02 +10:00
|
|
|
public:
|
|
|
|
vendor (icd_t const&);
|
|
|
|
vendor (::cruft::library &&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
::cruft::library m_library;
|
|
|
|
|
|
|
|
public:
|
2019-03-02 22:47:03 +11:00
|
|
|
vendor_table vtable;
|
|
|
|
instance_table itable;
|
|
|
|
u32 version = 0;
|
2018-09-10 13:21:02 +10:00
|
|
|
};
|
|
|
|
}
|