- depth_stencil_info->stencilTestEnable = stencil_test->enabled;
- depth_stencil_info->front.failOp = static_cast<VkStencilOp>(get_vulkan_stencil_op(stencil_test->stencil_fail_op));
- depth_stencil_info->front.passOp = static_cast<VkStencilOp>(get_vulkan_stencil_op(stencil_test->depth_pass_op));
- depth_stencil_info->front.depthFailOp = static_cast<VkStencilOp>(get_vulkan_stencil_op(stencil_test->depth_fail_op));
- depth_stencil_info->front.compareOp = static_cast<VkCompareOp>(get_vulkan_predicate(stencil_test->compare));
- depth_stencil_info->front.compareMask = 0xFFFFFFFFU;
- depth_stencil_info->front.writeMask = 0xFFFFFFFFU;
- depth_stencil_info->front.reference = stencil_test->reference;
- depth_stencil_info->back = depth_stencil_info->front;
- }
-
- if(const Blend *blend = self.blend)
- {
- for(unsigned i=0; i<n_color_attachments; ++i)
- {
- blend_attachments[i].blendEnable = blend->enabled;
- blend_attachments[i].srcColorBlendFactor = static_cast<VkBlendFactor>(get_vulkan_blend_factor(blend->src_factor));
- blend_attachments[i].dstColorBlendFactor = static_cast<VkBlendFactor>(get_vulkan_blend_factor(blend->dst_factor));
- blend_attachments[i].colorBlendOp = static_cast<VkBlendOp>(get_vulkan_blend_equation(blend->equation));
- blend_attachments[i].srcAlphaBlendFactor = blend_attachments[i].srcColorBlendFactor;
- blend_attachments[i].dstAlphaBlendFactor = blend_attachments[i].dstColorBlendFactor;
- blend_attachments[i].alphaBlendOp = blend_attachments[i].colorBlendOp;
- blend_attachments[i].colorWriteMask = get_vulkan_color_mask(blend->write_mask);
- }
- }
- else
- {
- for(unsigned i=0; i<n_color_attachments; ++i)
- blend_attachments[i].colorWriteMask = VK_COLOR_COMPONENT_R_BIT|VK_COLOR_COMPONENT_G_BIT|VK_COLOR_COMPONENT_B_BIT|VK_COLOR_COMPONENT_A_BIT;
+ blend_attachments[i].blendEnable = self.blend.enabled;
+ blend_attachments[i].srcColorBlendFactor = static_cast<VkBlendFactor>(get_vulkan_blend_factor(self.blend.src_factor));
+ blend_attachments[i].dstColorBlendFactor = static_cast<VkBlendFactor>(get_vulkan_blend_factor(self.blend.dst_factor));
+ blend_attachments[i].colorBlendOp = static_cast<VkBlendOp>(get_vulkan_blend_equation(self.blend.equation));
+ blend_attachments[i].srcAlphaBlendFactor = blend_attachments[i].srcColorBlendFactor;
+ blend_attachments[i].dstAlphaBlendFactor = blend_attachments[i].dstColorBlendFactor;
+ blend_attachments[i].alphaBlendOp = blend_attachments[i].colorBlendOp;
+ blend_attachments[i].colorWriteMask = get_vulkan_color_mask(self.blend.write_mask);