diff --git a/src/writer/hlsl/generator.cc b/src/writer/hlsl/generator.cc index f8dd82c7c2..d521533a29 100644 --- a/src/writer/hlsl/generator.cc +++ b/src/writer/hlsl/generator.cc @@ -40,6 +40,10 @@ bool Generator::Generate() { return ret; } +bool Generator::GenerateEntryPoint(ast::PipelineStage, const std::string&) { + return false; +} + std::string Generator::result() const { return out_.str(); } diff --git a/src/writer/hlsl/generator.h b/src/writer/hlsl/generator.h index 06cefb9c5b..83f6d27d92 100644 --- a/src/writer/hlsl/generator.h +++ b/src/writer/hlsl/generator.h @@ -41,6 +41,13 @@ class Generator : public Text { /// @returns true on successful generation; false otherwise bool Generate() override; + /// Converts a single entry point + /// @param stage the pipeline stage + /// @param name the entry point name + /// @returns true on succes; false on failure + bool GenerateEntryPoint(ast::PipelineStage stage, + const std::string& name) override; + /// @returns the result data std::string result() const override; diff --git a/src/writer/msl/generator.cc b/src/writer/msl/generator.cc index 1081b4d6c4..46fa0733f0 100644 --- a/src/writer/msl/generator.cc +++ b/src/writer/msl/generator.cc @@ -39,6 +39,10 @@ bool Generator::Generate() { return ret; } +bool Generator::GenerateEntryPoint(ast::PipelineStage, const std::string&) { + return false; +} + std::string Generator::result() const { return impl_->result(); } diff --git a/src/writer/msl/generator.h b/src/writer/msl/generator.h index cfef1f7f5c..d0a9de2aee 100644 --- a/src/writer/msl/generator.h +++ b/src/writer/msl/generator.h @@ -40,6 +40,13 @@ class Generator : public Text { /// @returns true on successful generation; false otherwise bool Generate() override; + /// Converts a single entry point + /// @param stage the pipeline stage + /// @param name the entry point name + /// @returns true on succes; false on failure + bool GenerateEntryPoint(ast::PipelineStage stage, + const std::string& name) override; + /// @returns the result data std::string result() const override; diff --git a/src/writer/spirv/generator.cc b/src/writer/spirv/generator.cc index 6fbe6d7cc7..c28cb130e5 100644 --- a/src/writer/spirv/generator.cc +++ b/src/writer/spirv/generator.cc @@ -43,6 +43,10 @@ bool Generator::Generate() { return true; } +bool Generator::GenerateEntryPoint(ast::PipelineStage, const std::string&) { + return false; +} + } // namespace spirv } // namespace writer } // namespace tint diff --git a/src/writer/spirv/generator.h b/src/writer/spirv/generator.h index 66df5b65e3..c907ef3478 100644 --- a/src/writer/spirv/generator.h +++ b/src/writer/spirv/generator.h @@ -42,6 +42,13 @@ class Generator : public writer::Writer { /// @returns true on successful generation; false otherwise bool Generate() override; + /// Converts a single entry point + /// @param stage the pipeline stage + /// @param name the entry point name + /// @returns true on succes; false on failure + bool GenerateEntryPoint(ast::PipelineStage stage, + const std::string& name) override; + /// @returns the result data const std::vector& result() const { return writer_->result(); } diff --git a/src/writer/wgsl/generator.cc b/src/writer/wgsl/generator.cc index d4dd006f21..613f42acc5 100644 --- a/src/writer/wgsl/generator.cc +++ b/src/writer/wgsl/generator.cc @@ -38,6 +38,10 @@ bool Generator::Generate() { return ret; } +bool Generator::GenerateEntryPoint(ast::PipelineStage, const std::string&) { + return false; +} + std::string Generator::result() const { return impl_->result(); } diff --git a/src/writer/wgsl/generator.h b/src/writer/wgsl/generator.h index db6d65bb3a..2d3a234f8a 100644 --- a/src/writer/wgsl/generator.h +++ b/src/writer/wgsl/generator.h @@ -40,6 +40,13 @@ class Generator : public Text { /// @returns true on successful generation; false otherwise bool Generate() override; + /// Converts a single entry point + /// @param stage the pipeline stage + /// @param name the entry point name + /// @returns true on succes; false on failure + bool GenerateEntryPoint(ast::PipelineStage stage, + const std::string& name) override; + /// @returns the result data std::string result() const override; diff --git a/src/writer/writer.h b/src/writer/writer.h index f569746d35..51e0307d67 100644 --- a/src/writer/writer.h +++ b/src/writer/writer.h @@ -18,6 +18,7 @@ #include #include "src/ast/module.h" +#include "src/ast/pipeline_stage.h" namespace tint { namespace writer { @@ -37,6 +38,13 @@ class Writer { /// @returns true on success; false on failure virtual bool Generate() = 0; + /// Converts a single entry point + /// @param stage the pipeline stage + /// @param name the entry point name + /// @returns true on succes; false on failure + virtual bool GenerateEntryPoint(ast::PipelineStage stage, + const std::string& name) = 0; + protected: /// Constructor /// @param module the tint module to convert