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-10 01:13:31 +08:00
|
|
|
|
#include"Window.h"
|
2019-04-11 02:29:21 +08:00
|
|
|
|
#include"VK.h"
|
2019-04-10 21:54:39 +08:00
|
|
|
|
#include"RenderSurface.h"
|
2019-04-09 00:22:26 +08:00
|
|
|
|
|
|
|
|
|
VK_NAMESPACE_BEGIN
|
|
|
|
|
class Instance
|
|
|
|
|
{
|
|
|
|
|
VkInstance inst;
|
|
|
|
|
|
2019-04-12 22:14:40 +08:00
|
|
|
|
List<VkLayerProperties> layer_properties;
|
|
|
|
|
|
|
|
|
|
VkDebugUtilsMessengerEXT debug_messenger;
|
|
|
|
|
VkDebugReportCallbackEXT debug_report_callback;
|
|
|
|
|
|
2019-04-11 02:29:21 +08:00
|
|
|
|
CharPointerList ext_list;
|
|
|
|
|
|
2019-04-10 21:54:39 +08:00
|
|
|
|
List<VkPhysicalDevice> 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-12 22:14:40 +08:00
|
|
|
|
const List<VkLayerProperties> & GetLayerProperties ()const{return layer_properties;}
|
|
|
|
|
const bool CheckLayerSupport (const UTF8String &)const;
|
|
|
|
|
const CharPointerList & GetExtList ()const {return ext_list;}
|
|
|
|
|
const List<VkPhysicalDevice> & GetDeviceList ()const {return physical_devices;}
|
|
|
|
|
VkPhysicalDevice GetDevice (int index){return GetObject(physical_devices,index);}
|
2019-04-10 14:00:06 +08:00
|
|
|
|
|
2019-04-12 22:14:40 +08:00
|
|
|
|
RenderSurface * CreateSurface (Window *,int pd_index=0);
|
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
|