Optimize Vulkan Framebuffer when not using color blending

This commit is contained in:
Wojtek Figat
2021-05-18 11:56:21 +02:00
parent 7f6a6f9fff
commit ead65f01ff
5 changed files with 7 additions and 4 deletions

View File

@@ -308,6 +308,7 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
_desc.pRasterizationState = &_descRasterization;
// Color Blend State
BlendEnable = desc.BlendMode.BlendEnable;
RenderToolsVulkan::ZeroStruct(_descColorBlend, VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO);
{
auto& blend = _descColorBlendAttachments[0];
@@ -321,9 +322,7 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
blend.colorWriteMask = (VkColorComponentFlags)desc.BlendMode.RenderTargetWriteMask;
}
for (int32 i = 1; i < GPU_MAX_RT_BINDED; i++)
{
_descColorBlendAttachments[i] = _descColorBlendAttachments[i - 1];
}
_descColorBlend.pAttachments = _descColorBlendAttachments;
_descColorBlend.blendConstants[0] = 0.0f;
_descColorBlend.blendConstants[1] = 0.0f;