Further shader compilation development.
This commit is contained in:
43
include/opengl/shading/features/combined_features.hpp
Normal file
43
include/opengl/shading/features/combined_features.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "opengl/shading/model_geometry.hpp"
|
||||
#include "mesh_features.hpp"
|
||||
#include "point_cloud_features.hpp"
|
||||
#include "generic_features.hpp"
|
||||
|
||||
namespace zgl::shading::features::combined
|
||||
{
|
||||
union type
|
||||
{
|
||||
features::mesh::flags mesh;
|
||||
features::point_cloud::flags point_cloud;
|
||||
|
||||
[[nodiscard]] features::generic::type to_generic(const model_geometry::types geometry) const noexcept
|
||||
{
|
||||
switch (geometry)
|
||||
{
|
||||
case model_geometry::types::mesh:
|
||||
return static_cast<features::generic::type>(mesh);
|
||||
case model_geometry::types::point_cloud:
|
||||
return static_cast<features::generic::type>(point_cloud);
|
||||
}
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
void from_generic(
|
||||
const model_geometry::types geometry,
|
||||
const features::generic::type new_features
|
||||
) noexcept {
|
||||
switch (geometry)
|
||||
{
|
||||
case model_geometry::types::mesh:
|
||||
mesh = static_cast<features::mesh::flags>(new_features);
|
||||
case model_geometry::types::point_cloud:
|
||||
point_cloud = static_cast<features::point_cloud::flags>(new_features);
|
||||
}
|
||||
std::unreachable();
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user