API update

main
cosmonaut 2021-01-28 17:45:03 -08:00
parent 1d4cf2e23a
commit 2981db7144
3 changed files with 52 additions and 47 deletions

@ -1 +1 @@
Subproject commit d10f018f141d9246f2c438e889c2ab3ec0d2716c Subproject commit c65485a31ca526a4a3dc24b3eadbc9a1dc61daa9

Binary file not shown.

View File

@ -57,7 +57,7 @@ namespace MoonWorksTest
woodTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/woodgrain.png")); woodTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/woodgrain.png"));
noiseTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/noise.png")); noiseTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/noise.png"));
sampler = new Sampler(GraphicsDevice, SamplerState.LinearWrap); sampler = new Sampler(GraphicsDevice, SamplerCreateInfo.LinearWrap);
/* Load Vertex Data */ /* Load Vertex Data */
@ -85,15 +85,15 @@ namespace MoonWorksTest
/* Render Pass */ /* Render Pass */
renderArea.x = 0; renderArea.X = 0;
renderArea.y = 0; renderArea.Y = 0;
renderArea.w = (int) windowWidth; renderArea.W = (int) windowWidth;
renderArea.h = (int) windowHeight; renderArea.H = (int) windowHeight;
flip.x = 0; flip.X = 0;
flip.y = (int) windowHeight; flip.Y = (int) windowHeight;
flip.w = (int) windowWidth; flip.W = (int) windowWidth;
flip.h = -(int) windowHeight; flip.H = -(int) windowHeight;
clearColor.R = 237; clearColor.R = 237;
clearColor.G = 41; clearColor.G = 41;
@ -102,10 +102,10 @@ namespace MoonWorksTest
ColorTargetDescription colorTargetDescription = new ColorTargetDescription ColorTargetDescription colorTargetDescription = new ColorTargetDescription
{ {
format = TextureFormat.R8G8B8A8, Format = TextureFormat.R8G8B8A8,
multisampleCount = SampleCount.One, MultisampleCount = SampleCount.One,
loadOp = LoadOp.Clear, LoadOp = LoadOp.Clear,
storeOp = StoreOp.Store StoreOp = StoreOp.Store
}; };
mainRenderPass = new RenderPass(GraphicsDevice, colorTargetDescription); mainRenderPass = new RenderPass(GraphicsDevice, colorTargetDescription);
@ -163,7 +163,7 @@ namespace MoonWorksTest
MultisampleState multisampleState = MultisampleState.None; MultisampleState multisampleState = MultisampleState.None;
GraphicsPipelineLayoutCreateInfo pipelineLayoutCreateInfo = new GraphicsPipelineLayoutCreateInfo GraphicsPipelineLayoutInfo pipelineLayoutInfo = new GraphicsPipelineLayoutInfo
{ {
VertexSamplerBindingCount = 0, VertexSamplerBindingCount = 0,
FragmentSamplerBindingCount = 2 FragmentSamplerBindingCount = 2
@ -175,9 +175,9 @@ namespace MoonWorksTest
{ {
new VertexBinding new VertexBinding
{ {
binding = 0, Binding = 0,
inputRate = VertexInputRate.Vertex, InputRate = VertexInputRate.Vertex,
stride = 4 * 5 Stride = 4 * 5
} }
}; };
@ -185,17 +185,17 @@ namespace MoonWorksTest
{ {
new VertexAttribute new VertexAttribute
{ {
binding = 0, Binding = 0,
location = 0, Location = 0,
format = VertexElementFormat.Vector3, Format = VertexElementFormat.Vector3,
offset = 0 Offset = 0
}, },
new VertexAttribute new VertexAttribute
{ {
binding = 0, Binding = 0,
location = 1, Location = 1,
format = VertexElementFormat.Vector2, Format = VertexElementFormat.Vector2,
offset = 4 * 3 Offset = 4 * 3
} }
}; };
@ -209,12 +209,12 @@ namespace MoonWorksTest
{ {
new Viewport new Viewport
{ {
x = 0, X = 0,
y = 0, Y = 0,
w = windowWidth, W = windowWidth,
h = windowHeight, H = windowHeight,
minDepth = 0, MinDepth = 0,
maxDepth = 1 MaxDepth = 1
} }
}; };
@ -222,10 +222,10 @@ namespace MoonWorksTest
{ {
new Rect new Rect
{ {
x = 0, X = 0,
y = 0, Y = 0,
w = (int) windowWidth, W = (int) windowWidth,
h = (int) windowHeight H = (int) windowHeight
} }
}; };
@ -235,19 +235,24 @@ namespace MoonWorksTest
Scissors = scissors Scissors = scissors
}; };
var graphicsPipelineCreateInfo = new GraphicsPipelineCreateInfo
{
ColorBlendState = colorBlendState,
DepthStencilState = depthStencilState,
VertexShaderState = vertexShaderState,
FragmentShaderState = fragmentShaderState,
MultisampleState = multisampleState,
PipelineLayoutInfo = pipelineLayoutInfo,
RasterizerState = rasterizerState,
PrimitiveType = PrimitiveType.TriangleList,
VertexInputState = vertexInputState,
ViewportState = viewportState,
RenderPass = mainRenderPass
};
mainGraphicsPipeline = new GraphicsPipeline( mainGraphicsPipeline = new GraphicsPipeline(
GraphicsDevice, GraphicsDevice,
colorBlendState, graphicsPipelineCreateInfo
depthStencilState,
vertexShaderState,
fragmentShaderState,
multisampleState,
pipelineLayoutCreateInfo,
rasterizerState,
PrimitiveType.TriangleList,
vertexInputState,
viewportState,
mainRenderPass
); );
screenShotBufferSize = windowWidth * windowHeight * 4; screenShotBufferSize = windowWidth * windowHeight * 4;