public GraphicsPipelineBuilder AttachmentBlendOn(uint attachment, VkBlendFactor srcColorFactor, VkBlendFactor dstColorFactor, VkBlendOp colorOp, VkBlendFactor?srcAlphaFactor = null, VkBlendFactor?dstAlphaFactor = null, VkBlendOp?alphaOp = null, VkColorComponentFlag writeMask = VkColorComponentFlag.R | VkColorComponentFlag.G | VkColorComponentFlag.B | VkColorComponentFlag.A) { if (!srcAlphaFactor.HasValue) { srcAlphaFactor = srcColorFactor; } if (!dstAlphaFactor.HasValue) { dstAlphaFactor = dstColorFactor; } if (!alphaOp.HasValue) { alphaOp = colorOp; } _blendAttachmentStates.Add(attachment, new VkPipelineColorBlendAttachmentState() { BlendEnable = true, SrcColorBlendFactor = srcColorFactor, DstColorBlendFactor = dstColorFactor, ColorBlendOp = colorOp, SrcAlphaBlendFactor = srcAlphaFactor.Value, DstAlphaBlendFactor = dstAlphaFactor.Value, AlphaBlendOp = alphaOp.Value, ColorWriteMask = writeMask }); return(this); }
public VkPipelineColorBlendAttachmentState(VkBool32 blendEnable, VkBlendFactor srcColorBlendFactor = VkBlendFactor.SrcAlpha, VkBlendFactor dstColorBlendFactor = VkBlendFactor.OneMinusSrcAlpha, VkBlendOp colorBlendOp = VkBlendOp.Add, VkBlendFactor srcAlphaBlendFactor = VkBlendFactor.OneMinusSrcAlpha, VkBlendFactor dstAlphaBlendFactor = VkBlendFactor.Zero, VkBlendOp alphaBlendOp = VkBlendOp.Add, VkColorComponentFlags colorWriteMask = VkColorComponentFlags.R | VkColorComponentFlags.G | VkColorComponentFlags.B | VkColorComponentFlags.A) { this.blendEnable = blendEnable; this._srcColorBlendFactor = (int)srcColorBlendFactor; this._dstColorBlendFactor = (int)dstColorBlendFactor; this._colorBlendOp = (int)colorBlendOp; this._srcAlphaBlendFactor = (int)srcAlphaBlendFactor; this._dstAlphaBlendFactor = (int)dstAlphaBlendFactor; this._alphaBlendOp = (int)alphaBlendOp; this._colorWriteMask = (uint)colorWriteMask; }
public VkPipelineColorBlendAttachmentState( bool blendEnable = false, VkBlendFactor srcColorBlendFactor = VkBlendFactor.One, VkBlendFactor dstColorBlendFactor = VkBlendFactor.Zero, VkBlendOp colorBlendOp = VkBlendOp.Add, VkBlendFactor srcAlphaBlendFactor = VkBlendFactor.One, VkBlendFactor dstAlphaBlendFactor = VkBlendFactor.Zero, VkBlendOp alphaBlendOp = VkBlendOp.Add, VkColorComponentFlags colorWriteMask = VkColorComponentFlags.All) { this.blendEnable = blendEnable; this.srcColorBlendFactor = srcColorBlendFactor; this.dstColorBlendFactor = dstColorBlendFactor; this.colorBlendOp = colorBlendOp; this.srcAlphaBlendFactor = srcAlphaBlendFactor; this.dstAlphaBlendFactor = dstAlphaBlendFactor; this.alphaBlendOp = alphaBlendOp; this.colorWriteMask = colorWriteMask; }