From 49b22ad9cc11e16913b05270103b8ca8416c5cde Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 2 Mar 2022 11:54:29 -0800 Subject: [PATCH] D3D compatibility ABI break --- lib/MoonWorks | 2 +- moonlibs/windows/Refresh.dll | 4 ++-- src/SpriteBatch.cs | 8 +++++--- src/TestGame.cs | 28 ++++++++++------------------ 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/lib/MoonWorks b/lib/MoonWorks index ef10be4..278db7d 160000 --- a/lib/MoonWorks +++ b/lib/MoonWorks @@ -1 +1 @@ -Subproject commit ef10be4e9db616e345c995ed04de6b92ba5d1d06 +Subproject commit 278db7d55b572cf7fc0090b101f02a49770521ec diff --git a/moonlibs/windows/Refresh.dll b/moonlibs/windows/Refresh.dll index 2dcccf4..51371a3 100644 --- a/moonlibs/windows/Refresh.dll +++ b/moonlibs/windows/Refresh.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a2d845e57b46ab3c002770e80a67f2f08d0d8a2ffe93e918edfba96d9fef965 -size 122880 +oid sha256:79e89896207f5660416dde0f3e23172ea217e924f62e1a6d3da77be46d47bce0 +size 119296 diff --git a/src/SpriteBatch.cs b/src/SpriteBatch.cs index 4e697f1..b23319d 100644 --- a/src/SpriteBatch.cs +++ b/src/SpriteBatch.cs @@ -39,14 +39,16 @@ namespace MoonWorksComputeSpriteBatch { var computeShaderModule = new ShaderModule(graphicsDevice, Path.Combine(System.Environment.CurrentDirectory, "Content", "spritebatch.comp.spv")); - var computeShaderState = new ShaderStageState + var computeShaderInfo = new ComputeShaderInfo { ShaderModule = computeShaderModule, EntryPointName = "main", - UniformBufferSize = (uint)Marshal.SizeOf() + UniformBufferSize = (uint)Marshal.SizeOf(), + bufferBindingCount = 2, + imageBindingCount = 0 }; - ComputePipeline = new ComputePipeline(graphicsDevice, computeShaderState, 2, 0); + ComputePipeline = new ComputePipeline(graphicsDevice, computeShaderInfo); } Vertices = new VertexPositionTexcoord[MAX_VERTICES]; diff --git a/src/TestGame.cs b/src/TestGame.cs index 1ee6e65..897b9d0 100644 --- a/src/TestGame.cs +++ b/src/TestGame.cs @@ -35,33 +35,26 @@ namespace MoonWorksComputeSpriteBatch /* Pipeline */ - ColorBlendState colorBlendState = new ColorBlendState - { - LogicOpEnable = false, - LogicOp = LogicOp.NoOp, - BlendConstants = new BlendConstants() - }; - DepthStencilState depthStencilState = DepthStencilState.Disable; - ShaderStageState vertexShaderState = new ShaderStageState + GraphicsShaderInfo vertexShaderInfo = new GraphicsShaderInfo { ShaderModule = vertexShaderModule, EntryPointName = "main", - UniformBufferSize = (uint)Marshal.SizeOf() + UniformBufferSize = (uint)Marshal.SizeOf(), + SamplerBindingCount = 0 }; - ShaderStageState fragmentShaderState = new ShaderStageState + GraphicsShaderInfo fragmentShaderInfo = new GraphicsShaderInfo { ShaderModule = fragmentShaderModule, EntryPointName = "main", - UniformBufferSize = 0 + UniformBufferSize = 0, + SamplerBindingCount = 1 }; MultisampleState multisampleState = MultisampleState.None; - GraphicsPipelineLayoutInfo pipelineLayoutInfo = new GraphicsPipelineLayoutInfo(0, 1); - RasterizerState rasterizerState = RasterizerState.CCW_CullNone; var vertexBindings = new VertexBinding[1] @@ -126,17 +119,16 @@ namespace MoonWorksComputeSpriteBatch var graphicsPipelineCreateInfo = new GraphicsPipelineCreateInfo { - ColorBlendState = colorBlendState, DepthStencilState = depthStencilState, - VertexShaderState = vertexShaderState, - FragmentShaderState = fragmentShaderState, + VertexShaderInfo = vertexShaderInfo, + FragmentShaderInfo = fragmentShaderInfo, MultisampleState = multisampleState, - PipelineLayoutInfo = pipelineLayoutInfo, RasterizerState = rasterizerState, PrimitiveType = PrimitiveType.TriangleList, VertexInputState = vertexInputState, ViewportState = viewportState, - AttachmentInfo = graphicsPipelineAttachmentInfo + AttachmentInfo = graphicsPipelineAttachmentInfo, + BlendConstants = new BlendConstants() }; spritePipeline = new GraphicsPipeline(GraphicsDevice, graphicsPipelineCreateInfo);