blend state ABI break

main
cosmonaut 2022-02-25 17:51:41 -08:00
parent a828f510af
commit f50295848a
4 changed files with 29 additions and 36 deletions

@ -1 +1 @@
Subproject commit b8b10140a95457a00d658e84d4b67b926f467b15 Subproject commit 32b269526f6e24f695dece00871fec0c5812ca20

BIN
moonlibs/lib64/libRefresh.so.0 (Stored with Git LFS)

Binary file not shown.

View File

@ -1,21 +1,21 @@
using MoonWorks.Window; using MoonWorks;
namespace MoonWorksComputeSpriteBatch namespace MoonWorksComputeSpriteBatch
{ {
class Program class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
WindowCreateInfo windowCreateInfo = new WindowCreateInfo WindowCreateInfo windowCreateInfo = new WindowCreateInfo
{ {
WindowTitle = "Compute Sprite Batch", WindowTitle = "Compute Sprite Batch",
WindowWidth = 1280, WindowWidth = 1280,
WindowHeight = 720, WindowHeight = 720,
ScreenMode = ScreenMode.Windowed ScreenMode = ScreenMode.Windowed
}; };
TestGame game = new TestGame(windowCreateInfo, MoonWorks.Graphics.PresentMode.FIFO, 60, true); TestGame game = new TestGame(windowCreateInfo, MoonWorks.Graphics.PresentMode.FIFO, 60, true);
game.Run(); game.Run();
} }
} }
} }

View File

@ -5,7 +5,6 @@ using System.Runtime.InteropServices;
using MoonWorks; using MoonWorks;
using MoonWorks.Graphics; using MoonWorks.Graphics;
using MoonWorks.Math; using MoonWorks.Math;
using MoonWorks.Window;
namespace MoonWorksComputeSpriteBatch namespace MoonWorksComputeSpriteBatch
{ {
@ -46,17 +45,11 @@ namespace MoonWorksComputeSpriteBatch
/* Pipeline */ /* Pipeline */
ColorTargetBlendState[] colorTargetBlendStates = new ColorTargetBlendState[1]
{
ColorTargetBlendState.None
};
ColorBlendState colorBlendState = new ColorBlendState ColorBlendState colorBlendState = new ColorBlendState
{ {
LogicOpEnable = false, LogicOpEnable = false,
LogicOp = LogicOp.NoOp, LogicOp = LogicOp.NoOp,
BlendConstants = new BlendConstants(), BlendConstants = new BlendConstants()
ColorTargetBlendStates = colorTargetBlendStates
}; };
DepthStencilState depthStencilState = DepthStencilState.Disable; DepthStencilState depthStencilState = DepthStencilState.Disable;
@ -160,17 +153,17 @@ namespace MoonWorksComputeSpriteBatch
{ {
new ColorAttachmentDescription new ColorAttachmentDescription
{ {
format = TextureFormat.R8G8B8A8, Format = TextureFormat.R8G8B8A8,
sampleCount = SampleCount.One SampleCount = SampleCount.One,
BlendState = ColorAttachmentBlendState.None
} }
}; };
GraphicsPipelineAttachmentInfo graphicsPipelineAttachmentInfo = new GraphicsPipelineAttachmentInfo GraphicsPipelineAttachmentInfo graphicsPipelineAttachmentInfo = new GraphicsPipelineAttachmentInfo
{ {
colorAttachmentDescriptions = colorAttachmentDescriptions, ColorAttachmentDescriptions = colorAttachmentDescriptions,
colorAttachmentCount = 1, HasDepthStencilAttachment = false,
hasDepthStencilAttachment = false, DepthStencilFormat = 0
depthStencilFormat = 0
}; };
var graphicsPipelineCreateInfo = new GraphicsPipelineCreateInfo var graphicsPipelineCreateInfo = new GraphicsPipelineCreateInfo
@ -226,10 +219,10 @@ namespace MoonWorksComputeSpriteBatch
var colorAttachmentInfo = new ColorAttachmentInfo var colorAttachmentInfo = new ColorAttachmentInfo
{ {
renderTarget = mainColorTarget, RenderTarget = mainColorTarget,
clearColor = Color.Black, ClearColor = Color.Black,
loadOp = LoadOp.Clear, LoadOp = LoadOp.Clear,
storeOp = StoreOp.DontCare StoreOp = StoreOp.DontCare
}; };
spriteBatch.Flush(commandBuffer, colorAttachmentInfo, spritePipeline, new CameraUniforms { viewProjectionMatrix = viewProjection }); spriteBatch.Flush(commandBuffer, colorAttachmentInfo, spritePipeline, new CameraUniforms { viewProjectionMatrix = viewProjection });