Skip to content

Commit

Permalink
Make HLSL 2021 the default language mode (#5466)
Browse files Browse the repository at this point in the history
This enables HLSL 2021 as the default language mode. The mode can be
overridden to older language modes using the -HV flag.

Fixes #5465
  • Loading branch information
llvm-beanz authored Jul 27, 2023
1 parent b4044d2 commit 634c2f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/dxc/Support/HLSLVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum class LangStd : unsigned long {
v2018 = 2018,
v2021 = 2021,
v202x = 2029,
vLatest = v2018
vLatest = v2021
};

constexpr const char *ValidVersionsStr = "2015, 2016, 2017, 2018, and 2021";
Expand Down
5 changes: 5 additions & 0 deletions tools/clang/test/DXC/VersionMacro.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
// RUN: FileCheck --input-file=%t.v2021.hlsl.pp %s --check-prefix=HV21
// HV21: 2021

// Verify the default version:
// RUN: %dxc %s -P %t.default.hlsl.pp
// RUN: FileCheck --input-file=%t.v2021.hlsl.pp %s --check-prefix=Default
// Default: 2021

__HLSL_VERSION

0 comments on commit 634c2f3

Please sign in to comment.