#pragma once #include #include #include namespace lt::renderer::components { enum class VertexFormat : uint8_t { r32_g32_b32_sfloat, r32_g32_sfloat, }; enum class VertexInputRate : uint8_t { per_vertex, per_instance, }; struct VertexInputAttributeDescriptipn { uint32_t location; uint32_t binding; uint32_t offset; VertexFormat format; }; struct VertexInputBindingDescription { uint32_t binding; uint32_t stride; }; /** Requires a math::components::Transform component on the same entity to be functional. */ struct Sprite { struct Vertex { math::vec3 position; math::vec3 color; [[nodiscard]] constexpr static auto get_attributes() -> std::array { return { VertexInputAttributeDescriptipn { .location = 0u, .binding = 0u, .offset = offsetof(Sprite::Vertex, position), .format = VertexFormat::r32_g32_b32_sfloat, }, VertexInputAttributeDescriptipn { .location = 1u, .binding = 0u, .offset = offsetof(Sprite::Vertex, color), .format = VertexFormat::r32_g32_b32_sfloat, }, }; } }; memory::Ref vertex_shader; memory::Ref fragment_shader; }; } // namespace lt::renderer::components