From 7967150722087fa8e33cdc7777c948b840caf3e1 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Fri, 28 Jul 2023 20:17:46 +0800 Subject: [PATCH] upgraded codes and then it can run. --- CMCore | 2 +- CMPlatform | 2 +- CMSceneGraph | 2 +- CMUtil | 2 +- example/common/VulkanAppFramework.h | 1 + inc/hgl/graph/SceneNode.h | 2 +- inc/hgl/graph/TextureLoader.h | 2 +- inc/hgl/graph/TileData.h | 21 ++----------- inc/hgl/graph/VK.h | 1 + inc/hgl/graph/VKCommandBuffer.h | 2 +- inc/hgl/graph/VKDescriptorBindingManage.h | 1 + inc/hgl/graph/VKDescriptorSet.h | 1 + inc/hgl/graph/VKDevice.h | 3 +- inc/hgl/graph/VKInstance.h | 2 +- inc/hgl/graph/VKRenderPass.h | 2 +- inc/hgl/graph/VKRenderResource.h | 18 +++++------ inc/hgl/graph/VKTexture.h | 2 +- inc/hgl/graph/font/TileFont.h | 2 ++ src/SceneGraph/CMakeLists.txt | 25 +++++++++++++++- src/SceneGraph/MaterialRenderList.cpp | 2 +- src/SceneGraph/TileData.cpp | 2 +- src/SceneGraph/Vulkan/Debug/VKDebugMaker.cpp | 4 +-- src/SceneGraph/Vulkan/Debug/VKDebugUtils.cpp | 8 ++--- .../Vulkan/Platform/AndroidVulkan.cpp | 29 ++++++++++++++++++ src/SceneGraph/Vulkan/Platform/MacVulkan.cpp | 29 ++++++++++++++++++ .../Vulkan/Platform/WaylandVulkan.cpp | 30 +++++++++++++++++++ src/SceneGraph/Vulkan/Platform/WinVulkan.cpp | 30 +++++++++++++++++++ src/SceneGraph/Vulkan/Platform/XCBVulkan.cpp | 30 +++++++++++++++++++ src/SceneGraph/Vulkan/Platform/iOSVulkan.cpp | 29 ++++++++++++++++++ src/SceneGraph/Vulkan/VKDeviceBuffer.cpp | 1 + src/SceneGraph/Vulkan/VKDeviceCreater.cpp | 1 + src/SceneGraph/Vulkan/VKDeviceMaterial.cpp | 1 + src/SceneGraph/Vulkan/VKDeviceSwapchain.cpp | 1 + src/SceneGraph/Vulkan/VKRenderable.cpp | 1 + src/ShaderGen/ShaderCreateInfo.cpp | 4 ++- 35 files changed, 247 insertions(+), 48 deletions(-) create mode 100644 src/SceneGraph/Vulkan/Platform/AndroidVulkan.cpp create mode 100644 src/SceneGraph/Vulkan/Platform/MacVulkan.cpp create mode 100644 src/SceneGraph/Vulkan/Platform/WaylandVulkan.cpp create mode 100644 src/SceneGraph/Vulkan/Platform/WinVulkan.cpp create mode 100644 src/SceneGraph/Vulkan/Platform/XCBVulkan.cpp create mode 100644 src/SceneGraph/Vulkan/Platform/iOSVulkan.cpp diff --git a/CMCore b/CMCore index ca3f7eb5..116799bc 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit ca3f7eb55f9e4c1fad44993b70a473f8e3c2ed00 +Subproject commit 116799bc4ea02ffe85e8cb071272b1cddc2753c1 diff --git a/CMPlatform b/CMPlatform index fdd40d7c..618fda25 160000 --- a/CMPlatform +++ b/CMPlatform @@ -1 +1 @@ -Subproject commit fdd40d7c7685c674541279154f0decb3fe156c36 +Subproject commit 618fda25036a1949de990d0588e87f838f15e6c8 diff --git a/CMSceneGraph b/CMSceneGraph index 65ef7052..1c67c9e3 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 65ef7052d162225a03e96a895586c3492ddd7447 +Subproject commit 1c67c9e3ac8d7ccf6c05e9b67ad525a8d94fc496 diff --git a/CMUtil b/CMUtil index f4d19fc8..464272b3 160000 --- a/CMUtil +++ b/CMUtil @@ -1 +1 @@ -Subproject commit f4d19fc898e9434e93f77843975369744e59350a +Subproject commit 464272b3c156d66e6a574e5ac09e8ae08a540ecc diff --git a/example/common/VulkanAppFramework.h b/example/common/VulkanAppFramework.h index d602e9eb..a06ee54c 100644 --- a/example/common/VulkanAppFramework.h +++ b/example/common/VulkanAppFramework.h @@ -23,6 +23,7 @@ #include #include #include +#include //#include #include diff --git a/inc/hgl/graph/SceneNode.h b/inc/hgl/graph/SceneNode.h index 5f01d131..1cc4f395 100644 --- a/inc/hgl/graph/SceneNode.h +++ b/inc/hgl/graph/SceneNode.h @@ -1,7 +1,7 @@ #ifndef HGL_GRAPH_SCENE_NODE_INCLUDE #define HGL_GRAPH_SCENE_NODE_INCLUDE -#include +#include #include #include #include diff --git a/inc/hgl/graph/TextureLoader.h b/inc/hgl/graph/TextureLoader.h index db6681f7..9b91adac 100644 --- a/inc/hgl/graph/TextureLoader.h +++ b/inc/hgl/graph/TextureLoader.h @@ -3,8 +3,8 @@ #include #include -#include #include +#include namespace hgl { namespace graph diff --git a/inc/hgl/graph/TileData.h b/inc/hgl/graph/TileData.h index 33a1a7ac..e3efc33f 100644 --- a/inc/hgl/graph/TileData.h +++ b/inc/hgl/graph/TileData.h @@ -1,32 +1,17 @@ #ifndef HGL_GRAPH_TILE_DATA_INCLUDE #define HGL_GRAPH_TILE_DATA_INCLUDE -#include #include -#include -#include +#include +#include +#include #include VK_NAMESPACE_USING - namespace hgl { namespace graph { - using TileUVPixel=RectScope2i; - using TileUVFloat=RectScope2f; - - using TileUVFloatList=List; - using TileUVFloatMap=Map; - - struct TileObject - { - int col,row; //当前tile在整个纹理中的tile位置 - - TileUVPixel uv_pixel; //以象素为单位的tile位置和尺寸 - TileUVFloat uv_float; //以浮点为单位的tile位置和尺寸 - };//struct TileObject - /** * TileData是一种处理大量等同尺寸及格式贴图的管理机制,程序会自动根据显卡最大贴图处理能力来创建尽可能符合需求的贴图。(注:Tile的大小不必符合2次幂) * Tile的增加或删除,程序会自动排序,尽可能小的减少I/O消耗。 diff --git a/inc/hgl/graph/VK.h b/inc/hgl/graph/VK.h index 488c649f..24ede03c 100644 --- a/inc/hgl/graph/VK.h +++ b/inc/hgl/graph/VK.h @@ -1,6 +1,7 @@ #ifndef HGL_GRAPH_VULKAN_INCLUDE #define HGL_GRAPH_VULKAN_INCLUDE +#include #include #include #include diff --git a/inc/hgl/graph/VKCommandBuffer.h b/inc/hgl/graph/VKCommandBuffer.h index 44d2b696..c0994b5a 100644 --- a/inc/hgl/graph/VKCommandBuffer.h +++ b/inc/hgl/graph/VKCommandBuffer.h @@ -64,7 +64,7 @@ public: { if(index>=cv_count)return; - hgl_cpy(clear_values[index].color.float32,cc.rgba,4); + hgl_cpy(clear_values[index].stop_color.float32,cc.rgba,4); } void SetClearDepthStencil(uint32_t index,float d=1.0f,float s=0) diff --git a/inc/hgl/graph/VKDescriptorBindingManage.h b/inc/hgl/graph/VKDescriptorBindingManage.h index e7386b8f..0f920859 100644 --- a/inc/hgl/graph/VKDescriptorBindingManage.h +++ b/inc/hgl/graph/VKDescriptorBindingManage.h @@ -2,6 +2,7 @@ #define HGL_GRAPH_DESCRIPTOR_BINDING_MANAGE_INCLUDE #include +#include #include namespace hgl { diff --git a/inc/hgl/graph/VKDescriptorSet.h b/inc/hgl/graph/VKDescriptorSet.h index e5edbba9..b07404ce 100644 --- a/inc/hgl/graph/VKDescriptorSet.h +++ b/inc/hgl/graph/VKDescriptorSet.h @@ -3,6 +3,7 @@ #include #include +#include #include VK_NAMESPACE_BEGIN class DeviceBuffer; diff --git a/inc/hgl/graph/VKDevice.h b/inc/hgl/graph/VKDevice.h index bd5a533f..e5602f42 100644 --- a/inc/hgl/graph/VKDevice.h +++ b/inc/hgl/graph/VKDevice.h @@ -5,8 +5,9 @@ #include #include #include +#include #include -#include +#include #include #include #include diff --git a/inc/hgl/graph/VKInstance.h b/inc/hgl/graph/VKInstance.h index 8e3590ee..5991eb3f 100644 --- a/inc/hgl/graph/VKInstance.h +++ b/inc/hgl/graph/VKInstance.h @@ -2,7 +2,7 @@ #define HGL_GRAPH_VULKAN_INSTANCE_INCLUDE #include -#include +#include #include #include #include diff --git a/inc/hgl/graph/VKRenderPass.h b/inc/hgl/graph/VKRenderPass.h index e7e0cdd1..2f7814cf 100644 --- a/inc/hgl/graph/VKRenderPass.h +++ b/inc/hgl/graph/VKRenderPass.h @@ -3,7 +3,7 @@ #include #include -#include +#include VK_NAMESPACE_BEGIN /** * RenderPass功能封装
diff --git a/inc/hgl/graph/VKRenderResource.h b/inc/hgl/graph/VKRenderResource.h index f0d72c7f..bc35a0ab 100644 --- a/inc/hgl/graph/VKRenderResource.h +++ b/inc/hgl/graph/VKRenderResource.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -43,14 +43,14 @@ class RenderResource Map material_by_name; Map texture_by_name; - IDResManage rm_material; ///<材质合集 - IDResManage rm_material_instance; ///<材质实例合集 - IDResManage rm_desc_sets; ///<描述符合集 - IDResManage rm_primitives; ///<图元合集 - IDResManage rm_buffers; ///<顶点缓冲区合集 - IDResManage rm_samplers; ///<采样器合集 - IDResManage rm_textures; ///<纹理合集 - IDResManage rm_renderables; ///<渲染实例集合集 + IDObjectManage rm_material; ///<材质合集 + IDObjectManage rm_material_instance; ///<材质实例合集 + IDObjectManage rm_desc_sets; ///<描述符合集 + IDObjectManage rm_primitives; ///<图元合集 + IDObjectManage rm_buffers; ///<顶点缓冲区合集 + IDObjectManage rm_samplers; ///<采样器合集 + IDObjectManage rm_textures; ///<纹理合集 + IDObjectManage rm_renderables; ///<渲染实例集合集 public: diff --git a/inc/hgl/graph/VKTexture.h b/inc/hgl/graph/VKTexture.h index 33184909..d4216d08 100644 --- a/inc/hgl/graph/VKTexture.h +++ b/inc/hgl/graph/VKTexture.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include VK_NAMESPACE_BEGIN diff --git a/inc/hgl/graph/font/TileFont.h b/inc/hgl/graph/font/TileFont.h index dae458ed..1de8e72d 100644 --- a/inc/hgl/graph/font/TileFont.h +++ b/inc/hgl/graph/font/TileFont.h @@ -9,6 +9,8 @@ namespace hgl { namespace graph { + using TileUVFloatMap=Map; + using TileResPool=ResPool; /** diff --git a/src/SceneGraph/CMakeLists.txt b/src/SceneGraph/CMakeLists.txt index d0ac8ae2..ae51b5f5 100644 --- a/src/SceneGraph/CMakeLists.txt +++ b/src/SceneGraph/CMakeLists.txt @@ -249,8 +249,30 @@ IF(WIN32) IF(FORCE_DISCETE_GPU) SET(RENDER_DEVICE_SOURCE ForceDiscreteGPU.c) ENDIF() + + SET(VULKAN_SURFACE_SOURCE Vulkan/Platform/WinVulkan.cpp) ENDIF(WIN32) +IF(UNIX) + + IF(ANDROID) + SET(VULKAN_SURFACE_SOURCE Vulkan/Platform/AndroidVulkan.cpp) + ELSE() + IF(APPLE) + + + + ELSE() + + SET(VULKAN_SURFACE_SOURCE Vulkan/Platform/XCBVulkan.cpp) + ENDIF() + + ENDIF() + +ENDIF(UNIX) + +SOURCE_GROUP("Vulkan\\Surface" FILES ${VULKAN_SURFACE_SOURCE}) + SET(VULKAN_RENDER_SOURCE ${VK_RR_SOURCE} ${VK_RR_SHADER_FILES} ${VK_RR_MATERIAL_FILES} @@ -288,4 +310,5 @@ add_cm_library(ULRE.SceneGraph "ULRE" ${SCENE_GRAPH_HEADER} # ${FONT_LAYOUT_SOURCE} # ${TEXT_RENDERABLE_SOURCE} - ${VULKAN_RENDER_SOURCE}) + ${VULKAN_RENDER_SOURCE} + ${VULKAN_SURFACE_SOURCE}) diff --git a/src/SceneGraph/MaterialRenderList.cpp b/src/SceneGraph/MaterialRenderList.cpp index e4808338..0e6dca9b 100644 --- a/src/SceneGraph/MaterialRenderList.cpp +++ b/src/SceneGraph/MaterialRenderList.cpp @@ -133,7 +133,7 @@ void MaterialRenderList::Stat() RenderNode *rn=rn_list.GetData(); ri_list.ClearData(); - ri_list.PreMalloc(count); + ri_list.PreAlloc(count); mi_set.ClearData(); diff --git a/src/SceneGraph/TileData.cpp b/src/SceneGraph/TileData.cpp index bb582ccb..e9fd6d23 100644 --- a/src/SceneGraph/TileData.cpp +++ b/src/SceneGraph/TileData.cpp @@ -22,7 +22,7 @@ namespace hgl tile_max_count=tile_rows*tile_cols; tile_count=0; - to_pool.PreMalloc(tile_max_count); + to_pool.PreAlloc(tile_max_count); { int col=0,row=0; TileObject **to=to_pool.GetInactiveData(); diff --git a/src/SceneGraph/Vulkan/Debug/VKDebugMaker.cpp b/src/SceneGraph/Vulkan/Debug/VKDebugMaker.cpp index 9aa6981c..a10fccd0 100644 --- a/src/SceneGraph/Vulkan/Debug/VKDebugMaker.cpp +++ b/src/SceneGraph/Vulkan/Debug/VKDebugMaker.cpp @@ -38,7 +38,7 @@ void DebugMaker::Begin(VkCommandBuffer cmdbuffer, const char * pMarkerName, cons VkDebugMarkerMarkerInfoEXT markerInfo = {}; markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; - memcpy(markerInfo.color, &color, sizeof(float) * 4); + memcpy(markerInfo.stop_color, &color, sizeof(float) * 4); markerInfo.pMarkerName = pMarkerName; dmf.Begin(cmdbuffer, &markerInfo); @@ -51,7 +51,7 @@ void DebugMaker::Insert(VkCommandBuffer cmdbuffer, const char *markerName, const VkDebugMarkerMarkerInfoEXT markerInfo = {}; markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT; - memcpy(markerInfo.color, &color, sizeof(float) * 4); + memcpy(markerInfo.stop_color, &color, sizeof(float) * 4); markerInfo.pMarkerName = markerName; dmf.Insert(cmdbuffer, &markerInfo); diff --git a/src/SceneGraph/Vulkan/Debug/VKDebugUtils.cpp b/src/SceneGraph/Vulkan/Debug/VKDebugUtils.cpp index a72bdbf0..ec3237a2 100644 --- a/src/SceneGraph/Vulkan/Debug/VKDebugUtils.cpp +++ b/src/SceneGraph/Vulkan/Debug/VKDebugUtils.cpp @@ -40,10 +40,10 @@ struct DebugUtilsLabel:public VkDebugUtilsLabelEXT sType=VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT; pNext=nullptr; pLabelName=n; - color[0]=c.r; - color[1]=c.g; - color[2]=c.b; - color[3]=c.a; + stop_color[0]=c.r; + stop_color[1]=c.g; + stop_color[2]=c.b; + stop_color[3]=c.a; } };//struct DebugUtilsLabel diff --git a/src/SceneGraph/Vulkan/Platform/AndroidVulkan.cpp b/src/SceneGraph/Vulkan/Platform/AndroidVulkan.cpp new file mode 100644 index 00000000..cb34159c --- /dev/null +++ b/src/SceneGraph/Vulkan/Platform/AndroidVulkan.cpp @@ -0,0 +1,29 @@ +#include +#include"AndroidWindow.h" +#include + +namespace hgl +{ + VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w) + { + if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE); + if(!w)return(VK_NULL_HANDLE); + + AndroidWindow *win=(Android *)w; + + VkAndroidSurfaceCreateInfoKHR createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; + createInfo.pNext = nullptr; + createInfo.flags = 0; + createInfo.window = win->GetWindow(); + + VkSurfaceKHR surface; + + VkResult res=CreateAndroidSurfaceKHR(vk_inst,&createInfo,nullptr,&surface); + + if(res!=VK_SUCCESS) + return(VK_NULL_HANDLE); + + return(surface); + } +}//namespace hgl diff --git a/src/SceneGraph/Vulkan/Platform/MacVulkan.cpp b/src/SceneGraph/Vulkan/Platform/MacVulkan.cpp new file mode 100644 index 00000000..3a4510d4 --- /dev/null +++ b/src/SceneGraph/Vulkan/Platform/MacVulkan.cpp @@ -0,0 +1,29 @@ +#include +#include"MacWindow.h" +#include + +namespace hgl +{ + VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w) + { + if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE); + if(!w)return(VK_NULL_HANDLE); + + MacWindow *win=(MacWindow *)w; + + VkMacOSSurfaceCreateInfoMVK createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; + createInfo.pNext = nullptr; + createInfo.flags = 0; + createInfo.pView = win->GetView(); + + VkSurfaceKHR surface; + + VkResult res = vkCreateMacOSSurfaceMVK(vk_inst, &createInfo, nullptr, &surface); + + if (res != VK_SUCCESS) + return(VK_NULL_HANDLE); + + return(surface); + } +}//namespace hgl diff --git a/src/SceneGraph/Vulkan/Platform/WaylandVulkan.cpp b/src/SceneGraph/Vulkan/Platform/WaylandVulkan.cpp new file mode 100644 index 00000000..bda8d592 --- /dev/null +++ b/src/SceneGraph/Vulkan/Platform/WaylandVulkan.cpp @@ -0,0 +1,30 @@ +#include +#include"WaylandWindow.h" +#include + +namespace hgl +{ + VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w) + { + if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE); + if(!w)return(VK_NULL_HANDLE); + + WaylandWindow *win=(WaylandWindow *)w; + + VkWaylandSurfaceCreateInfoKHR createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR; + createInfo.pNext = nullptr; + createInfo.flags = 0; + createInfo.display = win->GetDisplay(); + createInfo.surface = win->GetSurface(); + + VkSurfaceKHR surface; + + VkResult res = vkCreateWaylandSurfaceKHR(vk_inst, &createInfo, nullptr, &surface); + + if (res != VK_SUCCESS) + return(VK_NULL_HANDLE); + + return(surface); + } +}//namespace hgl diff --git a/src/SceneGraph/Vulkan/Platform/WinVulkan.cpp b/src/SceneGraph/Vulkan/Platform/WinVulkan.cpp new file mode 100644 index 00000000..cf6fad81 --- /dev/null +++ b/src/SceneGraph/Vulkan/Platform/WinVulkan.cpp @@ -0,0 +1,30 @@ +#include +#include +#include + +namespace hgl +{ + VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w) + { + if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE); + if(!w)return(VK_NULL_HANDLE); + + WinWindow *win=(WinWindow *)w; + + VkWin32SurfaceCreateInfoKHR createInfo; + createInfo.sType =VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; + createInfo.pNext =nullptr; + createInfo.flags =0; + createInfo.hinstance=win->GetInstance(); + createInfo.hwnd =win->GetWnd(); + + VkSurfaceKHR surface; + + VkResult res=vkCreateWin32SurfaceKHR(vk_inst,&createInfo,nullptr,&surface); + + if(res!=VK_SUCCESS) + return(VK_NULL_HANDLE); + + return(surface); + } +}//namespace hgl \ No newline at end of file diff --git a/src/SceneGraph/Vulkan/Platform/XCBVulkan.cpp b/src/SceneGraph/Vulkan/Platform/XCBVulkan.cpp new file mode 100644 index 00000000..fe8913a7 --- /dev/null +++ b/src/SceneGraph/Vulkan/Platform/XCBVulkan.cpp @@ -0,0 +1,30 @@ +#include +#include"XCBWindow.h" +#include + +namespace hgl +{ + VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w) + { + if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE); + if(!w)return(VK_NULL_HANDLE); + + XCBWindow *win=(XCBWindow *)w; + + VkXcbSurfaceCreateInfoKHR createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; + createInfo.pNext = nullptr; + createInfo.flags = 0; + createInfo.connection = win->GetConnection(); + createInfo.window = win->GetWindow(); + + VkSurfaceKHR surface; + + VkResult res = vkCreateXcbSurfaceKHR(vk_inst, &createInfo, nullptr, &surface); + + if (res != VK_SUCCESS) + return(VK_NULL_HANDLE); + + return(surface); + } +}//namespace hgl diff --git a/src/SceneGraph/Vulkan/Platform/iOSVulkan.cpp b/src/SceneGraph/Vulkan/Platform/iOSVulkan.cpp new file mode 100644 index 00000000..ddd68bb2 --- /dev/null +++ b/src/SceneGraph/Vulkan/Platform/iOSVulkan.cpp @@ -0,0 +1,29 @@ +#include +#include"iOSWindow.h" +#include + +namespace hgl +{ + VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w) + { + if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE); + if(!w)return(VK_NULL_HANDLE); + + iOSWindow *win=(iOSWindow *)w; + + VkIOSSurfaceCreateInfoMVK createInfo; + createInfo.sType = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK; + createInfo.pNext = nullptr; + createInfo.flags = 0; + createInfo.pView = win->GetView(); + + VkSurfaceKHR surface; + + VkResult res = vkCreateIOSSurfaceMVK(vk_inst, &createInfo, nullptr, &surface); + + if (res != VK_SUCCESS) + return(VK_NULL_HANDLE); + + return(surface); + } +}//namespace hgl diff --git a/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp b/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp index 55a2720d..54bcec4d 100644 --- a/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceBuffer.cpp @@ -2,6 +2,7 @@ #include #include #include +#include VK_NAMESPACE_BEGIN const VkDeviceSize GPUDevice::GetUBOAlign (){return attr->physical_device->GetUBOAlign();} diff --git a/src/SceneGraph/Vulkan/VKDeviceCreater.cpp b/src/SceneGraph/Vulkan/VKDeviceCreater.cpp index 9f7e54ad..5236404e 100644 --- a/src/SceneGraph/Vulkan/VKDeviceCreater.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceCreater.cpp @@ -9,6 +9,7 @@ #include #include +#include #include VK_NAMESPACE_BEGIN diff --git a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp index 308cb09e..92772d5c 100644 --- a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp @@ -6,6 +6,7 @@ #include #include #include"VKPipelineLayoutData.h" +#include VK_NAMESPACE_BEGIN diff --git a/src/SceneGraph/Vulkan/VKDeviceSwapchain.cpp b/src/SceneGraph/Vulkan/VKDeviceSwapchain.cpp index ddd4845b..e0d0e920 100644 --- a/src/SceneGraph/Vulkan/VKDeviceSwapchain.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceSwapchain.cpp @@ -1,6 +1,7 @@ #include #include #include +#include VK_NAMESPACE_BEGIN namespace diff --git a/src/SceneGraph/Vulkan/VKRenderable.cpp b/src/SceneGraph/Vulkan/VKRenderable.cpp index 81318ca5..f6c0e72d 100644 --- a/src/SceneGraph/Vulkan/VKRenderable.cpp +++ b/src/SceneGraph/Vulkan/VKRenderable.cpp @@ -3,6 +3,7 @@ #include #include #include +#include VK_NAMESPACE_BEGIN VertexInputData::VertexInputData(const uint32_t c,const uint32_t vc,const IndexBufferData *ibd) diff --git a/src/ShaderGen/ShaderCreateInfo.cpp b/src/ShaderGen/ShaderCreateInfo.cpp index d88e9765..7067f807 100644 --- a/src/ShaderGen/ShaderCreateInfo.cpp +++ b/src/ShaderGen/ShaderCreateInfo.cpp @@ -1,7 +1,9 @@ #include #include -#include"GLSLCompiler.h" #include +#include + +#include"GLSLCompiler.h" #include"common/MFCommon.h" namespace hgl{namespace graph{