I'd say there are 3 kinds of HLSL semantics:
SV_*group - these are "system value" semantics which DO carry special meanings (e.g. assign special input/output data to/from shader stages)- predefined semantics - e.g.
NORMAL,POSITIONand so on... They are mentioned in the docs but I failed to find any special meaning assigned to them - semantics defined be the user - which can be anything (e.g.
MY_AWESOME_TEXTURE_SEMANTIC) which apparently have no special meaning either
In addition, the docs say that more than one input/output value can have the same semantic assigned (e.g. 'NORMAL2 and NORMAL2). I guess that it doesn't include the SV_* group, though.
So besides the first group - do semantics carry any meaning at all? Do they even serve any purpose at all? :P
Answer
Do they even serve any purpose at all?
Yes for the user and developer of the shader, semantics conveys information about the intended use of a parameter. So you will know that POSITION is intended to be used as vertex position, NORMAL as vertex normal etc. Think of this as in-code documentation (not strictly the same though).
Do semantics carry any meaning at all?
They don't carry a meaning for the system, as they are not interpreted, but again for the user. You don't want to give vertex position a NORMAL semantic, it's really like deceiving the user/developer of the shader, it's confusing, it's like writing wrong documentation.
No comments:
Post a Comment