2019-04-09 00:22:26 +08:00
|
|
|
|
#ifndef HGL_GRAPH_VULKAN_INSTANCE_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_VULKAN_INSTANCE_INCLUDE
|
|
|
|
|
|
|
|
|
|
#include<hgl/type/BaseString.h>
|
2019-04-09 02:02:43 +08:00
|
|
|
|
#include<hgl/type/List.h>
|
2019-04-30 16:42:59 +08:00
|
|
|
|
#include<hgl/platform/Window.h>
|
|
|
|
|
#include<hgl/graph/vulkan/VK.h>
|
2019-04-09 00:22:26 +08:00
|
|
|
|
|
|
|
|
|
VK_NAMESPACE_BEGIN
|
2019-04-18 22:10:24 +08:00
|
|
|
|
struct PhysicalDevice;
|
|
|
|
|
class Device;
|
|
|
|
|
|
2019-04-09 00:22:26 +08:00
|
|
|
|
class Instance
|
|
|
|
|
{
|
|
|
|
|
VkInstance inst;
|
|
|
|
|
|
2019-04-12 22:14:40 +08:00
|
|
|
|
List<VkLayerProperties> layer_properties;
|
2019-04-13 15:34:34 +08:00
|
|
|
|
List<VkExtensionProperties> extension_properties;
|
2019-04-12 22:14:40 +08:00
|
|
|
|
|
|
|
|
|
VkDebugUtilsMessengerEXT debug_messenger;
|
|
|
|
|
VkDebugReportCallbackEXT debug_report_callback;
|
|
|
|
|
|
2019-04-11 02:29:21 +08:00
|
|
|
|
CharPointerList ext_list;
|
|
|
|
|
|
2019-04-13 21:44:26 +08:00
|
|
|
|
ObjectList<PhysicalDevice> physical_devices;
|
2019-04-09 02:02:43 +08:00
|
|
|
|
|
2019-04-09 00:22:26 +08:00
|
|
|
|
private:
|
|
|
|
|
|
2019-04-11 02:29:21 +08:00
|
|
|
|
friend Instance *CreateInstance(const UTF8String &app_name);
|
|
|
|
|
|
|
|
|
|
Instance(VkInstance,CharPointerList &);
|
2019-04-09 00:22:26 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual ~Instance();
|
|
|
|
|
|
2019-04-12 22:14:40 +08:00
|
|
|
|
VkInstance GetVkInstance () {return inst;}
|
2019-04-09 02:02:43 +08:00
|
|
|
|
|
2019-04-13 21:51:36 +08:00
|
|
|
|
const List<VkLayerProperties> & GetLayerProperties ()const {return layer_properties;}
|
2019-04-12 22:14:40 +08:00
|
|
|
|
const bool CheckLayerSupport (const UTF8String &)const;
|
|
|
|
|
const CharPointerList & GetExtList ()const {return ext_list;}
|
2019-04-13 21:44:26 +08:00
|
|
|
|
const ObjectList<PhysicalDevice> &GetDeviceList ()const {return physical_devices;}
|
|
|
|
|
const PhysicalDevice * GetDevice (VkPhysicalDeviceType)const;
|
2019-04-10 14:00:06 +08:00
|
|
|
|
|
2019-04-18 16:06:44 +08:00
|
|
|
|
Device * CreateRenderDevice (Window *,const PhysicalDevice *pd=nullptr);
|
2019-04-09 00:22:26 +08:00
|
|
|
|
};//class Instance
|
2019-04-11 02:29:21 +08:00
|
|
|
|
|
|
|
|
|
Instance *CreateInstance(const UTF8String &); ///<创建一个Vulkan实例
|
2019-04-09 00:22:26 +08:00
|
|
|
|
VK_NAMESPACE_END
|
|
|
|
|
#endif//HGL_GRAPH_VULKAN_INSTANCE_INCLUDE
|