Microsoft Announcing HLSL 2021

Started by Stefan, December 09, 2021, 07:38:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Today Microsoft is excited to announce the release of HLSL 2021! HLSL 2021 brings an assortment of new language features that they think will make shader authoring in HLSL more familiar and productive. Enabling HLSL 2021 is as easy as passing the `-HV 2021`, and you can immediately start enjoying all the new language features like:

  • Template functions and data types
  • Overloadable operators for user defined data types
  • Bitfield members for data types
Microsoft intends to make HLSL 2021 the default language version in a future release after giving time for developers to test adopt and migrate code, and for Microsoft to perform more testing and integration. Once it is made the default you can use the `-HV` flag to specify an older language version if needed. There are also some other changes in HLSL 2021 that may have some more subtle or unexpected impact specifically:

  • Strict casting rules for user defined data types
  • Logical operator short circuiting for scalar types
  • C++ `for` loop scoping rules

Read on...