[llvm] [clang] [HLSL][SPIR-V] Add Vulkan to target triple (PR #76749)
Natalie Chouinard via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 3 07:59:10 PST 2024
================
@@ -4236,20 +4236,35 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
// TODO: Revisit restricting SPIR-V to logical once we've figured out how to
// handle PhysicalStorageBuffer64 memory model
if (T.isDXIL() || T.isSPIRVLogical()) {
- enum { ShaderModel, ShaderStage };
+ enum { ShaderModel, VulkanEnv, ShaderStage };
+ enum { OS, Environment };
+
+ int ExpectedOS = T.isSPIRVLogical() ? VulkanEnv : ShaderModel;
+
if (T.getOSName().empty()) {
Diags.Report(diag::err_drv_hlsl_bad_shader_required_in_target)
- << ShaderModel << T.str();
- } else if (!T.isShaderModelOS() || T.getOSVersion() == VersionTuple(0)) {
- Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported)
- << ShaderModel << T.getOSName() << T.str();
+ << ExpectedOS << OS << T.str();
} else if (T.getEnvironmentName().empty()) {
Diags.Report(diag::err_drv_hlsl_bad_shader_required_in_target)
- << ShaderStage << T.str();
+ << ShaderStage << Environment << T.str();
} else if (!T.isShaderStageEnvironment()) {
Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported)
<< ShaderStage << T.getEnvironmentName() << T.str();
}
+
+ if (T.isDXIL()) {
----------------
sudonatalie wrote:
Sure
https://github.com/llvm/llvm-project/pull/76749
More information about the cfe-commits
mailing list