Clarify shader binding layout
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
63f507dbce
commit
a8e5246e64
|
@ -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.
|
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.
|
To elaborate a bit: the graphics pipeline looks like this so far.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue