mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-22 12:45:40 +01: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
@ -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 New Issue
Block a user