[wgsl-writer] Add ProgramOptions for IR->AST
This is used to convey information about allowed language features and
whether non-uniform derivatives should be permitted.
This is needed for the new SPIR-V to WGSL flow, which will be two
separate steps.
Bug: tint:1907
Change-Id: I065247e784f50a90b9b2f30e03fdbb124e94153e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/165301
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/lang/wgsl/writer/writer.cc b/src/tint/lang/wgsl/writer/writer.cc
index a9ef260..6cc8422 100644
--- a/src/tint/lang/wgsl/writer/writer.cc
+++ b/src/tint/lang/wgsl/writer/writer.cc
@@ -67,13 +67,13 @@
return output;
}
-Result<Output> WgslFromIR(core::ir::Module& module) {
+Result<Output> WgslFromIR(core::ir::Module& module, const ProgramOptions& options) {
// core-dialect -> WGSL-dialect
if (auto res = Raise(module); !res) {
return res.Failure();
}
- auto program = IRToProgram(module);
+ auto program = IRToProgram(module, options);
if (!program.IsValid()) {
return Failure{program.Diagnostics()};
}