shader: Implement transform feedbacks and define file format

This commit is contained in:
ReinUsesLisp 2021-04-14 01:04:59 -03:00 committed by ameerj
parent a83579b50a
commit b126987c59
11 changed files with 272 additions and 23 deletions

View file

@ -20,6 +20,13 @@ u32 GenericAttributeIndex(Attribute attribute) {
return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::Generic0X)) / 4u;
}
u32 GenericAttributeElement(Attribute attribute) {
if (!IsGeneric(attribute)) {
throw InvalidArgument("Attribute is not generic {}", attribute);
}
return static_cast<u32>(attribute) % 4;
}
std::string NameOf(Attribute attribute) {
switch (attribute) {
case Attribute::PrimitiveId:

View file

@ -226,6 +226,8 @@ enum class Attribute : u64 {
[[nodiscard]] u32 GenericAttributeIndex(Attribute attribute);
[[nodiscard]] u32 GenericAttributeElement(Attribute attribute);
[[nodiscard]] std::string NameOf(Attribute attribute);
} // namespace Shader::IR