================
@@ -4284,11 +4284,25 @@ bool CompilerInvocation::ParseLangArgs(LangOptions 
&Opts, ArgList &Args,
           Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported)
               << ShaderModel << T.getOSName() << T.str();
         }
+        // validate that if fnative-half-type is given, that
+        // the language standard is at least hlsl2021, and that
+        // the target shader model is at least 6.2
+        if (Args.getLastArg(OPT_fnative_half_type)) {
+          if (!(Opts.LangStd >= LangStandard::lang_hlsl2021 &&
+                T.getOSVersion() >= VersionTuple(6, 2)))
+            Diags.Report(diag::err_drv_dxc_enable_16bit_types_option_invalid);
----------------
sudonatalie wrote:
Hm, I assume `enable-16bit-types` is the DXC compatibility driver flag and 
`fnative_half_type` is the plain clang flag. I don't have an opinion here but 
it might be worth thinking about in general how to handle selecting different 
error messages for these cases since they'll probably be common and it could be 
a bit confusing if the user uses A but the error message is for B.

https://github.com/llvm/llvm-project/pull/85340
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to