In the middle of multithreading parsers.

This commit is contained in:
zy4n
2025-03-30 22:38:06 +02:00
parent d18b40a7fc
commit 144126ee7a
80 changed files with 2904 additions and 1450 deletions

View File

@@ -5,51 +5,67 @@
#include "config/primitives.hpp"
#include "assets/identifiers.hpp"
#include "assets/data_stores/texture_store.hpp"
#include "assets/data/surface_properties.hpp"
#include "assets/data/uniform_surface_properties.hpp"
#include "util/enum_bitfield_operators.hpp"
namespace assets::material_components
{
using surface_properties = surface_properties;
using transparency = z3d::f32;
using ambient_color_texture = texture_id;
using diffuse_color_texture = texture_id;
using specular_color_texture = texture_id;
using ambient_filter = z3d::vec3;
using diffuse_filter = z3d::vec3;
using specular_filter = z3d::vec3;
using shininess = z3d::f32;
using alpha = z3d::f32;
using ambient_filter_texture = texture_id;
using diffuse_filter_texture = texture_id;
using specular_filter_texture = texture_id;
using shininess_texture = texture_id;
using alpha_texture = texture_id;
using bump_texture = texture_id;
namespace indices
{
inline constexpr z3d::size surface_properties = 0;
inline constexpr z3d::size transparency = 1;
inline constexpr z3d::size ambient_color_texture = 2;
inline constexpr z3d::size diffuse_color_texture = 3;
inline constexpr z3d::size specular_color_texture = 4;
inline constexpr z3d::size shininess_texture = 5;
inline constexpr z3d::size alpha_texture = 6;
inline constexpr z3d::size bump_texture = 7;
enum : z3d::size
{
ambient_filter,
diffuse_filter,
specular_filter,
shininess,
alpha,
ambient_filter_texture,
diffuse_filter_texture,
specular_filter_texture,
shininess_texture,
alpha_texture,
bump_texture
};
}
enum class flags : z3d::u8
{
none = 0,
surface_properties = 1 << indices::surface_properties,
transparency = 1 << indices::transparency,
ambient_filter_texture = 1 << indices::ambient_color_texture,
diffuse_filter_texture = 1 << indices::diffuse_color_texture,
specular_filter_texture = 1 << indices::specular_color_texture,
ambient_filter = 1 << indices::ambient_filter,
diffuse_filter = 1 << indices::diffuse_filter,
specular_filter = 1 << indices::specular_filter,
shininess = 1 << indices::shininess,
alpha = 1 << indices::alpha,
ambient_filter_texture = 1 << indices::ambient_filter_texture,
diffuse_filter_texture = 1 << indices::diffuse_filter_texture,
specular_filter_texture = 1 << indices::specular_filter_texture,
shininess_texture = 1 << indices::shininess_texture,
alpha_texture = 1 << indices::alpha_texture,
bump_texture = 1 << indices::bump_texture
};
using all = z3d::structure<
surface_properties,
transparency,
ambient_color_texture,
diffuse_color_texture,
specular_color_texture,
ambient_filter,
diffuse_filter,
specular_filter,
shininess,
alpha,
ambient_filter_texture,
diffuse_filter_texture,
specular_filter_texture,
shininess_texture,
alpha_texture,
bump_texture

View File

@@ -0,0 +1,58 @@
#pragma once
#include "config/primitives.hpp"
#include "util/enum_bitfield_operators.hpp"
#include <array>
#include <string_view>
namespace assets::mesh_shader_components
{
namespace indices
{
enum : z3d::size
{
face,
line,
point,
luminance,
color,
alpha,
color_texture,
uniform_lighting,
textured_lighting,
uniform_color
};
}
enum class flags : std::uint16_t
{
none = 0,
face = 1 << indices::face,
line = 1 << indices::line,
point = 1 << indices::point,
luminance = 1 << indices::luminance,
color = 1 << indices::color,
alpha = 1 << indices::alpha,
color_texture = 1 << indices::color_texture,
uniform_lighting = 1 << indices::uniform_lighting,
textured_lighting = 1 << indices::textured_lighting,
uniform_color = 1 << indices::uniform_color
};
constexpr inline auto names = std::array<std::string_view, 10>{
"face",
"line",
"point",
"luminance",
"color",
"alpha",
"color_texture",
"uniform_lighting",
"textured_lighting",
"uniform_color"
};
}
DEFINE_ENUM_BITFIELD_OPERATORS(assets::mesh_shader_components::flags)

View File

@@ -16,11 +16,14 @@ using reflectance = z3d::f32;
namespace indices
{
inline constexpr z3d::size position = 0;
inline constexpr z3d::size normal = 1;
inline constexpr z3d::size tex_coord = 2;
inline constexpr z3d::size color = 3;
inline constexpr z3d::size reflectance = 4;
enum : z3d::size
{
position,
normal,
tex_coord,
color,
reflectance
};
}
enum class flags : z3d::u8

View File

@@ -0,0 +1,46 @@
#pragma once
#include "config/primitives.hpp"
#include "util/enum_bitfield_operators.hpp"
#include <array>
#include <string_view>
namespace assets::point_cloud_shader_components
{
enum indices : z3d::size
{
square,
lighting,
luminance,
color,
alpha,
uniform_color,
rainbow
};
enum class flags : std::uint16_t
{
none = 0,
square = 1 << indices::square,
lighting = 1 << indices::lighting,
luminance = 1 << indices::luminance,
color = 1 << indices::color,
alpha = 1 << indices::alpha,
uniform_color = 1 << indices::uniform_color,
rainbow = 1 << indices::rainbow
};
constexpr inline auto names = std::array<std::string_view, 7>{
"square",
"lighting",
"luminance",
"color",
"alpha",
"uniform_color",
"rainbow"
};
}
DEFINE_ENUM_BITFIELD_OPERATORS(assets::point_cloud_shader_components::flags)

View File

@@ -15,10 +15,13 @@ using reflectance = z3d::f32;
namespace indices
{
inline constexpr z3d::size position = 0;
inline constexpr z3d::size normal = 1;
inline constexpr z3d::size color = 2;
inline constexpr z3d::size reflectance = 3;
enum : z3d::size
{
position,
normal,
color,
reflectance
};
} // namespace indices
enum class flags : z3d::u8

View File

@@ -0,0 +1,35 @@
#pragma once
#include <type_traits>
#include "mesh_shader_components.hpp"
#include "point_cloud_shader_components.hpp"
namespace assets::shader_components
{
enum class stage : z3d::u8
{
vertex = 0,
tesselation_control = 1,
tesselation_evaluation = 2,
geometry = 3,
fragment = 4
};
inline constexpr std::size_t count = 5;
inline constexpr auto stage_names = std::array<std::string_view, count>{
"vertex",
"tesselation_control",
"tesselation_evaluation",
"geometry",
"fragment"
};
using flags = std::make_unsigned_t<std::common_type_t<
std::underlying_type_t<mesh_shader_components::flags>,
std::underlying_type_t<point_cloud_shader_components::flags>
>>;
}