- if(const DepthTest *depth_test = self.depth_test)
- {
- depth_stencil_info->depthTestEnable = depth_test->enabled;
- depth_stencil_info->depthWriteEnable = depth_test->write;
- depth_stencil_info->depthCompareOp = static_cast<VkCompareOp>(get_vulkan_predicate(depth_test->compare));
- depth_stencil_info->depthBoundsTestEnable = VK_FALSE;
- }
- if(const StencilTest *stencil_test = self.stencil_test)
- {
- 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
+ depth_stencil_info->depthTestEnable = self.depth_test.enabled;
+ depth_stencil_info->depthWriteEnable = self.depth_test.write;
+ depth_stencil_info->depthCompareOp = static_cast<VkCompareOp>(get_vulkan_predicate(self.depth_test.compare));
+ depth_stencil_info->depthBoundsTestEnable = VK_FALSE;
+
+ depth_stencil_info->stencilTestEnable = self.stencil_test.enabled;
+ depth_stencil_info->front.failOp = static_cast<VkStencilOp>(get_vulkan_stencil_op(self.stencil_test.stencil_fail_op));
+ depth_stencil_info->front.passOp = static_cast<VkStencilOp>(get_vulkan_stencil_op(self.stencil_test.depth_pass_op));
+ depth_stencil_info->front.depthFailOp = static_cast<VkStencilOp>(get_vulkan_stencil_op(self.stencil_test.depth_fail_op));
+ depth_stencil_info->front.compareOp = static_cast<VkCompareOp>(get_vulkan_predicate(self.stencil_test.compare));
+ depth_stencil_info->front.compareMask = 0xFFFFFFFFU;
+ depth_stencil_info->front.writeMask = 0xFFFFFFFFU;
+ depth_stencil_info->front.reference = self.stencil_test.reference;
+ depth_stencil_info->back = depth_stencil_info->front;
+
+ for(unsigned i=0; i<n_color_attachments; ++i)