mirror of
https://github.com/yuzu-emu/sirit
synced 2024-11-22 18:03:54 +00:00
Add OpString
This commit is contained in:
parent
d4c95981b5
commit
96e8290eef
2 changed files with 9 additions and 0 deletions
|
@ -200,6 +200,9 @@ class Module {
|
|||
/// @return target
|
||||
Id Name(Id target, const std::string& name);
|
||||
|
||||
/// Assign a Result <id> to a string for use by other debug instructions.
|
||||
Id OpString(const std::string& string);
|
||||
|
||||
// Memory
|
||||
|
||||
/// Allocate an object in memory, resulting in a copy to it.
|
||||
|
|
|
@ -19,4 +19,10 @@ Id Module::Name(Id target, const std::string& name) {
|
|||
return target;
|
||||
}
|
||||
|
||||
Id Module::OpString(const std::string& string) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpString, bound++)};
|
||||
op->Add(string);
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
} // namespace Sirit
|
||||
|
|
Loading…
Reference in a new issue