mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-22 06:15:37 +01:00
Add OpMemberName
This commit is contained in:
parent
ad963b6520
commit
1cd11815db
@ -200,6 +200,10 @@ class Module {
|
||||
/// @return target
|
||||
Id Name(Id target, const std::string& name);
|
||||
|
||||
/// Assign a name string to a member of a structure type.
|
||||
/// @return type
|
||||
Id MemberName(Id type, std::uint32_t member, const std::string& name);
|
||||
|
||||
/// Assign a Result <id> to a string for use by other debug instructions.
|
||||
Id String(const std::string& string);
|
||||
|
||||
|
@ -19,6 +19,15 @@ Id Module::Name(Id target, const std::string& name) {
|
||||
return target;
|
||||
}
|
||||
|
||||
Id Module::MemberName(Id type, u32 member, const std::string& name) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpMemberName)};
|
||||
op->Add(type);
|
||||
op->Add(member);
|
||||
op->Add(name);
|
||||
debug.push_back(std::move(op));
|
||||
return type;
|
||||
}
|
||||
|
||||
Id Module::String(const std::string& string) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpString, bound++)};
|
||||
op->Add(string);
|
||||
|
Loading…
Reference in New Issue
Block a user