aboutsummaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
authordan sinclair <dsinclair@google.com>2019-09-30 13:22:18 -0400
committerGitHub <noreply@github.com>2019-09-30 13:22:18 -0400
commit8348fd411b80336dbf013305e861570c50d53f40 (patch)
tree99910d0617227c58d6b8f51db5ac5c2b656f2e0c /src/script.h
parent3624da9a117643a3d6cb12f80838f668f763c89e (diff)
downloadamber-8348fd411b80336dbf013305e861570c50d53f40.tar.gz
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.
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h7
1 files changed, 7 insertions, 0 deletions
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<Format> fmt) {
+ formats_.push_back(std::move(fmt));
+ return formats_.back().get();
+ }
+
private:
struct {
std::vector<std::string> required_features;
@@ -186,6 +192,7 @@ class Script : public RecipeImpl {
std::vector<std::unique_ptr<Command>> commands_;
std::vector<std::unique_ptr<Buffer>> buffers_;
std::vector<std::unique_ptr<Pipeline>> pipelines_;
+ std::vector<std::unique_ptr<Format>> formats_;
};
} // namespace amber