From 7f3a1936762947360cb90189783ad3a34b40c8fb Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 10 Jul 2019 14:55:34 +0800 Subject: [PATCH] =?UTF-8?q?Pipeline=E5=88=9B=E5=BB=BA=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AF=B9=E5=A4=9AColorAttachment=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/graph/vulkan/VKRenderPass.h | 1 + src/RenderDevice/Vulkan/VKPipeline.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/hgl/graph/vulkan/VKRenderPass.h b/inc/hgl/graph/vulkan/VKRenderPass.h index 9dc9e23f..e3d966da 100644 --- a/inc/hgl/graph/vulkan/VKRenderPass.h +++ b/inc/hgl/graph/vulkan/VKRenderPass.h @@ -42,6 +42,7 @@ public: operator VkRenderPass(){return render_pass;} + const uint GetColorCount()const{return color_formats.GetCount();} const List & GetColorFormat()const{return color_formats;} const VkFormat GetDepthFormat()const{return depth_format;} };//class RenderPass diff --git a/src/RenderDevice/Vulkan/VKPipeline.cpp b/src/RenderDevice/Vulkan/VKPipeline.cpp index d08270a8..a85a616a 100644 --- a/src/RenderDevice/Vulkan/VKPipeline.cpp +++ b/src/RenderDevice/Vulkan/VKPipeline.cpp @@ -145,7 +145,7 @@ PipelineCreater::PipelineCreater(Device *dev,const Material *material,RenderPass cba.srcAlphaBlendFactor = VK_BLEND_FACTOR_ZERO; cba.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO; - colorBlendAttachments.Add(cba); + colorBlendAttachments.Add(cba,rp->GetColorCount()); //这个需要和subpass中的color attachment数量相等,所以添加多份 alpha_blend=false;