diff options
author | alan-baker <33432579+alan-baker@users.noreply.github.com> | 2019-05-27 20:31:02 -0400 |
---|---|---|
committer | dan sinclair <dsinclair@google.com> | 2019-05-27 20:31:02 -0400 |
commit | d38363bb451f395fcba5a83c663898220299888a (patch) | |
tree | b1a82aa2e8935c4ccc5fe687693d40891db6658f /src/pipeline.h | |
parent | 47dfd3c7f3e337153ee84556a4558b2ede08c3ab (diff) | |
download | amber-d38363bb451f395fcba5a83c663898220299888a.tar.gz |
Shader specialization (#525)
* Parser support for SPECIALIZE subcommand of ATTACH
* Documentation
* Support Vulkan pipeline creation using shader specialization
Fixes #510
Diffstat (limited to 'src/pipeline.h')
-rw-r--r-- | src/pipeline.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pipeline.h b/src/pipeline.h index 554494c..af0f85e 100644 --- a/src/pipeline.h +++ b/src/pipeline.h @@ -15,6 +15,7 @@ #ifndef SRC_PIPELINE_H_ #define SRC_PIPELINE_H_ +#include <map> #include <memory> #include <string> #include <utility> @@ -59,12 +60,20 @@ class Pipeline { const std::vector<uint32_t> GetData() const { return data_; } void SetData(std::vector<uint32_t>&& data) { data_ = std::move(data); } + const std::map<uint32_t, uint32_t>& GetSpecialization() const { + return specialization_; + } + void AddSpecialization(uint32_t spec_id, uint32_t value) { + specialization_[spec_id] = value; + } + private: Shader* shader_ = nullptr; ShaderType shader_type_; std::vector<std::string> shader_optimizations_; std::string entry_point_; std::vector<uint32_t> data_; + std::map<uint32_t, uint32_t> specialization_; }; /// Information on a buffer attached to the pipeline. |