From a8e5246e64a15e0a426b4d07042f36eac4f5ecc5 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 19 Oct 2021 04:27:20 +0000 Subject: [PATCH] Clarify shader binding layout --- .../Resources/GraphicsPipeline/ShaderStageState.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/content/Graphics/Resources/GraphicsPipeline/ShaderStageState.md b/content/Graphics/Resources/GraphicsPipeline/ShaderStageState.md index 1732fba..f961d0a 100644 --- a/content/Graphics/Resources/GraphicsPipeline/ShaderStageState.md +++ b/content/Graphics/Resources/GraphicsPipeline/ShaderStageState.md @@ -33,7 +33,18 @@ This shader outputs for each pixel a color value dependent on a time value and t Notice the "main" function here. This will be our "entry point". You can name your entry point function anything you want and pass it to the EntryPointName field. You can even have multiple entry points compiled in the same shader module! This is why it is called a "shader module" and not just a shader. -Finally, notice the "UniformBlock" above. This block describes "shader uniforms". Shader uniforms are used to pass in state to the shader that it needs to to do its job when that info doesn't come from the vertex shader. +Refresh expects a particular `set` layout depending on the shader stage. + +Vertex Sampler -> Set 0 +Vertex Uniforms -> Set 2 +Fragment Sampler -> Set 1 +Fragment Uniforms -> Set 3 + +The "binding" count should start at 0 and increment by 1 for each binding of that type. + +"Samplers" are shader objects that consist of a texture and a filter mode. You can use samplers to do something as simple as display an image, or as complex as sampling depth values to construct a shadow map. + +Notice the "UniformBlock" above. This block describes "shader uniforms". Shader uniforms are used to pass in state to the shader that it needs to to do its job when that info doesn't come from the vertex shader. To elaborate a bit: the graphics pipeline looks like this so far.