Microsoft provides a list explaining the input and output semantics of vertex and pixel shaders. By now I've seen some code examples that don't use the documented data types. They are using float3
as input COLOR
to the pixel shader or float2
as input POSITION
to the vertex shader. Even though a 2-component position or a 3-component color do make sense to me, I can't find this documented, which makes me wonder
Can I use
float3
as vertex shader inputPOSITION
(if I know I won't be using the W component) without expecting errors?If I can use data types other than the documented ones, is there a list available that shows every allowed data type for a semantic or a rule like "As long as the used data type is smaller or equally sized as the documented one, you can use it"?
Code examples not following the documentation:
StackOverflow - Passing colors through a pixel shader in HLSL
C++ / DirectX11 Tutorials - S02E05 - Creating and loading Shaders at 9:33