Added a Compiler ctor that takes IR as raw array and count
This avoids the need to construct a temporary std::vector on the application side just to create a Compiler instance if application itself doesn't use STL containers.
This commit is contained in:
parent
af75c7585a
commit
ae8de51138
@ -70,6 +70,12 @@ Compiler::Compiler(vector<uint32_t> ir)
|
|||||||
parse();
|
parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Compiler::Compiler(const uint32_t *ir, size_t word_count)
|
||||||
|
: spirv(ir, ir + word_count)
|
||||||
|
{
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
string Compiler::compile()
|
string Compiler::compile()
|
||||||
{
|
{
|
||||||
// Force a classic "C" locale, reverts when function returns
|
// Force a classic "C" locale, reverts when function returns
|
||||||
|
@ -106,6 +106,7 @@ public:
|
|||||||
|
|
||||||
// The constructor takes a buffer of SPIR-V words and parses it.
|
// The constructor takes a buffer of SPIR-V words and parses it.
|
||||||
Compiler(std::vector<uint32_t> ir);
|
Compiler(std::vector<uint32_t> ir);
|
||||||
|
Compiler(const uint32_t *ir, size_t word_count);
|
||||||
|
|
||||||
virtual ~Compiler() = default;
|
virtual ~Compiler() = default;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user