diff options
author | Hans-Kristian Arntzen <hans-kristian.arntzen@arm.com> | 2018-10-05 12:30:57 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <hans-kristian.arntzen@arm.com> | 2018-10-19 13:01:31 +0300 |
commit | 5bcf02f7c940ce98c86bedf265589722cedd58ed (patch) | |
tree | 10e2fef8083127c28ca6a37e5180b357feb6a2cc /spirv_hlsl.hpp | |
parent | cc5c0204d8bcdadbb4add03e53346df98bf27fa4 (diff) |
Hoist out parsing module from spirv_cross::Compiler.
This is a large refactor which splits out the SPIR-V parser from
Compiler and moves it into its more appropriately named Parser module.
The Parser is responsible for building a ParsedIR structure which is
then consumed by one or more compilers.
Compiler can take a ParsedIR by value or move reference. This should
allow for optimal case for both multiple compilations and single
compilation scenarios.
Diffstat (limited to 'spirv_hlsl.hpp')
-rw-r--r-- | spirv_hlsl.hpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spirv_hlsl.hpp b/spirv_hlsl.hpp index bcc82b10..1cab2cb4 100644 --- a/spirv_hlsl.hpp +++ b/spirv_hlsl.hpp @@ -56,13 +56,23 @@ public: bool point_coord_compat = false; }; - CompilerHLSL(std::vector<uint32_t> spirv_) + explicit CompilerHLSL(std::vector<uint32_t> spirv_) : CompilerGLSL(move(spirv_)) { } - CompilerHLSL(const uint32_t *ir, size_t size) - : CompilerGLSL(ir, size) + CompilerHLSL(const uint32_t *ir_, size_t size) + : CompilerGLSL(ir_, size) + { + } + + explicit CompilerHLSL(const ParsedIR &ir_) + : CompilerGLSL(ir_) + { + } + + explicit CompilerHLSL(ParsedIR &&ir_) + : CompilerGLSL(std::move(ir_)) { } |