Skip to content

Commit 634c2f3

Browse files
authored
Make HLSL 2021 the default language mode (#5466)
This enables HLSL 2021 as the default language mode. The mode can be overridden to older language modes using the -HV flag. Fixes #5465
1 parent b4044d2 commit 634c2f3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/dxc/Support/HLSLVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ enum class LangStd : unsigned long {
2525
v2018 = 2018,
2626
v2021 = 2021,
2727
v202x = 2029,
28-
vLatest = v2018
28+
vLatest = v2021
2929
};
3030

3131
constexpr const char *ValidVersionsStr = "2015, 2016, 2017, 2018, and 2021";

tools/clang/test/DXC/VersionMacro.hlsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@
1818
// RUN: FileCheck --input-file=%t.v2021.hlsl.pp %s --check-prefix=HV21
1919
// HV21: 2021
2020

21+
// Verify the default version:
22+
// RUN: %dxc %s -P %t.default.hlsl.pp
23+
// RUN: FileCheck --input-file=%t.v2021.hlsl.pp %s --check-prefix=Default
24+
// Default: 2021
25+
2126
__HLSL_VERSION

0 commit comments

Comments
 (0)