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, POSITION and 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

  • 4
    \$\begingroup\$ In D3D10-11 there are actually no predefined semantics anymore besides the SV_* ones. Predefined names like NORMAL, POSITION etc. were used in D3D9, and of course you can still use those names if you like, but as far as the compiler is concerned, they're user-defined semantics. So there are only 2 kinds of semantics really: system values and user-defined ones. \$\endgroup\$ Commented Feb 23, 2014 at 2:19
  • \$\begingroup\$ @NathanReed I feel like your comment is the real, to-the-point answer to this question. \$\endgroup\$
    – dialer
    Commented Oct 6, 2021 at 21:02

1 Answer 1


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.

  • 1
    \$\begingroup\$ Ok, so why are they there in the first place (we can document the code with comments)? Except the SV_* group, of course. Historical remains? \$\endgroup\$
    – NPS
    Commented Feb 22, 2014 at 20:47
  • 1
    \$\begingroup\$ @NPS It's like the en.wikipedia.org/wiki/Named_parameter idiom used in some languages it gives the code more clarity. you can't force comments though. \$\endgroup\$
    – concept3d
    Commented Feb 22, 2014 at 20:58
  • \$\begingroup\$ So do you say THE ONLY reason for their existence is code clarity? :P \$\endgroup\$
    – NPS
    Commented Feb 22, 2014 at 21:43
  • 1
    \$\begingroup\$ @NPS Yes. GLSL for example doesn't do that same, so if you want to tell the attributes semantics you do this by actually naming the parameters. For example you say, in vec2 textureCoord. if you said in vec3 t that could be texture coords or tangents. adding the semantics clarifies this without reading the code. \$\endgroup\$
    – concept3d
    Commented Feb 22, 2014 at 21:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .