mirror of
https://github.com/yuzu-emu/sirit
synced 2024-11-22 18:03:54 +00:00
Add version select and OpLogicalNot
This commit is contained in:
parent
4043020f45
commit
4f66fb18e9
3 changed files with 11 additions and 3 deletions
|
@ -27,7 +27,7 @@ using Id = const Op*;
|
|||
|
||||
class Module {
|
||||
public:
|
||||
explicit Module();
|
||||
explicit Module(std::uint32_t version = spv::Version);
|
||||
~Module();
|
||||
|
||||
/**
|
||||
|
@ -238,6 +238,11 @@ class Module {
|
|||
/// Make an intermediate object whose value is undefined.
|
||||
Id OpUndef(Id result_type);
|
||||
|
||||
// Logical
|
||||
|
||||
/// Result is true if Operand is false. Result is false if Operand is true.
|
||||
Id OpLogicalNot(Id result_type, Id operand);
|
||||
|
||||
private:
|
||||
Id AddCode(std::unique_ptr<Op> op);
|
||||
|
||||
|
@ -247,6 +252,8 @@ class Module {
|
|||
|
||||
Id AddAnnotation(std::unique_ptr<Op> op);
|
||||
|
||||
const std::uint32_t version;
|
||||
|
||||
std::uint32_t bound{1};
|
||||
|
||||
std::set<spv::Capability> capabilities;
|
||||
|
|
|
@ -20,6 +20,7 @@ add_library(sirit
|
|||
insts/memory.cpp
|
||||
insts/annotation.cpp
|
||||
insts/misc.cpp
|
||||
insts/logical.cpp
|
||||
)
|
||||
target_include_directories(sirit
|
||||
PUBLIC ../include
|
||||
|
|
|
@ -26,7 +26,7 @@ template <typename T> static void WriteSet(Stream& stream, const T& set) {
|
|||
}
|
||||
}
|
||||
|
||||
Module::Module() {}
|
||||
Module::Module(u32 version) : version(version) {}
|
||||
|
||||
Module::~Module() = default;
|
||||
|
||||
|
@ -35,7 +35,7 @@ std::vector<u8> Module::Assemble() const {
|
|||
Stream stream{bytes};
|
||||
|
||||
stream.Write(spv::MagicNumber);
|
||||
stream.Write(spv::Version);
|
||||
stream.Write(version);
|
||||
stream.Write(GENERATOR_MAGIC_NUMBER);
|
||||
stream.Write(bound);
|
||||
stream.Write(static_cast<u32>(0));
|
||||
|
|
Loading…
Reference in a new issue