[glsl] Remove `glsl` AST paths from `tint` command.
This CL removes the GLSL AST path from the `tint` command. It will
always generate with IR now. The end-to-end runner has had `glsl`
removed as a generation option.
Bug: 374724003
Change-Id: If12bacd35e743ddc31ec018854001728b672f17c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/211734
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index e94bc08..7d5f4df 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -1053,7 +1053,7 @@
tint::ast::transform::Manager transform_manager;
tint::ast::transform::DataMap transform_inputs;
- if (options.use_ir && !entry_point_name.empty()) {
+ if (!entry_point_name.empty()) {
transform_manager.append(std::make_unique<tint::ast::transform::SingleEntryPoint>());
transform_inputs.Add<tint::ast::transform::SingleEntryPoint::Config>(entry_point_name);
}
@@ -1107,18 +1107,14 @@
offset += 8;
}
- tint::Result<tint::glsl::writer::Output> result;
- if (options.use_ir) {
- // Convert the AST program to an IR module.
- auto ir = tint::wgsl::reader::ProgramToLoweredIR(single_prog);
- if (ir != tint::Success) {
- std::cerr << "Failed to generate IR: " << ir << "\n";
- return false;
- }
- result = tint::glsl::writer::Generate(ir.Get(), gen_options, "");
- } else {
- result = tint::glsl::writer::Generate(single_prog, gen_options, entry_point_name);
+ // Convert the AST program to an IR module.
+ auto ir = tint::wgsl::reader::ProgramToLoweredIR(single_prog);
+ if (ir != tint::Success) {
+ std::cerr << "Failed to generate IR: " << ir << "\n";
+ return false;
}
+ auto result = tint::glsl::writer::Generate(ir.Get(), gen_options, "");
+
if (result != tint::Success) {
tint::cmd::PrintWGSL(std::cerr, single_prog);
std::cerr << "Failed to generate: " << result.Failure() << "\n";
diff --git a/tools/src/cmd/tests/main.go b/tools/src/cmd/tests/main.go
index 73dc412..21da5b4 100644
--- a/tools/src/cmd/tests/main.go
+++ b/tools/src/cmd/tests/main.go
@@ -61,7 +61,6 @@
const (
testTimeout = 2 * time.Minute
- glsl = outputFormat("glsl")
glslIR = outputFormat("glsl-ir")
hlslFXC = outputFormat("hlsl-fxc")
hlslFXCIR = outputFormat("hlsl-fxc-ir")
@@ -74,7 +73,7 @@
)
// allOutputFormats holds all the supported outputFormats
-var allOutputFormats = []outputFormat{wgsl, spvasm, msl, mslIR, hlslDXC, hlslDXCIR, hlslFXC, hlslFXCIR, glsl, glslIR}
+var allOutputFormats = []outputFormat{wgsl, spvasm, msl, mslIR, hlslDXC, hlslDXCIR, hlslFXC, hlslFXCIR, glslIR}
// The root directory of the dawn project
var dawnRoot = fileutils.DawnRoot()
@@ -140,7 +139,7 @@
var maxTableWidth int
numCPU := runtime.NumCPU()
verbose, generateExpected, generateSkip := false, false, false
- flag.StringVar(&formatList, "format", "all", "comma separated list of formats to emit. Possible values are: all, wgsl, spvasm, msl, msl-ir, hlsl, hlsl-ir, hlsl-dxc, hlsl-dxc-ir, hlsl-fxc, hlsl-fxc-ir, glsl, glsl-ir")
+ flag.StringVar(&formatList, "format", "all", "comma separated list of formats to emit. Possible values are: all, wgsl, spvasm, msl, msl-ir, hlsl, hlsl-ir, hlsl-dxc, hlsl-dxc-ir, hlsl-fxc, hlsl-fxc-ir, glsl-ir")
flag.StringVar(&ignore, "ignore", "**.expected.*", "files to ignore in globs")
flag.StringVar(&dxcPath, "dxcompiler", "", "path to DXC DLL for validating HLSL output")
flag.StringVar(&fxcPath, "fxc", "", "path to FXC DLL for validating HLSL output")
@@ -674,7 +673,7 @@
// expectedFilePath is the path to the expected output file for the given test
expectedFilePath := j.file + ".expected."
- useIr := j.format == hlslDXCIR || j.format == hlslFXCIR || j.format == mslIR || j.format == glslIR
+ useIr := j.format == hlslDXCIR || j.format == hlslFXCIR || j.format == mslIR
switch j.format {
case hlslDXC:
@@ -740,7 +739,7 @@
case wgsl:
args = append(args, "--validate") // wgsl validation uses Tint, so is always available
validate = true
- case spvasm, glsl, glslIR:
+ case spvasm, glslIR:
args = append(args, "--validate") // spirv-val and glslang are statically linked, always available
validate = true
case hlslDXC, hlslDXCIR:
@@ -1054,7 +1053,7 @@
case "hlsl-fxc-ir":
return []outputFormat{hlslFXCIR}, nil
case "glsl":
- return []outputFormat{glsl}, nil
+ return []outputFormat{glslIR}, nil
case "glsl-ir":
return []outputFormat{glslIR}, nil
default: