From 8348fd411b80336dbf013305e861570c50d53f40 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 30 Sep 2019 13:22:18 -0400 Subject: Store formats in pipeline and scripts. (#677) This CL removes the unique_ptr from the probe and buffer classes and stores pointers instead. The lifetimes are managed by the pipeline and script objects. This removes the need to do the copy and assignment operators for the format class. --- src/script.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/script.h') diff --git a/src/script.h b/src/script.h index 3e0dc3c..62b4433 100644 --- a/src/script.h +++ b/src/script.h @@ -27,6 +27,7 @@ #include "src/buffer.h" #include "src/command.h" #include "src/engine.h" +#include "src/format.h" #include "src/pipeline.h" #include "src/shader.h" @@ -170,6 +171,11 @@ class Script : public RecipeImpl { /// Retrieves the SPIR-V target environment. const std::string& GetSpvTargetEnv() const { return spv_env_; } + Format* RegisterFormat(std::unique_ptr fmt) { + formats_.push_back(std::move(fmt)); + return formats_.back().get(); + } + private: struct { std::vector required_features; @@ -186,6 +192,7 @@ class Script : public RecipeImpl { std::vector> commands_; std::vector> buffers_; std::vector> pipelines_; + std::vector> formats_; }; } // namespace amber -- cgit v1.2.3