Further shader compilation development.

This commit is contained in:
zy4n
2025-03-22 17:40:08 +01:00
parent e01b8c2e09
commit 510398423a
45 changed files with 1567 additions and 1097 deletions

View 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();
}
};
}