72 lines
2.0 KiB
C++
72 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "assets/components/material_components.hpp"
|
|
#include "assets/components/mesh_vertex_components.hpp"
|
|
#include "shading/features/mesh_features.hpp"
|
|
#include "util/enum_bitfield_operators.hpp"
|
|
|
|
#include <array>
|
|
|
|
namespace rendering::requirements::mesh
|
|
{
|
|
|
|
struct type
|
|
{
|
|
shading::features::mesh::indices::type shader_program_requirement_index{};
|
|
mesh_vertex_components::flags vertex_requirements{
|
|
mesh_vertex_components::flags::none
|
|
};
|
|
material_components::flags material_requirements{
|
|
material_components::flags::none
|
|
};
|
|
};
|
|
|
|
enum class flags : std::uint8_t
|
|
{
|
|
none = 0,
|
|
position = 1 << 0,
|
|
lit = 1 << 1,
|
|
textured = 1 << 2,
|
|
uniform_color = 1 << 3,
|
|
uniform_alpha = 1 << 4,
|
|
point = 1 << 5
|
|
};
|
|
|
|
constexpr inline auto position = type{
|
|
.shader_program_requirement_index = shading::features::mesh::indices::position,
|
|
.vertex_requirements = mesh_vertex_components::flags::position
|
|
};
|
|
|
|
constexpr inline auto lit = type{
|
|
.shader_program_requirement_index = shading::features::mesh::indices::lit,
|
|
.vertex_requirements = mesh_vertex_components::flags::normal,
|
|
.material_requirements = material_components::flags::surface_properties
|
|
};
|
|
|
|
constexpr inline auto point = type{
|
|
.shader_program_requirement_index = shading::features::mesh::indices::point
|
|
};
|
|
|
|
constexpr inline auto textured = type{
|
|
.shader_program_requirement_index = shading::features::mesh::indices::textured,
|
|
.vertex_requirements = mesh_vertex_components::flags::tex_coord,
|
|
.material_requirements = material_components::flags::texture,
|
|
};
|
|
|
|
constexpr inline auto uniform_color = type{
|
|
.shader_program_requirement_index = shading::features::mesh::indices::uniform_color
|
|
};
|
|
|
|
constexpr inline auto uniform_alpha = type{
|
|
.shader_program_requirement_index = shading::features::mesh::indices::uniform_alpha,
|
|
.material_requirements = material_components::flags::transparency
|
|
};
|
|
|
|
constexpr inline auto all = std::array{
|
|
position, lit, textured, uniform_color, uniform_alpha, point
|
|
};
|
|
|
|
}
|
|
|
|
DEFINE_ENUM_BITFIELD_OPERATORS(rendering::requirements::mesh::flags)
|