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

@@ -9,7 +9,7 @@
#include "util/string_lookup.hpp"
#include "opengl/metadata/shader_source_metadata.hpp"
#include "opengl/shading/requirements/shader_source_requirements.hpp"
#include "opengl/shading/requirements/shader_requirements.hpp"
#include "opengl/metadata/preprocessed_shader_source_metadata.hpp"
#include "assets/data_stores/shader_source_store.hpp"
@@ -30,64 +30,21 @@ public:
void process(const store_type& shader_sources);
void get_shader_sources(
void fetch(
const assets::shader_source_store& shader_sources,
std::span<const shading::shader_source_requirements> requirements,
std::span<const shading::shader_requirements> requirements,
std::span<preprocessed_shader_source_metadata> metadata,
std::vector<const char*>& shader_strings
);
protected:
void tokenize_declarations(std::string_view source);
std::optional<shader_source_metadata> parse_metadata_from_tokens();
[[nodiscard]] static bool parse_stage_declaration(
std::span<const std::string_view> values,
shader_source_metadata& metadata
);
[[nodiscard]] static bool parse_geometry_declaration(
std::span<const std::string_view> tokens,
shader_source_metadata& metadata
);
[[nodiscard]] static bool parse_features_declaration(
std::span<const std::string_view> values,
shader_source_metadata& metadata
);
[[nodiscard]] static bool parse_static_enable_declaration(
std::span<const std::string_view> values,
shader_source_metadata& metadata
);
[[nodiscard]] static bool parse_dynamic_enable_declaration(
std::span<const std::string_view> values,
shader_source_metadata& metadata
);
template<typename T>
static void parse_feature_tokens(
std::span<const std::string_view> values,
const ztu::string_lookup<T>& feature_lookup,
T& features
);
static void get_define_strings(
shading::model_geometry::types geometry,
shading::features::generic::type features,
shading::features::generic::type& feature_count,
assets::model_geometry::types geometry_type,
assets::shader_components::flags components,
assets::shader_components::flags& component_count,
std::vector<const char*>& defines
);
std::vector<entry_type> m_shader_source_lookup;
private:
std::vector<std::string_view> m_value_token_buffer;
std::vector<std::size_t> m_declaration_token_count_buffer;
std::array<std::size_t, 4> m_declaration_type_index_buffer;
};
}