48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <cruft/vk/vk.hpp>
|
|
#include <cruft/vk/icd/vtable.hpp>
|
|
|
|
#include <cruft/util/library.hpp>
|
|
#include <cruft/util/std.hpp>
|
|
|
|
#include <string>
|
|
#include <filesystem>
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
namespace cruft::vk::icd {
|
|
struct icd_t {
|
|
std::string file_format_version;
|
|
struct {
|
|
std::filesystem::path library_path;
|
|
std::string api_version;
|
|
} icd;
|
|
};
|
|
|
|
|
|
std::vector<icd_t>
|
|
enumerate (void);
|
|
|
|
|
|
struct vendor_table {
|
|
VkResult (*vk_icdNegotiateLoaderICDInterfaceVersion)(u32*) = nullptr;
|
|
void* (*vk_icdGetInstanceProcAddr) (VkInstance, char const*) = nullptr;
|
|
void* (*vk_icdGetPhysicalDeviceProcAddr) (VkInstance, char const*) = nullptr;
|
|
};
|
|
|
|
class vendor {
|
|
public:
|
|
vendor (icd_t const&);
|
|
vendor (::cruft::library &&);
|
|
|
|
private:
|
|
::cruft::library m_library;
|
|
|
|
public:
|
|
vendor_table vtable;
|
|
instance_table itable;
|
|
u32 version = 0;
|
|
};
|
|
}
|