From 0a8cd263c99b70cd00474105e493a48ed8c3cba1 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 28 Jan 2021 13:43:21 -0800 Subject: [PATCH] graphics pipeline final --- .../GraphicsPipeline/GraphicsPipeline.md | 31 +++++++++++++++++++ .../GraphicsPipeline/ViewportState.md | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 content/Graphics/Resources/GraphicsPipeline/GraphicsPipeline.md diff --git a/content/Graphics/Resources/GraphicsPipeline/GraphicsPipeline.md b/content/Graphics/Resources/GraphicsPipeline/GraphicsPipeline.md new file mode 100644 index 0000000..d597053 --- /dev/null +++ b/content/Graphics/Resources/GraphicsPipeline/GraphicsPipeline.md @@ -0,0 +1,31 @@ +--- +title: "Graphics Pipeline" +date: 2021-01-28T13:30:11-08:00 +weight: 10 +--- + +Finally, we have everything we need to build the graphics pipeline. We just need to pass our various structures into a `GraphicsPipelineCreateInfo` object. + +```cs +var myGraphicsPipelineCreateInfo = new GraphicsPipelineCreateInfo +{ + ColorBlendState = myColorBlendState, + DepthStencilState = myDepthStencilState, + VertexShaderState = myVertexShaderState, + FragmentShaderState = myFragmentShaderState, + MultisampleState = myMultisampleState, + PipelineLayoutInfo = myPipelineLayoutInfo, + RasterizerState = myRasterizerState, + PrimitiveType = PrimitiveType.TriangleList, + VertexInputState = myVertexInputState, + ViewportState = myViewportState, + RenderPass = myRenderPass +}; + +var myGraphicsPipeline = new GraphicsPipeline( + GraphicsDevice, + myGraphicsPipelineCreateInfo +); +``` + +Finally! That's it! You might have noticed that a lot of this structure can be reused across pipelines. I strongly recommend creating individual container objects for the various states your renderer uses so you don't have to repeat yourself a whole bunch. diff --git a/content/Graphics/Resources/GraphicsPipeline/ViewportState.md b/content/Graphics/Resources/GraphicsPipeline/ViewportState.md index e56138b..e2c9663 100644 --- a/content/Graphics/Resources/GraphicsPipeline/ViewportState.md +++ b/content/Graphics/Resources/GraphicsPipeline/ViewportState.md @@ -1,5 +1,5 @@ --- -title: "ViewportState" +title: "Viewport State" date: 2021-01-28T13:20:55-08:00 weight: 8 ---