diff --git a/lib/RefreshCS b/lib/RefreshCS
index 5a411e48..61ec63b7 160000
--- a/lib/RefreshCS
+++ b/lib/RefreshCS
@@ -1 +1 @@
-Subproject commit 5a411e482ebe619a7e85c44584faa5bd71b7ee3b
+Subproject commit 61ec63b71f9fc3163ef5a8d985fbb53e3f02dbf9
diff --git a/src/Graphics/RefreshStructs.cs b/src/Graphics/RefreshStructs.cs
index 8c0602a0..f0597c37 100644
--- a/src/Graphics/RefreshStructs.cs
+++ b/src/Graphics/RefreshStructs.cs
@@ -154,5 +154,6 @@ namespace MoonWorks.Graphics
{
public TextureFormat Format;
public SampleCount SampleCount;
+ public ColorAttachmentBlendState BlendState;
}
}
diff --git a/src/Graphics/Resources/GraphicsPipeline.cs b/src/Graphics/Resources/GraphicsPipeline.cs
index 14b9c125..1226fbbb 100644
--- a/src/Graphics/Resources/GraphicsPipeline.cs
+++ b/src/Graphics/Resources/GraphicsPipeline.cs
@@ -49,15 +49,6 @@ namespace MoonWorks.Graphics
GCHandleType.Pinned
);
- var colorTargetBlendStates = stackalloc Refresh.ColorTargetBlendState[
- colorBlendState.ColorTargetBlendStates.Length
- ];
-
- for (var i = 0; i < colorBlendState.ColorTargetBlendStates.Length; i += 1)
- {
- colorTargetBlendStates[i] = colorBlendState.ColorTargetBlendStates[i].ToRefreshColorTargetBlendState();
- }
-
var colorAttachmentDescriptions = stackalloc Refresh.ColorAttachmentDescription[
(int) attachmentInfo.ColorAttachmentDescriptions.Length
];
@@ -66,14 +57,13 @@ namespace MoonWorks.Graphics
{
colorAttachmentDescriptions[i].format = (Refresh.TextureFormat) attachmentInfo.ColorAttachmentDescriptions[i].Format;
colorAttachmentDescriptions[i].sampleCount = (Refresh.SampleCount) attachmentInfo.ColorAttachmentDescriptions[i].SampleCount;
+ colorAttachmentDescriptions[i].blendState = attachmentInfo.ColorAttachmentDescriptions[i].BlendState.ToRefresh();
}
Refresh.GraphicsPipelineCreateInfo refreshGraphicsPipelineCreateInfo;
refreshGraphicsPipelineCreateInfo.colorBlendState.logicOpEnable = Conversions.BoolToByte(colorBlendState.LogicOpEnable);
refreshGraphicsPipelineCreateInfo.colorBlendState.logicOp = (Refresh.LogicOp) colorBlendState.LogicOp;
- refreshGraphicsPipelineCreateInfo.colorBlendState.blendStates = (IntPtr) colorTargetBlendStates;
- refreshGraphicsPipelineCreateInfo.colorBlendState.blendStateCount = (uint) colorBlendState.ColorTargetBlendStates.Length;
refreshGraphicsPipelineCreateInfo.colorBlendState.blendConstants[0] = colorBlendState.BlendConstants.R;
refreshGraphicsPipelineCreateInfo.colorBlendState.blendConstants[1] = colorBlendState.BlendConstants.G;
refreshGraphicsPipelineCreateInfo.colorBlendState.blendConstants[2] = colorBlendState.BlendConstants.B;
diff --git a/src/Graphics/State/ColorTargetBlendState.cs b/src/Graphics/State/ColorAttachmentBlendState.cs
similarity index 82%
rename from src/Graphics/State/ColorTargetBlendState.cs
rename to src/Graphics/State/ColorAttachmentBlendState.cs
index c12e7064..83204b57 100644
--- a/src/Graphics/State/ColorTargetBlendState.cs
+++ b/src/Graphics/State/ColorAttachmentBlendState.cs
@@ -2,7 +2,7 @@
namespace MoonWorks.Graphics
{
- public struct ColorTargetBlendState
+ public struct ColorAttachmentBlendState
{
///
/// If disabled, no blending will occur.
@@ -43,7 +43,7 @@ namespace MoonWorks.Graphics
///
public BlendFactor SourceColorBlendFactor;
- public static readonly ColorTargetBlendState Additive = new ColorTargetBlendState
+ public static readonly ColorAttachmentBlendState Additive = new ColorAttachmentBlendState
{
BlendEnable = true,
AlphaBlendOp = BlendOp.Add,
@@ -55,7 +55,7 @@ namespace MoonWorks.Graphics
DestinationAlphaBlendFactor = BlendFactor.One
};
- public static readonly ColorTargetBlendState AlphaBlend = new ColorTargetBlendState
+ public static readonly ColorAttachmentBlendState AlphaBlend = new ColorAttachmentBlendState
{
BlendEnable = true,
AlphaBlendOp = BlendOp.Add,
@@ -67,7 +67,7 @@ namespace MoonWorks.Graphics
DestinationAlphaBlendFactor = BlendFactor.OneMinusSourceAlpha
};
- public static readonly ColorTargetBlendState NonPremultiplied = new ColorTargetBlendState
+ public static readonly ColorAttachmentBlendState NonPremultiplied = new ColorAttachmentBlendState
{
BlendEnable = true,
AlphaBlendOp = BlendOp.Add,
@@ -79,7 +79,7 @@ namespace MoonWorks.Graphics
DestinationAlphaBlendFactor = BlendFactor.OneMinusSourceAlpha
};
- public static readonly ColorTargetBlendState Opaque = new ColorTargetBlendState
+ public static readonly ColorAttachmentBlendState Opaque = new ColorAttachmentBlendState
{
BlendEnable = true,
AlphaBlendOp = BlendOp.Add,
@@ -91,21 +91,21 @@ namespace MoonWorks.Graphics
DestinationAlphaBlendFactor = BlendFactor.Zero
};
- public static readonly ColorTargetBlendState None = new ColorTargetBlendState
+ public static readonly ColorAttachmentBlendState None = new ColorAttachmentBlendState
{
BlendEnable = false,
ColorWriteMask = ColorComponentFlags.RGBA
};
- public static readonly ColorTargetBlendState Disable = new ColorTargetBlendState
+ public static readonly ColorAttachmentBlendState Disable = new ColorAttachmentBlendState
{
BlendEnable = false,
ColorWriteMask = ColorComponentFlags.None
};
- public Refresh.ColorTargetBlendState ToRefreshColorTargetBlendState()
+ public Refresh.ColorAttachmentBlendState ToRefresh()
{
- return new Refresh.ColorTargetBlendState
+ return new Refresh.ColorAttachmentBlendState
{
blendEnable = Conversions.BoolToByte(BlendEnable),
alphaBlendOp = (Refresh.BlendOp) AlphaBlendOp,
diff --git a/src/Graphics/State/ColorBlendState.cs b/src/Graphics/State/ColorBlendState.cs
index ca01e17d..4e34546f 100644
--- a/src/Graphics/State/ColorBlendState.cs
+++ b/src/Graphics/State/ColorBlendState.cs
@@ -2,13 +2,11 @@
{
///
/// Describes how the graphics pipeline will blend colors.
- /// You must provide one ColorTargetBlendState per color target in the pipeline.
///
public unsafe struct ColorBlendState
{
public bool LogicOpEnable;
public LogicOp LogicOp;
public BlendConstants BlendConstants;
- public ColorTargetBlendState[] ColorTargetBlendStates;
}
}