Compare commits

...

3 Commits

24 changed files with 48 additions and 73 deletions

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -51,11 +51,7 @@ namespace MoonWorks.Test
vertShaderModule,
fragShaderModule
);
drawPipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionTextureVertex>(),
VertexAttribute.Create<PositionTextureVertex>("Position", 0),
VertexAttribute.Create<PositionTextureVertex>("TexCoord", 1)
);
drawPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
drawPipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1;
drawPipeline = new GraphicsPipeline(

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -52,11 +52,7 @@ namespace MoonWorks.Test
vertShaderModule,
fragShaderModule
);
drawPipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionTextureVertex>(),
VertexAttribute.Create<PositionTextureVertex>("Position", 0),
VertexAttribute.Create<PositionTextureVertex>("TexCoord", 1)
);
drawPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
drawPipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1;
drawPipeline = new GraphicsPipeline(

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -165,11 +165,7 @@ namespace MoonWorks.Test
),
DepthStencilState = DepthStencilState.DepthReadWrite,
VertexShaderInfo = GraphicsShaderInfo.Create<ViewProjectionUniforms>(cubeVertShaderModule, "main", 0),
VertexInputState = new VertexInputState(
VertexBinding.Create<PositionColorVertex>(),
VertexAttribute.Create<PositionColorVertex>("Position", 0),
VertexAttribute.Create<PositionColorVertex>("Color", 1)
),
VertexInputState = VertexInputState.CreateSingleBinding<PositionColorVertex>(),
PrimitiveType = PrimitiveType.TriangleList,
FragmentShaderInfo = GraphicsShaderInfo.Create(cubeFragShaderModule, "main", 0),
RasterizerState = RasterizerState.CW_CullBack,
@ -193,10 +189,7 @@ namespace MoonWorks.Test
),
DepthStencilState = DepthStencilState.DepthReadWrite,
VertexShaderInfo = GraphicsShaderInfo.Create<ViewProjectionUniforms>(skyboxVertShaderModule, "main", 0),
VertexInputState = new VertexInputState(
VertexBinding.Create<PositionVertex>(),
VertexAttribute.Create<PositionVertex>("Position", 0)
),
VertexInputState = VertexInputState.CreateSingleBinding<PositionVertex>(),
PrimitiveType = PrimitiveType.TriangleList,
FragmentShaderInfo = GraphicsShaderInfo.Create(skyboxFragShaderModule, "main", 1),
RasterizerState = RasterizerState.CW_CullNone,
@ -214,11 +207,7 @@ namespace MoonWorks.Test
blitVertShaderModule,
blitFragShaderModule
);
blitPipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionTextureVertex>(),
VertexAttribute.Create<PositionTextureVertex>("Position", 0),
VertexAttribute.Create<PositionTextureVertex>("TexCoord", 1)
);
blitPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
blitPipelineCreateInfo.FragmentShaderInfo = GraphicsShaderInfo.Create<DepthUniforms>(blitFragShaderModule, "main", 1);
blitPipeline = new GraphicsPipeline(GraphicsDevice, blitPipelineCreateInfo);
}

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -31,11 +31,7 @@ namespace MoonWorks.Test
vertShaderModule,
fragShaderModule
);
pipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionColorVertex>(),
VertexAttribute.Create<PositionColorVertex>("Position", 0),
VertexAttribute.Create<PositionColorVertex>("Color", 1)
);
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionColorVertex>();
pipelineCreateInfo.RasterizerState = RasterizerState.CW_CullNone;
CW_CullNonePipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo);
@ -99,6 +95,8 @@ namespace MoonWorks.Test
{
cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, Color.Black));
// Need to bind a pipeline before binding vertex buffers
cmdbuf.BindGraphicsPipeline(CW_CullNonePipeline);
if (useClockwiseWinding)
{
cmdbuf.BindVertexBuffers(cwVertexBuffer);
@ -109,7 +107,6 @@ namespace MoonWorks.Test
}
cmdbuf.SetViewport(new Viewport(0, 0, 213, 240));
cmdbuf.BindGraphicsPipeline(CW_CullNonePipeline);
cmdbuf.DrawPrimitives(0, 1, 0, 0);
cmdbuf.SetViewport(new Viewport(213, 0, 213, 240));

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -23,11 +23,7 @@ namespace MoonWorks.Test
vertShaderModule,
fragShaderModule
);
pipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionColorVertex>(),
VertexAttribute.Create<PositionColorVertex>("Position", 0),
VertexAttribute.Create<PositionColorVertex>("Color", 1)
);
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionColorVertex>();
graphicsPipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo);
// Create and populate the vertex buffer

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -45,11 +45,7 @@ namespace MoonWorks.Test
blitVertShaderModule,
blitFragShaderModule
);
pipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionTextureVertex>(),
VertexAttribute.Create<PositionTextureVertex>("Position", 0),
VertexAttribute.Create<PositionTextureVertex>("TexCoord", 1)
);
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
pipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1;
blitPipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo);
@ -128,7 +124,7 @@ namespace MoonWorks.Test
rt,
Color.Black,
currentSampleCount,
StoreOp.DontCare
StoreOp.Store
)
);
cmdbuf.BindGraphicsPipeline(msaaPipelines[(int) currentSampleCount]);

View File

@ -6,7 +6,7 @@
<PropertyGroup>
<OutputType>library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -5,7 +5,7 @@ using MoonWorks.Math.Float;
namespace MoonWorks.Test
{
[StructLayout(LayoutKind.Sequential)]
public struct PositionVertex
public struct PositionVertex : IVertexType
{
public Vector3 Position;
@ -14,6 +14,11 @@ namespace MoonWorks.Test
Position = position;
}
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[1]
{
VertexElementFormat.Vector3
};
public override string ToString()
{
return Position.ToString();
@ -21,7 +26,7 @@ namespace MoonWorks.Test
}
[StructLayout(LayoutKind.Sequential)]
public struct PositionColorVertex
public struct PositionColorVertex : IVertexType
{
public Vector3 Position;
public Color Color;
@ -32,6 +37,12 @@ namespace MoonWorks.Test
Color = color;
}
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[2]
{
VertexElementFormat.Vector3,
VertexElementFormat.Color
};
public override string ToString()
{
return Position + " | " + Color;
@ -39,7 +50,7 @@ namespace MoonWorks.Test
}
[StructLayout(LayoutKind.Sequential)]
public struct PositionTextureVertex
public struct PositionTextureVertex : IVertexType
{
public Vector3 Position;
public Vector2 TexCoord;
@ -50,6 +61,12 @@ namespace MoonWorks.Test
TexCoord = texCoord;
}
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[2]
{
VertexElementFormat.Vector3,
VertexElementFormat.Vector2
};
public override string ToString()
{
return Position + " | " + TexCoord;

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -50,11 +50,7 @@ namespace MoonWorks.Test
fragShaderModule
);
pipelineCreateInfo.AttachmentInfo.ColorAttachmentDescriptions[0].BlendState = ColorAttachmentBlendState.AlphaBlend;
pipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionTextureVertex>(),
VertexAttribute.Create<PositionTextureVertex>("Position", 0),
VertexAttribute.Create<PositionTextureVertex>("TexCoord", 1)
);
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
pipelineCreateInfo.VertexShaderInfo = GraphicsShaderInfo.Create<VertexUniforms>(vertShaderModule, "main", 0);
pipelineCreateInfo.FragmentShaderInfo = GraphicsShaderInfo.Create<FragmentUniforms>(fragShaderModule, "main", 1);
pipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo);

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -38,11 +38,7 @@ namespace MoonWorks.Test
vertShaderModule,
fragShaderModule
);
pipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionTextureVertex>(),
VertexAttribute.Create<PositionTextureVertex>("Position", 0),
VertexAttribute.Create<PositionTextureVertex>("TexCoord", 1)
);
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
pipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1;
pipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo);

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<Platforms>x64</Platforms>
</PropertyGroup>

View File

@ -21,11 +21,7 @@ namespace MoonWorks.Test
vertShaderModule,
fragShaderModule
);
pipelineCreateInfo.VertexInputState = new VertexInputState(
VertexBinding.Create<PositionColorVertex>(),
VertexAttribute.Create<PositionColorVertex>("Position", 0),
VertexAttribute.Create<PositionColorVertex>("Color", 1)
);
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionColorVertex>();
pipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo);
// Create and populate the vertex buffer