瀏覽代碼

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
Chris B 2 年之前
父節點
當前提交
634c2f3499
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 1 1
      include/dxc/Support/HLSLVersion.h
  2. 5 0
      tools/clang/test/DXC/VersionMacro.hlsl

+ 1 - 1
include/dxc/Support/HLSLVersion.h

@@ -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";

+ 5 - 0
tools/clang/test/DXC/VersionMacro.hlsl

@@ -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