mirror of
https://github.com/yuzu-emu/sirit
synced 2024-11-22 16:44:00 +00:00
Add overload for decorating with enums
Skip an explicit cast on the caller, allowing code like: Decorate(some_op, spv::Decoration::BuiltIn, spv::BuiltIn::WorkgroupId)
This commit is contained in:
parent
ab567491e1
commit
cae2725cc0
1 changed files with 7 additions and 0 deletions
|
@ -368,6 +368,13 @@ public:
|
||||||
return Decorate(target, decoration, std::span<const Literal>{stack_literals});
|
return Decorate(target, decoration, std::span<const Literal>{stack_literals});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add a decoration to target.
|
||||||
|
template <typename T>
|
||||||
|
requires std::is_enum_v<T>
|
||||||
|
Id Decorate(Id target, spv::Decoration decoration, T literal) {
|
||||||
|
return Decorate(target, decoration, static_cast<std::uint32_t>(literal));
|
||||||
|
}
|
||||||
|
|
||||||
Id MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
|
Id MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
|
||||||
std::span<const Literal> literals = {});
|
std::span<const Literal> literals = {});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue