Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <hans-kristian.arntzen@arm.com>2018-10-05 12:30:57 +0300
committerHans-Kristian Arntzen <hans-kristian.arntzen@arm.com>2018-10-19 13:01:31 +0300
commit5bcf02f7c940ce98c86bedf265589722cedd58ed (patch)
tree10e2fef8083127c28ca6a37e5180b357feb6a2cc /spirv_reflect.hpp
parentcc5c0204d8bcdadbb4add03e53346df98bf27fa4 (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_reflect.hpp')
-rw-r--r--spirv_reflect.hpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/spirv_reflect.hpp b/spirv_reflect.hpp
index e402fa8f..fbe7d1f4 100644
--- a/spirv_reflect.hpp
+++ b/spirv_reflect.hpp
@@ -33,14 +33,26 @@ class CompilerReflection : public CompilerGLSL
using Parent = CompilerGLSL;
public:
- CompilerReflection(std::vector<uint32_t> spirv_)
+ explicit CompilerReflection(std::vector<uint32_t> spirv_)
: Parent(move(spirv_))
{
options.vulkan_semantics = true;
}
- CompilerReflection(const uint32_t *ir, size_t word_count)
- : Parent(ir, word_count)
+ CompilerReflection(const uint32_t *ir_, size_t word_count)
+ : Parent(ir_, word_count)
+ {
+ options.vulkan_semantics = true;
+ }
+
+ explicit CompilerReflection(const ParsedIR &ir_)
+ : CompilerGLSL(ir_)
+ {
+ options.vulkan_semantics = true;
+ }
+
+ explicit CompilerReflection(ParsedIR &&ir_)
+ : CompilerGLSL(std::move(ir_))
{
options.vulkan_semantics = true;
}