diff --git a/inc/hgl/graph/vulkan/VKDevice.h b/inc/hgl/graph/vulkan/VKDevice.h index 433c673f..cd4adb69 100644 --- a/inc/hgl/graph/vulkan/VKDevice.h +++ b/inc/hgl/graph/vulkan/VKDevice.h @@ -276,7 +276,8 @@ public: const VkImageLayout color_final_layout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, const VkImageLayout depth_final_layout=VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - Pipeline *CreatePipeline(PipelineData *,const Material *,const RenderTarget *); + Pipeline *CreatePipeline(const InlinePipeline &,const Material *,const RenderTarget *); + Pipeline *CreatePipeline( PipelineData *, const Material *,const RenderTarget *); TileData *CreateTileData(const VkFormat video_format,const uint width,const uint height,const uint count); ///<创建一个Tile数据集 @@ -286,11 +287,11 @@ public: void CreateSubpassDependency(VkSubpassDependency *); void CreateSubpassDependency(List &dependency,const uint32_t count); -void CreateAttachmentReference(VkAttachmentReference *ref_list,uint count,VkImageLayout layout); +void CreateAttachmentReference(VkAttachmentReference *ref_list,uint start,uint count,VkImageLayout layout); -inline void CreateColorAttachmentReference(VkAttachmentReference *ref_list,uint count ){CreateAttachmentReference(ref_list, count,VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);} -inline void CreateDepthAttachmentReference(VkAttachmentReference *depth_ref) {CreateAttachmentReference(depth_ref, 1 ,VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);} -inline void CreateInputAttachmentReference(VkAttachmentReference *ref_list,uint count ){CreateAttachmentReference(ref_list, count,VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);} +inline void CreateColorAttachmentReference(VkAttachmentReference *ref_list, uint start,uint count) {CreateAttachmentReference(ref_list, start,count,VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);} +inline void CreateDepthAttachmentReference(VkAttachmentReference *depth_ref,uint index) {CreateAttachmentReference(depth_ref, index,1 ,VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);} +inline void CreateInputAttachmentReference(VkAttachmentReference *ref_list, uint start,uint count) {CreateAttachmentReference(ref_list, start,count,VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);} bool CreateColorAttachment( List &ref_list,List &desc_list,const List &color_format,const VkImageLayout color_final_layout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); diff --git a/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp b/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp index e42470a7..0f2a210a 100644 --- a/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp +++ b/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp @@ -67,11 +67,11 @@ void CreateSubpassDependency(List &subpass_dependency_list, } } -void CreateAttachmentReference(VkAttachmentReference *ref_list,uint count,VkImageLayout layout) +void CreateAttachmentReference(VkAttachmentReference *ref_list,uint start,uint count,VkImageLayout layout) { VkAttachmentReference *ref=ref_list; - for(uint i=0;iattachment =i; ref->layout =layout; @@ -240,8 +240,8 @@ RenderPass *Device::CreateRenderPass(VkFormat color_format,VkFormat depth_format color_format_list.Add(color_format); - CreateColorAttachmentReference(&color_ref,1); - CreateDepthAttachmentReference(&depth_ref); + CreateColorAttachmentReference(&color_ref,0,1); + CreateDepthAttachmentReference(&depth_ref,1); CreateAttachment(desc_list,color_format_list,depth_format,color_final_layout,depth_final_layout);