diff --git a/example/Vulkan/CMakeLists.txt b/example/Vulkan/CMakeLists.txt index 6b377b5f..7bcb6d38 100644 --- a/example/Vulkan/CMakeLists.txt +++ b/example/Vulkan/CMakeLists.txt @@ -10,6 +10,7 @@ SET(VULKAN_TEST_SOURCE_FILES main.cpp VKFormat.cpp VKInstance.cpp VKPhysicalDevice.cpp + VKImageView.cpp VKCommandBuffer.cpp VKDeviceAttribute.cpp VKDeviceCreater.cpp @@ -31,6 +32,7 @@ SET(VULKAN_TEST_HEADER_FILES VK.h VKPrimivate.h VKInstance.h VKPhysicalDevice.h + VKImageView.h VKCommandBuffer.h VKSurfaceExtensionName.h VKDeviceAttribute.h diff --git a/example/Vulkan/VKBuffer.h b/example/Vulkan/VKBuffer.h index 7c03bfba..6a4900d7 100644 --- a/example/Vulkan/VKBuffer.h +++ b/example/Vulkan/VKBuffer.h @@ -62,7 +62,7 @@ public: const VkFormat GetFormat()const { return format; } const uint32_t GetStride()const { return stride; } - const uint32_t GetCount()const{return count;} + const uint32_t GetCount ()const { return count; } uint8_t *Map(uint32_t start=0,uint32_t size=0) override { diff --git a/example/Vulkan/VKDescriptorSets.cpp b/example/Vulkan/VKDescriptorSets.cpp index e7fec527..20cab003 100644 --- a/example/Vulkan/VKDescriptorSets.cpp +++ b/example/Vulkan/VKDescriptorSets.cpp @@ -53,7 +53,7 @@ DescriptorSets *DescriptorSetLayout::CreateSets()const return(new DescriptorSets(device,desc_set)); } -void DescriptorSetLayoutCreater::Bind(const int binding,VkDescriptorType desc_type,VkShaderStageFlagBits stageFlags) +void DescriptorSetLayoutCreater::Bind(const uint32_t binding,VkDescriptorType desc_type,VkShaderStageFlagBits stageFlags) { VkDescriptorSetLayoutBinding layout_binding = {}; layout_binding.binding = binding; diff --git a/example/Vulkan/VKDescriptorSets.h b/example/Vulkan/VKDescriptorSets.h index 8370f2d1..f9f8c8e1 100644 --- a/example/Vulkan/VKDescriptorSets.h +++ b/example/Vulkan/VKDescriptorSets.h @@ -54,9 +54,9 @@ public: DescriptorSetLayoutCreater(Device *dev):device(dev){} ~DescriptorSetLayoutCreater()=default; - void Bind(const int binding,VkDescriptorType,VkShaderStageFlagBits); + void Bind(const uint32_t binding,VkDescriptorType,VkShaderStageFlagBits); -#define DESC_SET_BIND_FUNC(name,vkname) void Bind##name(const int binding,VkShaderStageFlagBits stage_flag){Bind(binding,VK_DESCRIPTOR_TYPE_##vkname,stage_flag);} +#define DESC_SET_BIND_FUNC(name,vkname) void Bind##name(const uint32_t binding,VkShaderStageFlagBits stage_flag){Bind(binding,VK_DESCRIPTOR_TYPE_##vkname,stage_flag);} DESC_SET_BIND_FUNC(Sampler, SAMPLER); DESC_SET_BIND_FUNC(UBO, UNIFORM_BUFFER); diff --git a/example/Vulkan/VKDevice.cpp b/example/Vulkan/VKDevice.cpp index f9374323..4d9e0845 100644 --- a/example/Vulkan/VKDevice.cpp +++ b/example/Vulkan/VKDevice.cpp @@ -1,6 +1,7 @@ #include"VKDevice.h" #include #include"VKBuffer.h" +#include"VKImageView.h" #include"VKCommandBuffer.h" //#include"VKDescriptorSet.h" #include"VKRenderPass.h" @@ -134,28 +135,9 @@ CommandBuffer *Device::CreateCommandBuffer() return(new CommandBuffer(attr->device,attr->swapchain_extent,attr->cmd_pool,cmd_buf)); } -RenderPass *Device::CreateRenderPass() +RenderPass *Device::CreateRenderPass(VkFormat color_format,VkFormat depth_format) { VkAttachmentDescription attachments[2]; - attachments[0].format=attr->format; - attachments[0].samples=VK_SAMPLE_COUNT_1_BIT; - attachments[0].loadOp=VK_ATTACHMENT_LOAD_OP_CLEAR; - attachments[0].storeOp=VK_ATTACHMENT_STORE_OP_STORE; - attachments[0].stencilLoadOp=VK_ATTACHMENT_LOAD_OP_DONT_CARE; - attachments[0].stencilStoreOp=VK_ATTACHMENT_STORE_OP_DONT_CARE; - attachments[0].initialLayout=VK_IMAGE_LAYOUT_UNDEFINED; - attachments[0].finalLayout=VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; - attachments[0].flags=0; - - attachments[1].format=attr->depth.format; - attachments[1].samples=VK_SAMPLE_COUNT_1_BIT; - attachments[1].loadOp=VK_ATTACHMENT_LOAD_OP_CLEAR; - attachments[1].storeOp=VK_ATTACHMENT_STORE_OP_DONT_CARE; - attachments[1].stencilLoadOp=VK_ATTACHMENT_LOAD_OP_DONT_CARE; - attachments[1].stencilStoreOp=VK_ATTACHMENT_STORE_OP_DONT_CARE; - attachments[1].initialLayout=VK_IMAGE_LAYOUT_UNDEFINED; - attachments[1].finalLayout=VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; - attachments[1].flags=0; VkAttachmentReference color_reference={0,VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL}; VkAttachmentReference depth_reference={1,VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL}; @@ -164,13 +146,58 @@ RenderPass *Device::CreateRenderPass() subpass.pipelineBindPoint=VK_PIPELINE_BIND_POINT_GRAPHICS; subpass.flags=0; subpass.inputAttachmentCount=0; - subpass.pInputAttachments=nullptr; - subpass.colorAttachmentCount=1; - subpass.pColorAttachments=&color_reference; + subpass.pInputAttachments=nullptr; subpass.pResolveAttachments=nullptr; - subpass.pDepthStencilAttachment=&depth_reference; subpass.preserveAttachmentCount=0; subpass.pPreserveAttachments=nullptr; + + int att_count=0; + + if(color_format!=VK_FORMAT_UNDEFINED) + { + attachments[0].format=color_format; + attachments[0].samples=VK_SAMPLE_COUNT_1_BIT; + attachments[0].loadOp=VK_ATTACHMENT_LOAD_OP_CLEAR; + attachments[0].storeOp=VK_ATTACHMENT_STORE_OP_STORE; + attachments[0].stencilLoadOp=VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments[0].stencilStoreOp=VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[0].initialLayout=VK_IMAGE_LAYOUT_UNDEFINED; + attachments[0].finalLayout=VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + attachments[0].flags=0; + + ++att_count; + + subpass.colorAttachmentCount=1; + subpass.pColorAttachments=&color_reference; + } + else + { + subpass.colorAttachmentCount=0; + subpass.pColorAttachments=nullptr; + } + + if(depth_format!=VK_FORMAT_UNDEFINED) + { + attachments[att_count].format=depth_format; + attachments[att_count].samples=VK_SAMPLE_COUNT_1_BIT; + attachments[att_count].loadOp=VK_ATTACHMENT_LOAD_OP_CLEAR; + attachments[att_count].storeOp=VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[att_count].stencilLoadOp=VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments[att_count].stencilStoreOp=VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[att_count].initialLayout=VK_IMAGE_LAYOUT_UNDEFINED; + attachments[att_count].finalLayout=VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + attachments[att_count].flags=0; + + depth_reference.attachment=att_count; + + ++att_count; + + subpass.pDepthStencilAttachment=&depth_reference; + } + else + { + subpass.pDepthStencilAttachment=nullptr; + } VkSubpassDependency dependency = {}; dependency.srcSubpass = VK_SUBPASS_EXTERNAL; @@ -183,7 +210,7 @@ RenderPass *Device::CreateRenderPass() VkRenderPassCreateInfo rp_info={}; rp_info.sType=VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; rp_info.pNext=nullptr; - rp_info.attachmentCount=2; + rp_info.attachmentCount=att_count; rp_info.pAttachments=attachments; rp_info.subpassCount=1; rp_info.pSubpasses=&subpass; @@ -195,7 +222,7 @@ RenderPass *Device::CreateRenderPass() if(vkCreateRenderPass(attr->device,&rp_info,nullptr,&render_pass)!=VK_SUCCESS) return(nullptr); - return(new RenderPass(attr->device,render_pass)); + return(new RenderPass(attr->device,render_pass,color_format,depth_format)); } Fence *Device::CreateFence() diff --git a/example/Vulkan/VKDevice.h b/example/Vulkan/VKDevice.h index f8c5b6c5..244d50ee 100644 --- a/example/Vulkan/VKDevice.h +++ b/example/Vulkan/VKDevice.h @@ -49,8 +49,8 @@ public: public: const uint32_t GetSwapChainImageCount ()const {return attr->sc_image_views.GetCount();} - VkImageView GetColorImageView (int index) {return GetObject(attr->sc_image_views,index);} - VkImageView GetDepthImageView () {return attr->depth.view;} + ImageView *GetColorImageView (int index) {return attr->sc_image_views[index];} + ImageView *GetDepthImageView () {return attr->depth.view;} const uint32_t GetCurrentFrameIndices () {return current_frame;} @@ -73,7 +73,7 @@ public: #undef CREATE_BUFFER_OBJECT CommandBuffer * CreateCommandBuffer(); - RenderPass * CreateRenderPass(); + RenderPass * CreateRenderPass(VkFormat color_format,VkFormat depth_format); Fence * CreateFence(); Semaphore * CreateSem(); diff --git a/example/Vulkan/VKDeviceAttribute.cpp b/example/Vulkan/VKDeviceAttribute.cpp index bd30fd9c..615f4822 100644 --- a/example/Vulkan/VKDeviceAttribute.cpp +++ b/example/Vulkan/VKDeviceAttribute.cpp @@ -1,5 +1,6 @@ #include"VKDeviceAttribute.h" #include"VKPhysicalDevice.h" +#include"VKImageView.h" #include VK_NAMESPACE_BEGIN @@ -137,8 +138,7 @@ DeviceAttribute::~DeviceAttribute() if(desc_pool) vkDestroyDescriptorPool(device,desc_pool,nullptr); - if(depth.view) - vkDestroyImageView(device,depth.view,nullptr); + SAFE_CLEAR(depth.view); if(depth.image) vkDestroyImage(device,depth.image,nullptr); @@ -146,20 +146,7 @@ DeviceAttribute::~DeviceAttribute() if(depth.mem) vkFreeMemory(device,depth.mem,nullptr); - { - const uint32_t iv_count=sc_image_views.GetCount(); - - if(iv_count>0) - { - VkImageView *iv=sc_image_views.GetData(); - - for(uint32_t i=0;i sc_images; - List sc_image_views; + ObjectList sc_image_views; struct { @@ -46,7 +47,7 @@ struct DeviceAttribute VkImage image =nullptr; VkDeviceMemory mem =nullptr; - VkImageView view =nullptr; + ImageView * view =nullptr; }depth; VkDescriptorPool desc_pool =nullptr; diff --git a/example/Vulkan/VKDeviceCreater.cpp b/example/Vulkan/VKDeviceCreater.cpp index e26e04ef..f2d5911c 100644 --- a/example/Vulkan/VKDeviceCreater.cpp +++ b/example/Vulkan/VKDeviceCreater.cpp @@ -135,40 +135,12 @@ namespace return(nullptr); } - VkImageView CreateImageView(VkDevice device,VkImageViewType type,VkFormat format,VkImageAspectFlags aspectMask,VkImage img=nullptr) - { - VkImageViewCreateInfo iv_createinfo={}; - - iv_createinfo.sType=VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; - iv_createinfo.pNext=nullptr; - iv_createinfo.flags=0; - iv_createinfo.image=img; - iv_createinfo.format=format; - iv_createinfo.viewType=type; - iv_createinfo.components.r=VK_COMPONENT_SWIZZLE_R; - iv_createinfo.components.g=VK_COMPONENT_SWIZZLE_G; - iv_createinfo.components.b=VK_COMPONENT_SWIZZLE_B; - iv_createinfo.components.a=VK_COMPONENT_SWIZZLE_A; - iv_createinfo.subresourceRange.aspectMask=aspectMask; - iv_createinfo.subresourceRange.baseMipLevel=0; - iv_createinfo.subresourceRange.levelCount=1; - iv_createinfo.subresourceRange.baseArrayLayer=0; - iv_createinfo.subresourceRange.layerCount=1; - - VkImageView iv; - - if(vkCreateImageView(device,&iv_createinfo,nullptr,&iv)!=VK_SUCCESS) - return(nullptr); - - return iv; - } - - VkImageView Create2DImageView(VkDevice device,VkFormat format,VkImage img=nullptr) + ImageView *Create2DImageView(VkDevice device,VkFormat format,VkImage img=nullptr) { return CreateImageView(device,VK_IMAGE_VIEW_TYPE_2D,format,VK_IMAGE_ASPECT_COLOR_BIT,img); } - VkImageView CreateDepthImageView(VkDevice device,VkFormat format,VkImage img=nullptr) + ImageView *CreateDepthImageView(VkDevice device,VkFormat format,VkImage img=nullptr) { return CreateImageView(device,VK_IMAGE_VIEW_TYPE_2D,format,VK_IMAGE_ASPECT_DEPTH_BIT,img); } @@ -188,19 +160,18 @@ namespace return(false); } - rsa->sc_image_views.SetCount(count); - VkImage *ip=rsa->sc_images.GetData(); - VkImageView *vp=rsa->sc_image_views.GetData(); + ImageView *vp; for(uint32_t i=0; idevice,rsa->format,*ip); + vp=Create2DImageView(rsa->device,rsa->format,*ip); - if(*vp==nullptr) + if(vp==nullptr) return(false); + rsa->sc_image_views.Add(vp); + ++ip; - ++vp; } return(true); diff --git a/example/Vulkan/VKFramebuffer.cpp b/example/Vulkan/VKFramebuffer.cpp index afb56316..b63cc7af 100644 --- a/example/Vulkan/VKFramebuffer.cpp +++ b/example/Vulkan/VKFramebuffer.cpp @@ -1,18 +1,28 @@ #include"VKFramebuffer.h" #include"VKDevice.h" +#include"VKImageView.h" #include"VKRenderPass.h" + VK_NAMESPACE_BEGIN Framebuffer::~Framebuffer() { vkDestroyFramebuffer(device,frame_buffer,nullptr); } -Framebuffer *CreateFramebuffer(Device *dev,RenderPass *rp,VkImageView color,VkImageView depth) +Framebuffer *CreateFramebuffer(Device *dev,RenderPass *rp,ImageView *color,ImageView *depth) { - if(!dev||!rp)return(nullptr); - + if(!dev)return(nullptr); + if(!rp)return(nullptr); if(!color&&!depth)return(nullptr); + if(color) + if(rp->GetColorFormat()!=color->GetFormat()) + return(nullptr); + + if(depth) + if(rp->GetDepthFormat()!=depth->GetFormat()) + return(nullptr); + const VkExtent2D extent=dev->GetExtent(); VkImageView attachments[2]; @@ -27,11 +37,11 @@ Framebuffer *CreateFramebuffer(Device *dev,RenderPass *rp,VkImageView color,VkIm if(color) { - attachments[0]=color; + attachments[0]=*color; if(depth) { - attachments[1]=depth; + attachments[1]=*depth; fb_info.attachmentCount = 2; } else @@ -39,7 +49,7 @@ Framebuffer *CreateFramebuffer(Device *dev,RenderPass *rp,VkImageView color,VkIm } else { - attachments[0]=depth; + attachments[0]=*depth; fb_info.attachmentCount = 1; } diff --git a/example/Vulkan/VKFramebuffer.h b/example/Vulkan/VKFramebuffer.h index 40c2c42f..48f4658c 100644 --- a/example/Vulkan/VKFramebuffer.h +++ b/example/Vulkan/VKFramebuffer.h @@ -5,6 +5,7 @@ VK_NAMESPACE_BEGIN class Device; class RenderPass; +class ImageView; class Framebuffer { @@ -13,7 +14,7 @@ class Framebuffer private: - friend Framebuffer *CreateFramebuffer(Device *,RenderPass *,VkImageView color,VkImageView depth);; + friend Framebuffer *CreateFramebuffer(Device *,RenderPass *,ImageView *color,ImageView *depth); Framebuffer(VkDevice dev,VkFramebuffer fb) { @@ -28,6 +29,6 @@ public: operator VkFramebuffer(){return frame_buffer;} };//class Framebuffer -Framebuffer *CreateFramebuffer(Device *,RenderPass *,VkImageView color,VkImageView depth=nullptr); +Framebuffer *CreateFramebuffer(Device *,RenderPass *,ImageView *color,ImageView *depth=nullptr); VK_NAMESPACE_END #endif//HGL_GRAPH_VULKAN_FRAMEBUFFER_INCLUDE diff --git a/example/Vulkan/VKImageView.h b/example/Vulkan/VKImageView.h new file mode 100644 index 00000000..28ec5051 --- /dev/null +++ b/example/Vulkan/VKImageView.h @@ -0,0 +1,38 @@ +#ifndef HGL_GRAPH_VULKAN_IMAGE_VIEW_INCLUDE +#define HGL_GRAPH_VULKAN_IMAGE_VIEW_INCLUDE + +#include"VK.h" +VK_NAMESPACE_BEGIN +class ImageView +{ + VkDevice device; + VkImageView image_view; + VkImageViewCreateInfo info; + +private: + + friend ImageView *CreateImageView(VkDevice device,VkImageViewType type,VkFormat format,VkImageAspectFlags aspectMask,VkImage img); + + ImageView(VkDevice dev,VkImageView iv,const VkImageViewCreateInfo &ci) + { + device=dev; + image_view=iv; + info=ci; + } + +public: + + ~ImageView(); + + operator VkImageView(){return image_view;} + +public: + + const VkImageViewType GetViewType ()const{return info.viewType;} + const VkFormat GetFormat ()const{return info.format;} + const VkImageAspectFlags GetAspectFlags ()const{return info.subresourceRange.aspectMask;} +};//class ImageView + +ImageView *CreateImageView(VkDevice device,VkImageViewType type,VkFormat format,VkImageAspectFlags aspectMask,VkImage img=nullptr); +VK_NAMESPACE_END +#endif//HGL_GRAPH_VULKAN_IMAGE_VIEW_INCLUDE diff --git a/example/Vulkan/VKPipeline.cpp b/example/Vulkan/VKPipeline.cpp index 2e9624f7..ea36b254 100644 --- a/example/Vulkan/VKPipeline.cpp +++ b/example/Vulkan/VKPipeline.cpp @@ -77,7 +77,7 @@ PipelineCreater::PipelineCreater(Device *dev) rasterizer.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; rasterizer.pNext = nullptr; rasterizer.flags = 0; - rasterizer.depthClampEnable = VK_FALSE; + rasterizer.depthClampEnable = VK_FALSE; rasterizer.rasterizerDiscardEnable = VK_FALSE; rasterizer.polygonMode = VK_POLYGON_MODE_FILL; rasterizer.cullMode = VK_CULL_MODE_BACK_BIT; diff --git a/example/Vulkan/VKRenderPass.h b/example/Vulkan/VKRenderPass.h index 52099355..8bfc46bc 100644 --- a/example/Vulkan/VKRenderPass.h +++ b/example/Vulkan/VKRenderPass.h @@ -3,21 +3,31 @@ #include"VK.h" VK_NAMESPACE_BEGIN +class Framebuffer; +class ImageView; + class RenderPass { VkDevice device; VkRenderPass render_pass; + VkFormat color_format,depth_format; + public: - RenderPass(VkDevice d,VkRenderPass rp) + RenderPass(VkDevice d,VkRenderPass rp,VkFormat cf,VkFormat df) { device=d; render_pass=rp; + color_format=cf; + depth_format=df; } virtual ~RenderPass(); operator VkRenderPass(){return render_pass;} + + const VkFormat GetColorFormat()const{return color_format;} + const VkFormat GetDepthFormat()const{return depth_format;} };//class RenderPass VK_NAMESPACE_END #endif//HGL_GRAPH_VULKAN_RENDER_PASS_INCLUDE diff --git a/example/Vulkan/VkImageView.cpp b/example/Vulkan/VkImageView.cpp new file mode 100644 index 00000000..33358dde --- /dev/null +++ b/example/Vulkan/VkImageView.cpp @@ -0,0 +1,36 @@ +#include"VKImageView.h" + +VK_NAMESPACE_BEGIN +ImageView::~ImageView() +{ + vkDestroyImageView(device,image_view,nullptr); +} + +ImageView *CreateImageView(VkDevice device,VkImageViewType type,VkFormat format,VkImageAspectFlags aspectMask,VkImage img) +{ + VkImageViewCreateInfo iv_createinfo={}; + + iv_createinfo.sType=VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; + iv_createinfo.pNext=nullptr; + iv_createinfo.flags=0; + iv_createinfo.image=img; + iv_createinfo.format=format; + iv_createinfo.viewType=type; + iv_createinfo.components.r=VK_COMPONENT_SWIZZLE_R; + iv_createinfo.components.g=VK_COMPONENT_SWIZZLE_G; + iv_createinfo.components.b=VK_COMPONENT_SWIZZLE_B; + iv_createinfo.components.a=VK_COMPONENT_SWIZZLE_A; + iv_createinfo.subresourceRange.aspectMask=aspectMask; + iv_createinfo.subresourceRange.baseMipLevel=0; + iv_createinfo.subresourceRange.levelCount=1; + iv_createinfo.subresourceRange.baseArrayLayer=0; + iv_createinfo.subresourceRange.layerCount=1; + + VkImageView iv; + + if(vkCreateImageView(device,&iv_createinfo,nullptr,&iv)!=VK_SUCCESS) + return(nullptr); + + return(new ImageView(device,iv,iv_createinfo)); +} +VK_NAMESPACE_END diff --git a/example/Vulkan/main.cpp b/example/Vulkan/main.cpp index 92d6a937..0441cff6 100644 --- a/example/Vulkan/main.cpp +++ b/example/Vulkan/main.cpp @@ -4,6 +4,7 @@ #include"VKDevice.h" #include"VKBuffer.h" #include"VKShader.h" +#include"VKImageView.h" #include"VKVertexInput.h" #include"VKDescriptorSets.h" #include"VKRenderPass.h" @@ -174,10 +175,24 @@ int main(int,char **) vulkan::Semaphore *sem=device->CreateSem(); + vulkan::VertexInput *vi=CreateVertexBuffer(device); + const int image_count=device->GetSwapChainImageCount(); + vulkan::Framebuffer **fb=new vulkan::Framebuffer *[image_count]; + + vulkan::ImageView *color_iv=device->GetColorImageView(0); + vulkan::ImageView *depth_iv=device->GetDepthImageView(); + + vulkan::RenderPass *rp=device->CreateRenderPass(color_iv->GetFormat(),depth_iv->GetFormat()); + + for(int i=0;iGetColorImageView(i); + + fb[i]=vulkan::CreateFramebuffer(device,rp,color_iv,depth_iv); + } vulkan::PipelineCreater pc(device); - vulkan::RenderPass *rp=device->CreateRenderPass(); vulkan::DescriptorSetLayoutCreater dslc(device); vulkan::DescriptorSetLayout *dsl=dslc.Create(); @@ -196,12 +211,6 @@ int main(int,char **) device->AcquireNextImage(); - const int image_count=device->GetSwapChainImageCount(); - vulkan::Framebuffer **fb=new vulkan::Framebuffer *[image_count]; - - for(int i=0;iGetColorImageView(i),device->GetDepthImageView()); - cmd_buf->Begin(rp,fb[0]); cmd_buf->Bind(pipeline); cmd_buf->Bind(pl);