From 0ef9b702890b1d45f0bec5fa75481290323e14dc Mon Sep 17 00:00:00 2001 From: Natalie Chouinard <1953083+sudonatalie@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:28:27 -0700 Subject: [PATCH] [SPIR-V] Error when -Gis is used with -spirv (#4529) Though we may support -Gis with the SPIR-V backend in future, it is currently not supported, so this change makes that explicit to the user with an error message when it is used. Related to #3331 --- lib/DxcSupport/HLSLOptions.cpp | 2 +- tools/clang/test/CodeGenSPIRV/spirv.opt.gis.hlsl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tools/clang/test/CodeGenSPIRV/spirv.opt.gis.hlsl diff --git a/lib/DxcSupport/HLSLOptions.cpp b/lib/DxcSupport/HLSLOptions.cpp index 2019a752a..489355857 100644 --- a/lib/DxcSupport/HLSLOptions.cpp +++ b/lib/DxcSupport/HLSLOptions.cpp @@ -329,7 +329,7 @@ static bool hasUnsupportedSpirvOption(const InputArgList &args, // available options and their current compatibility is needed to generate a // complete list. std::vector unsupportedOpts = {OPT_Fd, OPT_Fre, - OPT_Qstrip_reflect}; + OPT_Qstrip_reflect, OPT_Gis}; for (const auto &id : unsupportedOpts) { if (Arg *arg = args.getLastArg(id)) { diff --git a/tools/clang/test/CodeGenSPIRV/spirv.opt.gis.hlsl b/tools/clang/test/CodeGenSPIRV/spirv.opt.gis.hlsl new file mode 100644 index 000000000..dafdceda6 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/spirv.opt.gis.hlsl @@ -0,0 +1,5 @@ +// RUN: %dxc -T ps_6_0 -E main -spirv -Gis + +void main() {} + +// CHECK: -Gis is not supported with -spirv