shader: Rework varyings and implement passthrough geometry shaders

Put all varyings into a single std::bitset with helpers to access it.

Implement passthrough geometry shaders using host's.
This commit is contained in:
ReinUsesLisp 2021-06-24 02:41:09 -03:00 committed by ameerj
parent 4f052a1f39
commit 7dafa96ab5
29 changed files with 351 additions and 337 deletions

View file

@ -222,6 +222,8 @@ enum class Attribute : u64 {
FrontFace = 255,
};
constexpr size_t NUM_GENERICS = 32;
[[nodiscard]] bool IsGeneric(Attribute attribute) noexcept;
[[nodiscard]] u32 GenericAttributeIndex(Attribute attribute);
@ -230,6 +232,10 @@ enum class Attribute : u64 {
[[nodiscard]] std::string NameOf(Attribute attribute);
[[nodiscard]] constexpr IR::Attribute operator+(IR::Attribute attribute, size_t value) noexcept {
return static_cast<IR::Attribute>(static_cast<size_t>(attribute) + value);
}
} // namespace Shader::IR
template <>

View file

@ -27,6 +27,7 @@ struct Program {
u32 invocations{};
u32 local_memory_size{};
u32 shared_memory_size{};
bool is_geometry_passthrough{};
};
[[nodiscard]] std::string DumpProgram(const Program& program);