From 67d1d462d1207a53c31b5dd069e35d4326a19f91 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 4 Mar 2022 10:42:57 -0800 Subject: [PATCH] update graphics shader info docs --- .../GraphicsPipeline/GraphicsShaderInfo.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/content/Graphics/Resources/GraphicsPipeline/GraphicsShaderInfo.md b/content/Graphics/Resources/GraphicsPipeline/GraphicsShaderInfo.md index dece76a..79bb0df 100644 --- a/content/Graphics/Resources/GraphicsPipeline/GraphicsShaderInfo.md +++ b/content/Graphics/Resources/GraphicsPipeline/GraphicsShaderInfo.md @@ -1,10 +1,10 @@ --- -title: "Shader Stage State" +title: "Graphics Shader Info" date: 2021-01-28T12:15:13-08:00 weight: 3 --- -We described shader modules earlier, now we get to put them into practice. A shader stage state has three fields: a shader module, an "entry point name", and a "uniform buffer" size. +We described shader modules earlier, now we get to put them into practice. GraphicsShaderInfo has four fields: a shader module, an "entry point name", a "uniform buffer" size, and a sampler binding count. Let's have a look at a simple shader example: @@ -81,7 +81,7 @@ var myColorPhaseFragmentShaderModule = new ShaderModule( "ColorPhaseFrag.spv" ); -var myFragmentShaderState = new GraphicsShaderInfo +var myFragmentShaderInfo = new GraphicsShaderInfo { ShaderModule = myColorPhaseFragmentShaderModule, EntryPoint = "main", @@ -89,3 +89,13 @@ var myFragmentShaderState = new GraphicsShaderInfo SamplerCount = 0 }; ``` + +There's a convenient method for generating GraphicsShaderInfo given a uniform struct type. + +```cs +var myFragmentShaderInfo = GraphicsShaderInfo.Create( + myColorPhaseFragmentShaderModule, + "main", + 0 +); +```