This commit is contained in:
ZY4N
2025-03-25 15:57:32 +01:00
parent a78be71e34
commit 70893c083b
24 changed files with 78 additions and 64 deletions

View File

@@ -4,6 +4,8 @@
#include <vector>
#include <optional>
#include <span>
#include "assets/data_stores.hpp"
#include "util/string_lookup.hpp"
#include "opengl/metadata/shader_source_metadata.hpp"
@@ -18,9 +20,15 @@ namespace zgl {
class shader_source_manager {
public:
void process(
const assets::shader_source_store& shader_sources
);
using store_type = assets::shader_source_store;
using store_id_type = store_type::id_type;
using metadata_type = shader_source_metadata;
using data_type = char*;
using handle_type = const char*;
using entry_type = std::pair<metadata_type, store_id_type>;
using entry_view_type = std::pair<preprocessed_shader_source_metadata, handle_type>;
void process(const assets::data_stores& stores);
void get_shader_sources(
const assets::shader_source_store& shader_sources,
@@ -74,14 +82,12 @@ protected:
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;
using source_lookup_entry_type = std::pair<shader_source_metadata, assets::shader_source_store::id_type>;
using source_lookup_type = std::vector<source_lookup_entry_type>;
source_lookup_type m_shader_source_lookup;
};
}